How To Fix Kubernetes Pod Stuck In Pending [Solved]

Immediate Fix: Identify the Cause

The fastest way to fix a Pending pod is to inspect the Kubernetes events. Run the following command to see why the scheduler is unable to place your pod:

kubectl describe pod [POD_NAME]

Scroll to the Events section at the bottom. Look for messages like “Insufficient cpu”, “pod has unbound immediate PersistentVolumeClaims”, or “nodes are available: 1 node(s) had taint”.

If the issue is resource-related, you can temporarily resolve it by deleting unused pods or scaling your cluster:

kubectl delete pod [OLD_UNUSE_POD]

Technical Explanation: Why Pods Stay Pending

In Kubernetes, the Pending state means that the API server has accepted the pod creation request, but the Scheduler cannot find a Node that meets all the pod’s requirements.

The Scheduler goes through a process of filtering and scoring. If no node passes the filtering stage, the pod remains unscheduled. Common technical hurdles include:

  • Resource Exhaustion: The requested CPU or Memory exceeds the available capacity of any single node.
  • Unsatisfied PVCs: The pod requires a Persistent Volume that hasn’t been provisioned or is in a different zone.
  • Taints and Tolerations: The nodes have taints that the pod does not tolerate.
  • Node Selectors: The pod is looking for a label (e.g., disktype=ssd) that no node possesses.

Kubernetes Pod Stuck in Pending Status Troubleshooting Diagram

Alternative Methods to Resolve Pending States

If the describe command doesn’t provide a clear path, check the overall health of your nodes. Sometimes the nodes themselves are under pressure or “NotReady”.

kubectl get nodes

Review the table below for common scenarios and their specific resolutions:

Error Message / Symptom Primary Cause Recommended Action
Insufficient cpu / memory Resource limits too high Lower the resources.requests in your YAML.
pod has unbound PVC Storage issues Check PVC status with kubectl get pvc.
node(s) had untolerated taint Scheduling restriction Add a toleration to your pod specification.
0/N nodes are available Cluster at capacity Add more nodes to the cluster or use an autoscaler.

Check for Resource Quotas

In multi-tenant environments, a ResourceQuota on the namespace might be preventing the pod from starting, even if the nodes have physical space. Check quotas with:

kubectl get resourcequota -n [NAMESPACE]

Verify Node Affinity

If you are using nodeAffinity or nodeSelector, ensure your labels match exactly. A typo in a label will leave the pod in a perpetual Pending state because the Scheduler is strictly following your constraints.