KubernetesCoreOpsFlipkartSwiggyAsked in SRE and DevOps engineer roundsRead the full interview experience →FREE
A new pod has been Pending for 20 minutes. What are the possible reasons, and how do you narrow it down?
The scenario
A team scaled their deployment from 4 to 12 replicas before a sale. 8 pods are Pending. The cluster autoscaler is enabled.
Model answer
Reviewed by Ankit SharmaPending means the scheduler hasn't placed the pod, or it's placed but waiting on something before it can start.
- kubectl describe pod: the Events line from the scheduler usually says it outright, e.g. "0/6 nodes are available: 3 Insufficient cpu, 3 node(s) had taint…".
- Insufficient resources: requests are too high for any node, or the cluster is full. Check kubectl describe nodes for allocated requests (not real usage).
- Taints and tolerations, nodeSelector or node affinity that no node matches.
- PVC not bound: the storage class can't provision, or the volume is in another availability zone than any free node.
- Pod anti-affinity or topology spread constraints that can't be satisfied.
- With the autoscaler: check its logs or status ConfigMap. It may be at max nodes, the node group's instance type may be too small for the request, or cloud quota may have run out.
The follow-up they'll ask
“The autoscaler says it can't scale up because no node group fits. What does that mean?”
No node group's instance type can fit the pod's requests or satisfy its selectors and tolerations, even when empty. Lower the requests, add a larger node group, or fix the selector.
Common mistakes
- Looking at node CPU usage instead of allocated requests
- Forgetting PVC binding and zone constraints
- Not reading the scheduler's message in Events
Practise it in War Zone · 1 free tryChallenge: fix a broken manifestCoreOps · 60 min
Break it and fix it →