Evict pods from a node
high risk
kubectl drain <node> --ignore-daemonsets --dry-run=serverPreview firstkubectl get pdb -ACheck disruption budgetsPrepares a node for maintenance. See the flags and examples below, and run `man kubectl` for the full reference.
| Flag | Meaning |
|---|---|
--ignore-daemonsets --ignore-daemonsets | Skip DaemonSets |
--delete-emptydir-data --delete-emptydir-data | Delete emptyDir data⚠ Local data is lost. |
--force --force | Evict unmanaged pods⚠ Pods are deleted permanently. |
--dry-run --dry-run | Preview |
--grace-period --grace-period | Termination grace |
kubectl drain node1 --ignore-daemonsets --dry-run=serverPreview · explain & risk-check →kubectl uncordon node1Allow scheduling again · explain & risk-check →Reference text is hand-written and may be incomplete — check man kubectl for your version. Test destructive commands on a non-production system first.