cannot delete DaemonSet-managed Pods: kubectl drain refuses to proceed because DaemonSet pods cannot be evicted
DaemonSet pods would be recreated on the same node immediately, so drain refuses to evict them without an explicit flag. The same applies to pods with local storage and to unmanaged pods.
Applies to: All Kubernetes versions
What it means
kubectl drain evicts pods from a node so it can be taken out of service, and it refuses categories of pod where eviction would be futile or destructive. DaemonSet pods are futile — the controller would immediately recreate them on the same node, since that is what a DaemonSet does. Pods using emptyDir are potentially destructive, because that data is node-local and evicting the pod destroys it. And pods with no controller are unrecoverable, since nothing would recreate them elsewhere. Each has its own flag, and each flag is an acknowledgement of a specific consequence rather than a formality.
Most common causes
- DaemonSet pods on the node, which is normal and expected on every node.
- Pods using
emptyDirvolumes, where drain warns about data loss. - Bare pods with no controlling object, which would not be recreated.
- Mirror pods for static control-plane components, which are managed by the kubelet from files on disk.
- A PodDisruptionBudget blocking eviction, which is a separate and different refusal.
How to diagnose it
- Read which category the message names — the flag needed differs per category.
- List the pods on the node with their owners:
kubectl get pods --all-namespaces -o wide --field-selector spec.nodeName=NODE. - Check for pods with no owner references, which are the unmanaged ones.
- Check whether any pod uses
emptyDirand whether that data matters. - Check disruption budgets separately, since a PDB block is a different refusal with different implications.
How to fix it
- Use
--ignore-daemonsets, which is standard practice for any drain. DaemonSet pods stay and are removed when the node is deleted. - Use
--delete-emptydir-dataonly after confirming the data is genuinely disposable. The flag's name is the warning. - Use
--forcefor unmanaged pods, understanding that they are deleted permanently and nothing will recreate them. - Resolve PodDisruptionBudget blocks by making the budget satisfiable rather than by bypassing it.
- Script the drain with the flags your environment needs, so the decision is made once and deliberately rather than under time pressure.
Notes
--delete-emptydir-data is the flag worth pausing on. Caches and scratch space are fine to lose; a workload keeping state in an emptyDir because it seemed convenient is not, and drain is the moment that becomes apparent.
Related
- Cannot evict pod — A disruption budget is blocking the eviction
- SchedulingDisabled — The node has been cordoned
Sources
- Kubernetes documentation — Safely Drain a Node
- Kubernetes documentation — DaemonSet
- Kubernetes documentation — Disruptions