Interview Prep/Kubernetes/Scheduling and Pending Pods

`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.

All Kubernetes questions Roadmap: Kubernetes core

More on Scheduling and Pending Pods