Kubernetes: Deploy daemon set to all nodes except for master node

4/3/2017

I have kubernetes running on version 1.5 with two nodes and one master nodes. I would like to deploy fluentd as a daemon set onto all nodes, but the master node (the master node spams warning messages as it can't find logs). How can I avoid deploying to the master node?

-- Ben McAlindin
kubernetes

3 Answers

11/2/2018

So to make a pod not schedule on a master node you need to add the following

nodeSelector:
    kubernetes.io/role: node

This will make the pod schedule on only nodes. The above example shows the default label for node in kops provisioned cluster. Please very the key value if you have have provisioned the cluster from a different provider

-- Alok Kumar Singh
Source: StackOverflow

4/3/2017

You're looking for the Taints and Tolerations features. Using these you can define that given node in "tainted" in particular way preventing pods scheduling on this node unless they have a toleration matching that taint.

-- Radek 'Goblin' Pieczonka
Source: StackOverflow

4/3/2017

You can use a label for your slave nodes and use that label in a selector for the daemon set, which will only deploy on the nodes that have that label.

Inversely, you can define a negative selector to assign the daemon set to pods that don't have a label. In your case, the pod that doesn't have the master's label.

-- MrE
Source: StackOverflow