Interview Prep/Real-World Interview/Kubernetes cluster-level

A spot capacity event reclaimed a third of the nodes within two minutes and the checkout service dropped to zero ready pods.

AdvancedTroubleshootingKubernetes cluster-level
Answer

Likely causes → All checkout replicas ran on spot nodes of the same instance type in the same pools, so one reclaim took all of them. Without a handler, the 2-minute interruption notice wasn't used to drain, and with no PDB or topology spread nothing stopped the replicas from being co-located.

Diagnose →

kubectl get pods -l app=checkout -o wide
kubectl get nodes -L karpenter.sh/capacity-type,node.kubernetes.io/instance-type,topology.kubernetes.io/zone
kubectl get events -A | grep -iE 'spot|interrupt|terminat' | tail

Fix → Scale checkout up on on-demand capacity now (a node affinity for capacity-type=on-demand on critical services).

Prevent → Run a baseline of critical replicas on on-demand, spread replicas with topologySpreadConstraints across zones and nodes, diversify spot across many instance types, handle interruption notices (Karpenter interruption queue or AWS Node Termination Handler), and set PDBs so drains happen one pod at a time.

All Real-World Interview questions Roadmap: Interview readiness

More on Kubernetes cluster-level