<p>Say you have Node1 with taint <code>node1taint:NoSchedule</code> and label <code>node1specialkey=asdf</code>.
And Node2 with no taints.</p>
<p>Then you create PodA with affinity to Node1:</p>
<pre><code>    apiVersion: v1
    kind: Pod
    metadata:
      labels:
        name: PodA
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: node1specialKey
                operator: Exists
      containers:
      - image: busybox
        name: PodA
</code></pre>
<p>Which pod should the node schedule to? Will the affinity override the taint?</p>
<p>Thanks!</p>

Jake Stout
<p>The pod will not schedule anywhere, because it does not tolerate Node1's taint and it does not have an affinity for Node2.</p>
<p>Here is the missing pod taint that would, in combination with the affinity, successfully schedule PodA on Node1.</p>
<pre><code>tolerations:
- key: &quot;node1taint&quot;
  operator: &quot;Exists&quot;
  effect: &quot;NoSchedule&quot;
</code></pre>
<p>A taint is more powerful than an affinity. The pod needs the toleration, too, because affinity alone is not strong enough here in Kubernetes-land.</p>
