Interview Prep/Kubernetes/Nodes, kubelet and container runtime

Nodes are `Ready` but `kubectl get nodes` shows `Ready,SchedulingDisabled` on a node nobody cordoned, and Pods are slowly leaving it.

IntermediateTroubleshootingNodes, kubelet and container runtime
Answer

Likely causes → An automated actor is draining it: Cluster Autoscaler scale-down, Karpenter consolidation or disruption (drift, expiry), a managed node group update, AWS Node Termination Handler reacting to a spot interruption or scheduled event, or kured rebooting for patches.

Diagnose →

kubectl get node ip-10-0-1-5 -o jsonpath='{.metadata.annotations}{"\n"}{.spec.taints}' | tr ',' '\n'
kubectl get events -A --field-selector involvedObject.name=ip-10-0-1-5 --sort-by=.lastTimestamp | tail
kubectl get nodeclaims 2>/dev/null

Fix → Usually nothing; let it finish. If it is unwanted, adjust the actor (Karpenter disruption budgets, karpenter.sh/do-not-disrupt annotation, autoscaler scale-down-utilization-threshold).

Prevent → PDBs on every service so automated drains stay safe, and a dashboard of node disruption events.

All Kubernetes questions

More on Nodes, kubelet and container runtime