πŸ”§ Error Fixes
Β· 1 min read

Kubernetes: Pod Stuck in Pending β€” How to Fix It


A pod in Pending state means Kubernetes accepted it but can’t schedule it onto a node. It’s waiting for something.

What causes this error

  1. Insufficient resources β€” no node has enough CPU or memory
  2. PersistentVolumeClaim not bound β€” the PVC can’t find a matching PV
  3. Node selector/affinity mismatch β€” no node matches the pod’s requirements
  4. Too many pods β€” the node has hit its pod limit

Fix 1: Check why it’s pending

kubectl describe pod my-pod
# Look at the "Events" section at the bottom
# Common messages:
# "Insufficient cpu" β†’ need more CPU
# "Insufficient memory" β†’ need more RAM
# "no nodes available" β†’ all nodes are full
# "persistentvolumeclaim not found" β†’ PVC issue

Fix 2: Insufficient resources

# Check node capacity
kubectl describe nodes | grep -A5 "Allocated resources"

# Option 1: Reduce your pod's resource requests
# resources:
#   requests:
#     cpu: "100m"      # was "500m"
#     memory: "128Mi"  # was "512Mi"

# Option 2: Add more nodes to the cluster

# Option 3: Delete pods you don't need
kubectl delete pod unused-pod

Fix 3: PVC not binding

# Check PVC status
kubectl get pvc
# If STATUS is "Pending", the PVC can't find a PV

# Check available PVs
kubectl get pv

# Common fix: create a StorageClass or provision a PV
# Or check that the storage class name matches

Fix 4: Node selector issues

# Check node labels
kubectl get nodes --show-labels

# If your pod requires a label that no node has:
kubectl label node my-node disktype=ssd

Quick diagnostic

kubectl get pod my-pod -o wide  # See which node (if any)
kubectl get events --sort-by='.lastTimestamp' | tail -20  # Recent events

Related: Kubernetes kubectl cheat sheet Β· Kubernetes: Pod Evicted fix Β· Kubernetes: CrashLoopBackOff fix Β· What is Kubernetes

πŸ“˜