Kubernetes "0/3 nodes are available: insufficient cpu/memory" in CI - Fix it
The scheduler checked every node and none has enough unreserved CPU or memory to satisfy the pod's requests. The pod stays Pending with a FailedScheduling event, and the rollout never completes. This is capacity versus requests, not a crash.
What this error means
After a deploy, pods stay Pending and kubectl describe pod shows 0/3 nodes are available: 3 Insufficient cpu (or Insufficient memory).
Warning FailedScheduling default-scheduler 0/3 nodes are available:
3 Insufficient cpu. preemption: 0/3 nodes are available: 3 No preemption victims found.Common causes
Requests exceed available node capacity
The summed requests of pods on every node leave no room for the new pod, so none can host it.
Over-large requests on a small node pool
A single pod requests more CPU/memory than any node has allocatable, so it can never be placed.
How to fix it
Right-size requests or add capacity
- Read the FailedScheduling event to see whether cpu or memory is short.
- Lower the pod's
requestsif they are inflated, or add/grow nodes. - Re-check that a node now has room and the pod schedules.
kubectl describe pod <pod> | sed -n '/Events/,$p'
kubectl describe nodes | grep -A3 'Allocated resources'Set realistic resource requests
Requests reserve capacity; set them to what the workload actually needs so the scheduler can place it.
resources:
requests:
cpu: "250m"
memory: "256Mi"How to prevent it
- Base
requestson measured usage so they fit node capacity. - Enable cluster autoscaling for bursty deploys.
- Watch node allocatable headroom before large rollouts.