Pods are Pending during a traffic spike because the cluster is out of capacity. What do you do now and long term?
IntermediateScenarioScaling and performance
Answer
Situation read → The HPA did its job; the node layer didn't keep up.
What I'd do →
- See why:
kubectl get pods -n prod --field-selector=status.phase=Pending
kubectl describe pod <pending> -n prod | tail -5
# 0/12 nodes are available: 12 Insufficient cpu.
- Check the node autoscaler logs (Karpenter or Cluster Autoscaler): hitting its limits, ASG max size, EC2 vCPU quota,
InsufficientInstanceCapacityfor one instance type, or no free IPs in the subnet. - Immediate: raise the limit, or allow more instance types in the Karpenter NodePool.
- Long term: keep headroom with low-priority placeholder pods (overprovisioning) that get preempted when real pods need space, and diversify instance types.
- Right-size requests; inflated requests waste capacity and trigger this sooner.
Why → New nodes take 1–3 minutes; overprovisioning makes scale-up feel instant.
Interview tip → Mention placeholder pods with a negative PriorityClass for headroom.
More on Scaling and performance
Traffic is expected to 10x for a sale next week. How do you prepare the platform?IntermediateThe HPA is configured but pods don't scale even though the app is slow. Why?BeginnerThe database CPU is at 95% and the API is timing out. What's your approach?Intermediate"Too many connections" errors from Postgres after scaling the app out. How do you fix it?IntermediateLatency is fine on average but p99 is terrible. Where do you look?AdvancedOne pod in a deployment is much slower than the others. How do you investigate?Beginner