`kubectl top nodes` shows nodes at 20% CPU, yet new Pods fail with `Insufficient cpu`. Explain it to a developer.
BeginnerTroubleshootingScheduling and Pending Pods
Answer
Likely causes → Requests are reservations. Teams requested far more than they use, so nodes are "full" on paper but idle in reality.
Diagnose →
kubectl describe node ip-10-0-1-23 | grep -A6 'Allocated resources'
# cpu 3800m (97%) <- requested
kubectl top node ip-10-0-1-23
# CPU(cores) 780m (20%) <- used
kubectl top pods -A --sort-by=cpu | head
Fix → Lower requests for over-provisioned Deployments to match real usage plus headroom; reclaim the slack.
Prevent → Track the requested-vs-used ratio per namespace on a dashboard; LimitRange defaults so Pods without requests do not get oversized ones.
More on Scheduling and Pending Pods
Pods are Pending with `0/5 nodes are available: 5 Insufficient cpu. preemption: 0/5 nodes are available: 5 No preemption victims found for incoming pod.`Beginner`0/4 nodes are available: 1 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }, 3 node(s) had untolerated taint {dedicated: gpu}`.BeginnerA StatefulSet Pod is Pending with `pod has unbound immediate PersistentVolumeClaims`.Beginner`0/3 nodes are available: 3 node(s) didn't match Pod's node affinity/selector.`BeginnerA 6-replica Deployment has 3 Pods Running and 3 Pending: `0/3 nodes are available: 3 node(s) didn't match pod anti-affinity rules`.IntermediatePods are Pending with `node(s) didn't match pod topology spread constraints` even though one zone has lots of free capacity.Intermediate