Giriş
Şeklen şöyle
Açıklaması şöyle. Taint, Pod Kovucu gibidir. Eğer Pod'un buna bağışıklığı yoksa o Node üzerinde çalışamaz.
In simple terms, Taints are like a Repellant spray. If we spray a taint on any node it will not allow any Pod to get scheduled on it.
Unless the Pod has the Toleration for that Taint being sprayed on itself.
3 tane taint çeşidi var. Açıklaması şöyle
NoSchedule : It means Pod without the toleration of the taint can’t be scheduled on the tainted node.PreferNoSchedule : It means Pod without the toleration of the taint should not be scheduled on the tainted node. But if there is no other choice then it can be scheduled on the tainted node.NoExecute : It means if a node is tainted while some Pods are running on it. The running pods which does not have toleration for that taint will get evicted from the node.
Örnek
Şöyle yaparız
$ kubectl taint node master foo=bar:NoSchedule
Örnek
Şöyle yaparız
kubectl taint nodes production-node app=red:NoSchedule
Şöyle yaparız. Pod'a kırmızı node için bağışıklık verdik. Eğer Pod, 2 tane node'a bağışık ise her hangi birisinde çalışabilir.
apiVersion: v1 kind: Pod metadata: name: production-pod spec: containers: - name: nginx-container image: nginx tolerations: - key: "app" operator: "Equal" value: "red" effect: "NoSchedule"
Hiç yorum yok:
Yorum Gönder