Pod with toleration is scheduled to node without taint

3/29/2019

I have pod with this settings:

Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/memory-pressure:NoSchedule
                 node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 60s
                 role_va

The pod is scheduled into this node:

Labels:             balancer=true
                    beta.kubernetes.io/arch=amd64
                    beta.kubernetes.io/os=linux
                    cpu_avx2=true
                    cpu_avx512f=true
                    kubernetes.io/hostname=p20b-sr3-r5-k8s-node4
                    master=true
                    worker=true
Annotations:        node.alpha.kubernetes.io/ttl=0
                    volumes.kubernetes.io/controller-managed-attach-detach=true
Taints:             <none>

Please, help me understand why. If I'm not mistaken the pod with toleration "role_va" must be scheduled only to node that has this taint. In my case the node doesn't have this taint but the pod is scheduled into this node whatever. Why?

-- malcolm
kubernetes

1 Answer

5/22/2019

Answer for your question is included in Taints and Tolerations definition in Kubernetes documentation: Taints and Tolerations

The way Kubernetes processes multiple taints and tolerations is like a filter: start with all of a node’s taints, then ignore the ones for which the pod has a matching toleration; the remaining un-ignored taints have the indicated effects on the pod

That means if node doesn't have taints it will accept every pods, no matter what tolerations will be defined in them.

-- MaggieO
Source: StackOverflow