<p>My application consists of three different pods (Web, API and DB) and a PV and these pods will run in their own namespaces. These pods are deployed with a custom Helm Script.</p>
<p>So for example:</p>
<pre><code>Namespace1: Web1, API1, DB1 and PV1
Namespace2: Web2, API2, DB2 and PV2
...
NampesaceN: WebN, APIN, DBN and PVN
</code></pre>
<p>I have multiple workers which can mount up to 16 PV's at the same time.</p>
<p>Now I want to schedule all coherent pods (from one namespace) on the same worker. I don't care what worker they are schedule on, but they should all run on the same worker where the PV is mounted. Is there some kind of namespace specific pod-affinity?</p>

SO1992
<p>I think you just need to ensure that if a type of Pod (Web or API etc.) is already scheduled on a Node then same type of Pod should not be scheduled again. And for that you need &quot;Antiaffinity&quot; and in that as well &quot;Pod antiaffinity&quot; instead of &quot;Node antiaffinity&quot;.</p>
<p>Read <a href="https://stackoverflow.com/a/66406140/4691279">this answer</a> where I have explained in detail about it, along with official Kubernetes docs links to read more.</p>
<p>Have a look at <a href="https://stackoverflow.com/questions/52487333/how-to-assign-a-namespace-to-certain-nodes">this</a> as well.</p>
