<p>Both pods are scheduled on same node with podaffinity, each pod on a different namespace. Once I try to deploy both of them on same namespace, podaffinity fails, and one one pod is running while the other one remains pending with podaffinity error.
Thanks!</p>

Tzvika Avni
<p>From your comment, I suspect that you have a label collision that is only apparent when you try to run the pods in the same namespace.  </p>

<p>Take a look at your <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector" rel="nofollow noreferrer"><code>nodeSelectorTerms</code></a> and <code>matchExpressions</code> </p>

<p><a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity" rel="nofollow noreferrer">From the docs</a>:</p>

<blockquote>
  <p>If you specify multiple matchExpressions associated with nodeSelectorTerms, then the pod can be scheduled onto a node only if all matchExpressions can be satisfied.</p>
</blockquote>
