Prompt
How do I troubleshoot pods stuck in Pending in Kubernetes?
Latest observation
Pods stuck in Pending usually mean Kubernetes hasn’t been able to schedule them onto a node yet, or the pod is waiting on some prerequisite like storage or secrets. Here’s a practical troubleshooting flow.
1) Inspect the pod details first
kubectl describe pod <pod-name> -n <namespace>
Look especially at:
- Events at the bottom
- Conditions like
PodScheduled: False - Messages such as:
0/3 nodes are availableInsufficient cpuInsufficient memorynode(s) had taintpersistentvolumeclaim is not boundpod has unbound immediate PersistentVolumeClaimsdidn't match Pod's node affinity/selector
2) Check if the pod is unschedulable
If the pod is Pending because no node can accept it, the scheduler events will tell you why.
Common causes:
Resource shortages
Check node capacity and usage:
kubectl get nodes
kubectl describe node <node-name>
Look for:
- CPU/memory already allocated
DiskPressure,MemoryPressure,PIDPressure- Allocatable vs requested resources
Also review pod requests/limits:
kubectl get pod <pod-name> -n <namespace> -o yaml
Pay attention to:
resources.requestsresources.limits
A pod can stay pending if its requests are larger than any available node.
Node selectors / affinity rules
Check for:
nodeSelectoraffinitynodeAffinity
If they’re too restrictive, no node will match.
Taints and tolerations
Nodes may repel pods unless they have matching tolerations:
kubectl describe node <node-name>
Look for taints like:
NoSchedulePreferNoScheduleNoExecute
If your pod lacks a matching toleration, it won’t schedule.
3) Check PVCs and storage
A very common cause is storage not being ready.
kubectl get pvc -n <namespace>
kubectl describe pvc <pvc-name> -n <namespace>
Look for:
PendingPVC- No matching
StorageClass - Provisioner failures
- Volume binding issues
If the pod uses a PVC that is not Bound, the pod can remain Pending.
Also check:
kubectl get storageclass
4) Check namespace quotas and limits
Resource quotas can block scheduling.
kubectl get resourcequota -n <namespace>
kubectl describe resourcequota -n <namespace>
Also check:
kubectl get limitrange -n <namespace>
kubectl describe limitrange -n <namespace>
A quota or limit range may prevent the pod from being admitted or scheduled.
5) Check cluster autoscaler / node availability
If the cluster is supposed to scale up automatically, the pod may be waiting for a new node.
Things to verify:
- autoscaler is running
- node group has capacity
- cloud provider limits aren’t reached
- nodes aren’t stuck in provisioning
Check:
kubectl get nodes
kubectl get events -A --sort-by=.metadata.creationTimestamp
6) Check image pull vs Pending
If the pod status is actually ContainerCreating or ErrImagePull, that’s different from pure scheduling Pending.
Use:
kubectl describe pod <pod-name> -n <namespace>
If you see image pull errors, inspect:
- image name/tag
- registry access
imagePullSecrets- network connectivity to registry
7) Review scheduler logs if needed
If the reason isn’t obvious:
kubectl -n kube-system logs -l component=kube-scheduler
In managed Kubernetes, you may need provider-specific access or logs.
8) Useful quick commands
kubectl get pods -n <namespace> -o wide
kubectl describe pod <pod-name> -n <namespace>
kubectl get events -n <namespace> --sort-by=.metadata.creationTimestamp
kubectl get nodes
kubectl describe node <node-name>
kubectl get pvc -n <namespace>
kubectl describe pvc <pvc-name> -n <namespace>
Common fixes
- Lower pod CPU/memory requests
- Add more nodes or enable autoscaling
- Remove overly strict node affinity/selector rules
- Add tolerations for node taints
- Fix PVC/storage class issues
- Increase quota
- Fix image pull secrets if it’s actually an image issue
If you want, I can also give you a step-by-step debugging checklist or help interpret the output of kubectl describe pod.
Brands