Q: Your pod is stuck in `Pending` state. What do you do?
First run kubectl describe pod <pod-name> and look at the Events section at the bottom. Common reasons for Pending:
#Kubernetes #Troubleshooting & Debugging #L1 #Container Orchestration #K8s #Terraform State
🎙️ Candidate Opening & Architectural Context
""In our production Kubernetes clusters running microservices on EKS/AKS, this was a classic operational challenge. The interviewer is testing: Basic Kubernetes debugging workflow.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Initial Diagnostics & Root Cause Analysis
First run kubectl describe pod and look at the Events section at the bottom. Common reasons for Pending:
- No nodes with enough resources — the node doesn't have enough CPU or memory. Check with
kubectl get nodesandkubectl describe node. - No matching node selector or affinity — the pod has a
nodeSelectorthat doesn't match any node label. - Taints not tolerated — the node has a taint the pod doesn't tolerate.
2️⃣
Remediation & Permanent Safeguards
Fix based on the root cause shown in the events.
- PVC not bound — if the pod needs a volume, the PersistentVolumeClaim may be stuck.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: No nodes with enough resources — the node doesn't have enough CPU or memory. Check with kubectl get nodes and kubectl describe nod."
⚡ 60-Second Elevator Pitch Talking Points
- No nodes with enough resources — the node doesn't have enough CPU or memory. Check with kubectl g...
- No matching node selector or affinity — the pod has a nodeSelector that doesn't match any node la...
- Taints not tolerated — the node has a taint the pod doesn't tolerate.
Advertisement