Interview Prep/Kubernetes/Scheduling and Pending Pods

Pods are Pending and the Cluster Autoscaler log says `pod didn't trigger scale-up: 2 max node group size reached, 1 node(s) didn't match Pod's node affinity`.

IntermediateTroubleshootingScheduling and Pending Pods
Answer

Likely causes → The node groups that could fit the Pod are at their maximum, and the others cannot satisfy its constraints (affinity, taints, zone, instance size).

Diagnose →

kubectl describe pod web-x | grep -A3 TriggeredScaleUp\|NotTriggerScaleUp
kubectl -n kube-system logs deploy/cluster-autoscaler | grep -i 'web-x'
kubectl -n kube-system get cm cluster-autoscaler-status -o yaml

Fix → Raise the max size of the matching ASG, or add a node group whose labels/taints/instance size fit the Pod.

Prevent → Alert on node groups at max; keep node group templates (labels/taints) in sync with workload selectors.

All Kubernetes questions Roadmap: Kubernetes core

More on Scheduling and Pending Pods