Q: How do you run a privileged debug container on a running pod without modifying the pod spec?
kubectl debug -it <pod> --image=ubuntu --share-processes --copy-to=debug-pod — creates a copy of the pod with an extra debug container.
#Kubernetes #Advanced Scenarios #L2 #Container Orchestration #K8s
🎙️ Candidate Opening & Architectural Context
""Kubernetes is a declarative desired state system; understanding the reconciliation loop is how you diagnose this quickly. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Production Solution & Architecture
kubectl debug -it — creates a copy of the pod with an extra debug container.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: kubectl debug -it --image=ubuntu --share-processes --copy-to=debug-pod — creates a copy of the pod with an extra debug container.."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: kubectl debug -it --image=ubuntu --share-processes --copy-to=debug-pod — creates a copy of the
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement