I am curious to know if someone can explain that what is the exact use of the "effect" declaration under the "tolerations" block of a pod. I see no logical reason to declare "effect" under "tolerations" for a pod like given below.
tolerations:
- key: "type"
operator: "Equal"
value: "gpu"
effect: "NoSchedule"
The purpose of toleration is to actually allow the pod to get scheduled on a node with a particular taint. In that case, what extra value we get by also putting the effect along with the key, operator and value in the above block? The declaration of the effect for a taint on a node completely makes sense. But, declaring toleration effect on the pod does not.
The other possible reason to put "effect" on a pod is to fully identify the corresponding taint. But that too, in my opinion, does not add any value, because a key of the taint is a unique identifier to take this decision of scheduling. As I tested, we cannot create more than one taints with the same key and value but a different scheduling effect. In that case, there is no use of declaring the "effect" on the pod level tolerations.
I also tested that providing a different value of the "effect" on the pod as different from the taint configuration on the node does not allow the pod to get scheduled on the node. However, the pod gets scheduled fine on the node with taint if I completely omit the "effect" from the "tolerations" block. That further confirms that there no logical need for the "effects" declaration on the pod's "tolerations". The below configuration on the pod just works fine.
tolerations:
- key: "type"
operator: "Equal"
value: "gpu"
Then why do they have "effect" in the "tolerations" block of the pod to begin with as there is no logical need of it?