How to fix a pod stuck in Pending in Kubernetes
A Pending pod was accepted by the cluster but has not started running yet. It is almost always the scheduler failing to find a node it fits on, and it tells you why in the FailedScheduling event.
1. Read the FailedScheduling event
kubectl describe pod <pod> -n <namespace>
kubectl get events -n <namespace> --field-selector reason=FailedScheduling What the message means
- Insufficient cpu or Insufficient memory: no node has enough free requests. What counts is the sum of requests, not real usage. Lower the request, add nodes or let the cluster autoscaler add one.
- untolerated taint: the nodes have a taint the pod does not tolerate (system, GPU or spot nodes). Add the toleration or send the pod to another pool.
- didn't match Pod's node affinity/selector: no node has the labels asked for in the nodeSelector or affinity.
- unbound immediate PersistentVolumeClaims: the PVC could not get a volume. Check with kubectl describe pvc: wrong StorageClass, no provisioner or a cloud disk quota.
- volume node affinity conflict: the disk is in one zone and the nodes with room are in another.
- Too many pods: the node hit its maximum pod count, which on AKS and EKS depends on the node’s network setup.
2. See how much still fits on each node
kubectl describe nodes | grep -A 8 "Allocated resources"
kubectl top nodes Pending with a node already
If the pod already has a node (NODE column in kubectl get pod -o wide) and is still Pending, the problem comes after the scheduler: the image is being pulled (see ImagePullBackOff), a volume is mounting or an init container is running. describe shows which step it is stuck on.
Without a terminal, in Kubepier
In Kubepier, Pending pods count as failing pods and warning events such as FailedScheduling rise to the top, with usage per node alongside, from any cluster, in the browser or on your phone.