Lakshmi Narayanan
Lakshmi Narayanan

Reputation: 5342

Multiple tolerations in daemonset - Kubernetes

Is it possible to define multiple label and taints for a daemonset (i.e.) so that it can access / deploy in multiple nodes?

 spec:
   tolerations:
     - key: "sample-node","example-node"
       operator: "Equal"
       effect: "NoSchedule"
       value: "true"

Or in a different format? Thanks in advance!

Upvotes: 0

Views: 343

Answers (1)

Nataraj Medayhal
Nataraj Medayhal

Reputation: 1221

Syntax mentioned in your query will fail with below error

is invalid: spec.tolerations[0].key: Invalid value: "sample-node,example-node"

The tolerations can be added as below:

tolerations:
- key: "sample-node"
  operator: "Equal"
  effect: "NoSchedule"
  value: "true"
- key: "example-node"
  operator: "Equal"
  effect: "NoSchedule"
  value: "true"

The above can be achieved by tainting multiple nodes with same label instead of two different labels and adding it twice. An single node can have multiple tolerations and more details are explained in k8s documentation.

Upvotes: 2

Related Questions