<p>So, let's say we assign <code>requiredDuringSchedulingIgnoredDuringExecution</code> type to node affinity and specify some node selector terms. Let's suppose a pod gets created according to the terms. But, what if a pod gets evicted and it is rescheduled.
Would that node affinity/node selector terms which is <code>requiredDuringSchedulingIgnoredDuringExecution</code> be taken into account when a new pod is created?</p>

Bissenbay Dauletbayev
<p><code>requiredDuringSchedulingIgnoredDuringExecution</code> type of <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity" rel="nofollow noreferrer">nodeAffinity</a>, unofficially calls "hard rule" guarantee you the pod will be created/RECREATED exactly based on rules you defined.</p>

<p>Example from <a href="https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/pod-with-node-affinity.yaml" rel="nofollow noreferrer">official kubernetes documentation</a>:</p>

<pre><code>spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: kubernetes.io/e2e-az-name
            operator: In
            values:
            - e2e-az1
            - e2e-az2
</code></pre>

<p>Above spec will always recreate pod ONLY in nodes with <code>label=kubernetes.io/e2e-az-name</code> that contains values <code>e2e-az1</code> or <code>e2e-az2</code></p>
