Kubernetes application running on master - DaemonSet Kubernetes application running on master - DaemonSet kubernetes kubernetes

Kubernetes application running on master - DaemonSet


From https://github.com/kubernetes/kubernetes/issues/29108, you can add a taint flag to your Master node kubelet, so the even the pods in the DaemonSet are not scheduled there

   --register-with-taints=node.alpha.kubernetes.io/ismaster=:NoSchedule

You will need to restart kubelet in your node


By Even if it seems that the master is tainted I see that the application is always on master., I'm not certain if the DaemonSet was created before or after the taint.

If you tainted first and then created the DaemonSet, the pod should be repelled by the tainted node without further config. Otherwise, the pod from the DaemonSet will not automatically terminate. To evict existing pods immediately, the NoExecute taint is needed.

From here:

Normally, if a taint with effect NoExecute is added to a node, then any pods that do not tolerate the taint will be evicted immediately, and any pods that do tolerate the taint will never be evicted. However, a toleration with NoExecute effect can specify an optional tolerationSeconds field that dictates how long the pod will stay bound to the node after the taint is added.