Below is a complete, production-grade list of all common reasons why a Kubernetes pod stays in Pending
state, along with detailed solutions, commands, and how to verify and fix each issue.
🔍 How to Start Investigating
kubectl describe pod <pod-name>
Code language: HTML, XML (xml)
Focus on the Events:
section — it will reveal why the pod is stuck.
🔁 Common Reasons and Solutions
# | Reason | Error Message / Symptom | Command to Diagnose | How to Fix |
---|---|---|---|---|
1 | ❌ No available nodes (unschedulable) | 0/2 nodes are available: Not schedulable | kubectl get nodes | Ensure at least one node is Ready and schedulable. Use: kubectl uncordon <node> |
2 | ❌ Node Taints (control-plane nodes tainted) | pod didn't tolerate node taint | `kubectl describe node | grep Taint` |
3 | ❌ Node Selectors / Affinity don’t match | 0/2 nodes match node selector | `kubectl get pod -o yaml | grep -A5 nodeSelector` |
4 | ❌ Tolerations missing for tainted nodes | No matching tolerations for taints | kubectl describe node <node> Check taints: | Add toleration in pod spec:yaml<br>tolerations:<br> - key: "example-key"<br> operator: "Exists"<br> |
5 | ❌ Insufficient CPU or Memory | insufficient memory , insufficient cpu | kubectl describe pod <pod> kubectl describe node <node> | Reduce pod resources.requests in YAML:yaml<br>resources:<br> requests:<br> cpu: "100m"<br> memory: "256Mi"<br> |
6 | ❌ Too many pods on node (maxPods limit reached) | Too many pods | `kubectl describe node | grep pods` |
7 | ❌ PersistentVolumeClaim (PVC) pending | pod has unbound PersistentVolumeClaims | kubectl get pvc | Create or bind the PVC:kubectl get pv Ensure storage class and capacity match |
8 | ❌ ImagePullBackOff (incorrect image or no access) | Appears first as Pending , then ContainerCreating , then ImagePullBackOff | kubectl describe pod <pod> | Check image name and registry authFix typo or use imagePullSecrets |
9 | ❌ Missing CNI plugin (pod networking not ready) | network plugin is not ready | kubectl get pods -n kube-system | Ensure CNI is deployed:kubectl apply -f <cni-yaml> (e.g., Calico, Flannel) |
10 | ❌ DNS issues inside cluster | Pods remain stuck in Pending or ContainerCreating | kubectl logs <pod> or kubectl exec -it <pod> -- nslookup kubernetes | Ensure kube-dns or CoreDNS is running:kubectl get pods -n kube-system |
11 | ❌ Pod Disruption Budgets (PDBs) | Not enough available pods to meet the PDB | kubectl get pdb | Adjust minAvailable or maxUnavailable in your PDB |
12 | ❌ InitContainers stuck or failing | Pod hangs in Init: | kubectl describe pod <pod> Check Init: section | Fix issues in the InitContainer: volume mounts, scripts, dependencies |
13 | ❌ Pod Quotas / LimitRanges hit | LimitRange violated , ResourceQuota exceeded | kubectl describe quota kubectl describe limitrange | Adjust resource quotas / limits:kubectl edit quota <name> |
14 | ❌ Custom Scheduler misconfiguration | No default-scheduler events | kubectl describe pod <pod> check .spec.schedulerName | Use correct scheduler, or omit schedulerName to default to default-scheduler |
15 | ❌ No available IPs (CNI limit) | Not shown in event, but pod stuck | Check kubelet logs or CNI plugin logs | Ensure node’s CNI plugin can allocate more IPs (esp. AWS, Azure) |
16 | ❌ Container runtime errors (e.g., containerd/dockerd) | Pod stuck in Pending or ContainerCreating | journalctl -u containerd or docker info | Restart the runtime:sudo systemctl restart containerd |
17 | ❌ Cluster Autoscaler delay (in autoscaled clusters) | waiting for node scale up | kubectl describe pod and look for scaling delay messages | Wait or trigger autoscaler node scaling |
18 | ❌ Security context or PodSecurityPolicy blocks | violates PodSecurityPolicy | kubectl describe pod <pod> | Ensure pod adheres to allowed securityContext / capabilities |
19 | ❌ ServiceAccount or RBAC missing | Forbidden: ServiceAccount ... | kubectl describe pod | Create or bind proper ServiceAccount with correct RBAC |
20 | ❌ Wrong Namespace used | Pod is Pending , PVC not found | kubectl get pods -A kubectl get pvc -A | Ensure objects are created in the same namespace or use -n flag |
🧪 Bonus: Best Commands for Troubleshooting
# Check events on the pod
kubectl describe pod <pod-name>
# Check node pod limits
kubectl describe node <node-name> | grep -A10 Allocatable
# List all pods on a node
kubectl get pods --all-namespaces -o wide | grep <node-name>
# PVC status
kubectl get pvc
# CNI status
kubectl get pods -n kube-system | grep -E 'cni|calico|flannel'
# Resource quotas
kubectl describe resourcequota
kubectl describe limitrange
# Get pod spec with scheduler/affinity/tolerations
kubectl get pod <pod-name> -o yaml
Code language: PHP (php)
🧭 How to Fix Pending in General
- Start with
kubectl describe pod
- If it says:
Too many pods
→ IncreasemaxPods
or add nodesInsufficient cpu/memory
→ Reduce resource requests or free up nodeTaint
→ Add toleration or remove taintPVC pending
→ Fix volume- No message → Check CNI/DNS
Here is a Bash script that checks for the 20 most common reasons why Kubernetes pods are stuck in Pending
state.
✅ It loops over all Pending pods and checks taints, resources, PVCs, tolerations, affinity, maxPods, etc.
📦 You can copy, save as
check-pending-pods.sh
, and run on your control-plane/master node.
✅ check-pending-pods.sh
#!/bin/bash
echo "=========================="
echo "🔍 Checking Pending Pods..."
echo "=========================="
PENDING_PODS=$(kubectl get pods --all-namespaces --field-selector=status.phase=Pending -o jsonpath='{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{"\n"}{end}')
if [ -z "$PENDING_PODS" ]; then
echo "✅ No pending pods found."
exit 0
fi
echo "$PENDING_PODS" | while read namespace pod; do
echo ""
echo "🔍 Analyzing pod: $pod in namespace: $namespace"
echo "------------------------------------------------"
# Describe pod
kubectl describe pod $pod -n $namespace > /tmp/pod_desc.txt
# 1. Check for failed scheduling
grep -i "FailedScheduling" /tmp/pod_desc.txt
# 2. Check node selectors
echo "🧪 NodeSelector:"
grep -A2 "Node-Selectors" /tmp/pod_desc.txt
# 3. Check tolerations
echo "🧪 Tolerations:"
grep -A5 "Tolerations:" /tmp/pod_desc.txt
# 4. Check affinity
echo "🧪 Affinity:"
kubectl get pod $pod -n $namespace -o jsonpath='{.spec.affinity}' || echo "None"
# 5. Check resource requests
echo "🧪 Resource Requests:"
kubectl get pod $pod -n $namespace -o jsonpath='{range .spec.containers[*]}{.name}{" => CPU: "}{.resources.requests.cpu}{" | MEM: "}{.resources.requests.memory}{"\n"}{end}'
# 6. Check PVCs
echo "🧪 PVCs:"
PVCs=$(kubectl get pod $pod -n $namespace -o jsonpath='{.spec.volumes[*].persistentVolumeClaim.claimName}')
for pvc in $PVCs; do
echo " 🔄 PVC: $pvc => Status: $(kubectl get pvc $pvc -n $namespace -o jsonpath='{.status.phase}')"
done
# 7. Check scheduler
echo "🧪 Scheduler:"
kubectl get pod $pod -n $namespace -o jsonpath='{.spec.schedulerName}'; echo
echo ""
done
echo "==============================="
echo "🔍 Checking Node Conditions..."
echo "==============================="
for node in $(kubectl get nodes -o name); do
echo ""
echo "Node: $node"
echo "-----------"
echo "🧪 Taints:"
kubectl describe $node | grep Taint || echo "No taints"
echo "🧪 Allocatable Resources:"
kubectl describe $node | grep -A10 "Allocatable"
echo "🧪 Max Pods Limit:"
kubectl describe $node | grep -A10 Allocatable | grep "pods"
echo "🧪 Running Pods Count:"
nodeName=$(basename $node)
kubectl get pods --all-namespaces -o wide | grep $nodeName | wc -l
done
echo ""
echo "✅ Done checking all pending pod conditions!"
Code language: PHP (php)
🧪 How to Use
- Save the script:
nano check-pending-pods.sh
# Paste the code
chmod +x check-pending-pods.sh
Code language: CSS (css)
- Run the script:
./check-pending-pods.sh
✅ What it Checks
- Pod scheduling failures
- Node selectors
- Tolerations
- Affinity/anti-affinity
- CPU/Memory resource requests
- PVC binding status
- Scheduler used
- Taints on nodes
- Allocatable and used pod count
- Max pod limits
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow , and SEO strategies at Wizbrand.
Do you want to learn Quantum Computing?
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at WIZBRAND