Add `--ignore-daemonsets` to docs of `kubectl drain`

This commit is contained in:
Thomas Güttler 2023-01-13 09:57:35 +01:00 committed by GitHub
parent 8d326ad840
commit 27ab5439c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -66,9 +66,14 @@ kubectl get nodes
Next, tell Kubernetes to drain the node: Next, tell Kubernetes to drain the node:
```shell ```shell
kubectl drain <node name> kubectl drain --ignore-daemonsets <node name>
``` ```
If there are daemon set managed pods, drain will not proceed without `--ignore-daemonsets`,
and regardless it will not delete any daemon set managed pods,
because those pods would be immediately replaced by the daemon set controller,
which ignores unschedulable markings.
Once it returns (without giving an error), you can power down the node Once it returns (without giving an error), you can power down the node
(or equivalently, if on a cloud platform, delete the virtual machine backing the node). (or equivalently, if on a cloud platform, delete the virtual machine backing the node).
If you leave the node in the cluster during the maintenance operation, you need to run If you leave the node in the cluster during the maintenance operation, you need to run