Requests too big, or every node is full
Insufficient cpu Insufficient memory
What you see
Events:
Type Reason From Message
Warning FailedScheduling default-scheduler 0/3 nodes are available: 3 Insufficient cpu. preemption: 0/3 nodes are available: 3 No preemption victims found for incoming pod.# Karpenter tried, but its NodePool is at its limit
Warning FailedScheduling karpenter Failed to schedule pod, all available instance types exceed limits for nodepool (NodePool=default)
# Cluster Autoscaler tried, but the node group is at its max size
Normal NotTriggerScaleUp cluster-autoscaler pod didn't trigger scale-up: 1 max node group size reachedThe scheduler only compares requests with each node's allocatable capacity, not real usage. A node at 20% CPU can still be full on requests.
Confirm
# What does the Pod ask for?
kubectl get pod web-7d9f8c6b5-x2k4q -n shop -o jsonpath='{.spec.containers[*].resources.requests}'
# What is already requested on each node? (cpu and memory: requests, limits)
kubectl describe nodes | grep -E "^Name:|^ (cpu|memory) +[0-9]"
# Did a node autoscaler react, and if not, why?
kubectl get events -n shop --field-selector involvedObject.name=web-7d9f8c6b5-x2k4qWith Karpenter, a Nominated event (Pod should schedule on: nodeclaim/…) means a node is on its way. With Cluster Autoscaler, look for TriggeredScaleUp.
Fix
- One Pod asks for more than any node can give (say
cpu: 6on 4 vCPU nodes): a new node of the same size won't help. Lower the request, or allow a bigger instance type in the NodePool or node group. - Nodes are just full: let the node autoscaler add one. If Karpenter says the NodePool
exceed limits, raisespec.limitson the NodePool. If Cluster Autoscaler saysmax node group size reached, raise the node group'smaxSize. - No node autoscaler: raise the managed node group's desired size, for example
aws eks update-nodegroup-config --cluster-name prod --nodegroup-name general --scaling-config minSize=3,maxSize=8,desiredSize=5.
Prevent
- Set requests from measured usage (Container Insights, Prometheus, or VPA recommendations), not guesses.
- Leave headroom in NodePool limits and node group max sizes, and alert when a Pod has been Pending for more than a few minutes.
- In shared namespaces, use a LimitRange to set default requests and a maximum per container.