I have a running DaemonSet
which is running on all nodes. I want to remove it from a node in order to completely drain it, as kubectl drain
doesn't get rid of them. Without deleting my DaemonSet
, what's a good way to temporarily remove those pods from the node? I've tried draining it and deleting the DaemonSet
pods, but the DaemonSet
will still reschedule them, disregarding that the node is set as Unschedulable: true
.
You need to use --ignore-daemonsets
key when you drain kubernetes node:
--ignore-daemonsets=false: Ignore DaemonSet-managed pods.
So, in order to drain kubernetes node with DaemonSets
in cluster, you need to execute:
kubectl drain <node_name> --ignore-daemonsets
If you need to Remove DaemonSet pod from a node completely, you can specify a .spec.template.spec.nodeSelector
in DaemonSet
(the DaemonSet controller will create Pods on nodes which match that node selector) and set that label to all nodes except the one you need to completely drain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With