What does `kubectl drain` do?

IntermediateConceptKubernetes
Answer

It cordons the node (no new pods) and evicts the existing pods while respecting PDBs. It's used before maintenance or an upgrade.

kubectl drain node-1 --ignore-daemonsets --delete-emptydir-data
All Real-World Interview questions Roadmap: Interview readiness

More on Kubernetes