Skip to content

Commit 27ab543

Browse files
authored
Add --ignore-daemonsets to docs of kubectl drain
1 parent 8d326ad commit 27ab543

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

content/en/docs/tasks/administer-cluster/safely-drain-node.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,14 @@ kubectl get nodes
6666
Next, tell Kubernetes to drain the node:
6767

6868
```shell
69-
kubectl drain <node name>
69+
kubectl drain --ignore-daemonsets <node name>
7070
```
7171

72+
If there are daemon set managed pods, drain will not proceed without `--ignore-daemonsets`,
73+
and regardless it will not delete any daemon set managed pods,
74+
because those pods would be immediately replaced by the daemon set controller,
75+
which ignores unschedulable markings.
76+
7277
Once it returns (without giving an error), you can power down the node
7378
(or equivalently, if on a cloud platform, delete the virtual machine backing the node).
7479
If you leave the node in the cluster during the maintenance operation, you need to run

0 commit comments

Comments
 (0)