Debugging Pending Pods: Scheduling Failures in Kubernetes
Fast recall
Quick revision
Core answer
kubectl describe pod first — the Events section almost always shows the exact reason. Common causes: (1) Insufficient resources — no node has the requested CPU/memory; fix by adding nodes (Cluster Autoscaler/Karpenter) or lowering requests, (2) Affinity / taints / topology spread constraints that exclude all nodes, (3) PersistentVolumeClaim unbound because no StorageClass or no PV matches, (4) No nodes match `nodeSelector` labels, (5) ImagePullBackOff-like but for scheduling when node has taint and pod lacks toleration, (6) Quota exceeded on namespace. Walk the stack: events → node capacity → PVC status → affinity/taints → quota.Systematic debugging skill — Google SRE-style 'give me a hypothesis per data point' reasoning
Jumping to 'restart the pod' or 'add more nodes' before reading `kubectl describe` events; assuming Pending always means resource shortage
Explain scheduler's Filter+Score phases, how to read `FailedScheduling` events, PVC WaitForFirstConsumer binding mode, topologySpreadConstraints DoNotSchedule vs ScheduleAnyway, and ResourceQuota vs LimitRange differences
Interview-ready guide
Interview answer
When a pod is stuck in Pending, my first move is always kubectl describe pod and I read the Events section. The scheduler writes its failure reason there — it will literally say why each node was rejected.
Walking the decision tree
- The most common reason is resource shortage — "0/6 nodes are available: Insufficient cpu". I check
kubectl top nodesfor headroom and compare requests to allocatable; then check the Cluster Autoscaler or Karpenter logs to see why it isn't adding nodes. - A key concept: the scheduler uses requests, not actual usage. A node at 30% CPU usage can still reject pods if committed requests already total 95% of allocatable — the scheduler is pessimistic.
- If Events mention untolerated taints, I run
kubectl describe nodeand grep for Taints; the fix is either adding a matching toleration or removing the taint. - If Events mention unbound PVC, I check
kubectl get pvcanddescribe pvc— usually wrong zone, missing StorageClass, or CSI driver unhealthy. - If Events mention topology spread or affinity, I check the pod spec's constraints —
DoNotSchedulespread with tightmaxSkewis a classic cause during rolling updates. - If Events mention exceeded quota,
kubectl describe resourcequotashows used vs hard limits.
Catching things `describe pod` doesn't tell you
- If Events are empty after several minutes, the scheduler itself might be unhealthy or a validating admission webhook is blocking — check
kube-schedulerpod and validatingwebhookconfigurations. - Nodes auto-taint on NotReady or memory-pressure — if every new pod is Pending with taint reasons cluster-wide, the cluster is unhealthy, not the pod.
- Pod density limits per node on AWS VPC CNI — a t3.small only holds 11 pods, so CPU-free doesn't mean pod-free.
Preventive patterns I put in place
- Use VPA in recommend-only mode to right-size requests — oversized requests cause unnecessary Pending.
- PodDisruptionBudget plus minReplicas 2 so rolling updates don't pin a lone pod unable to find a new home.
- PriorityClasses on critical workloads so they preempt lower-priority pods rather than sit Pending.
- Prometheus alert on
kube_pod_status_phase{phase="Pending"} > 5m— anything Pending more than 5 minutes is an incident.
Escalation order
- Single pod Pending → look at the pod's constraints.
- All new pods in one namespace → Quota, StorageClass, default LimitRange.
- All new pods cluster-wide → scheduler health, CNI/CSI driver, node readiness.
Debugging `Pending` Pods: Scheduling Failures in Kubernetes
Direct Answer
Run kubectl describe pod first — the Events section almost always shows the exact reason. Common causes: (1) Insufficient resources — no node has the requested CPU/memory; fix by adding nodes (Cluster Autoscaler/Karpenter) or lowering requests, (2) Affinity / taints / topology spread constraints that exclude all nodes, (3) PersistentVolumeClaim unbound because no StorageClass or no PV matches, (4) No nodes match nodeSelector labels, (5) ImagePullBackOff-like but for scheduling when node has taint and pod lacks toleration, (6) Quota exceeded on namespace. Walk the stack: events → node capacity → PVC status → affinity/taints → quota.
Common Mistakes & Pitfalls
Jumping to 'restart the pod' or 'add more nodes' before reading kubectl describe events; assuming Pending always means resource shortage
Check your understanding
Answer these without looking back at the article.
- What is the difference between `WaitForFirstConsumer` and `Immediate` volumeBindingMode?
- How do PriorityClass and preemption help prevent Pending pods for critical workloads?
- How does Cluster Autoscaler decide to add a node vs Karpenter's approach?
- What is the difference between ResourceQuota and LimitRange?
Related interview prep categories
2Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.