A node was tainted with kubectl taint nodes node01 dedicated=gpu:NoSchedule. A Pod must be allowed to schedule onto that node. Which toleration in the Pod spec matches the taint?
- A.
tolerations: - key: "dedicated" operator: "Equal" value: "gpu" effect: "NoExecute" - B.
tolerations: - key: "gpu" operator: "Equal" value: "dedicated" effect: "NoSchedule" - C.
tolerations: - key: "dedicated" operator: "Equal" value: "gpu" effect: "NoSchedule" - D.
tolerations: - key: "dedicated" operator: "Equal" value: "cpu" effect: "NoSchedule"
Show answer and explanation
Answer: C
A toleration matches a taint when the key, value (for Equal) and effect agree. Here that is dedicated=gpu with NoSchedule. Note that a toleration only permits scheduling; to force Pods onto the node you also need a nodeSelector or node affinity.
NoExecuteis a different effect.- Key and value are swapped in the second option.
- The value
cpudoes not equalgpu.