Interview Prep/Kubernetes/Resources, autoscaling and scheduling

How do you drain a node safely for maintenance?

BeginnerScenarioResources, autoscaling and scheduling
Answer

Situation read → A node needs kernel patching.

What I'd do →

  1. kubectl cordon node-1
  2. kubectl drain node-1 --ignore-daemonsets --delete-emptydir-data
  3. Watch for PDB-blocked evictions and fix them
  4. Patch and reboot
  5. kubectl uncordon node-1

Why → Drain evicts pods through the Eviction API, honouring PDBs and grace periods.

Interview tip → Mention that bare pods are not rescheduled.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, autoscaling and scheduling