When Kubernetes can’t schedule new pods due to insufficient CPU resources, you need to quickly identify and free up resources from existing workloads.

Error

Insufficient CPU. preemption 0/3 nodes are available

Kubernetes Insufficient CPU Error

Solution

Step 1: Identify Resource Hogs

Find the pods consuming the most CPU across all namespaces:

kubectl top pods --sort-by=cpu -A
~ devops@acme-corp(k8s: acme-prod-cluster) $ kubectl top pods --sort-by=cpu -A
NAMESPACE    NAME                                        CPU(cores)   MEMORY(bytes)
services     user-auth-consumer-697b77b56-84h2s          36m          184Mi
services     order-processor-consumer-5d86b5967d-mfwc5   28m          136Mi
services     notification-service-f77bccdfb-68svn        28m          139Mi

Step 2: Choose Your Approach

Gracefully restart the highest consuming services:

kubectl -n services rollout restart deploy user-auth
kubectl -n services rollout restart deploy order-processor
kubectl -n services rollout restart deploy notification-service

Option 2: Delete Specific Pods

For immediate resource release (avoid with stateful services):

kubectl delete pod user-auth-consumer-697b77b56-84h2s -n services

Note: Avoid deleting stateful workloads, databases, or long-running jobs.

Why This Works

  • Restarting deployments creates fresh pods with cleared memory/CPU state
  • Kubernetes scheduler can better distribute resources across nodes
  • Graceful restarts maintain service availability during the process

This approach quickly frees up cluster resources without affecting critical stateful services.