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:
Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "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."
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.
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.
- 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.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Restarting a crashing container without examining preceding termination logs via kubectl logs --previous when configuring stuck Pending state Restarting the pod flushes ephemeral container runtime state, destroying vital panic stack traces and fatal initialization logs.
-
Misdiagnosing an application boot crash as a failure of aggressive liveness probes when configuring stuck Pending state
Liveness probes with short timeouts or high failure thresholds kill slow-starting applications repeatedly, causing false
CrashLoopBackOffloops. -
Neglecting node taints, tolerations, and resource quotas when diagnosing pods stuck in Pending when configuring stuck Pending state
Pods remain
Pendingwhen scheduler predicates fail;kubectl describe podreveals whether CPU/memory exhaustion or taints prevent placement. - Invoking kubectl delete pod --force --grace-period=0 indiscriminately on unready pods when configuring stuck Pending state in kubernetes-q001-your-pod-is-stuck-in-pending-state- Forced deletion bypasses kubelet cleanup and can cause multi-attach errors on PersistentVolumes (PVs) or split-brain on stateful workloads.