<p>The question says everything really - is it possible to schedule a Pod based on the namespace it is assigned to?</p>

dippynark
<p>It's not built in as far as I know, but there's a couple of ways you could do it:</p>

<p>Create a mutating webhook that modifies the pod affinity rules if the <code>namespace == something</code>. Using something like this: <a href="https://github.com/slok/kubewebhook" rel="nofollow noreferrer">https://github.com/slok/kubewebhook</a></p>

<p>Using the PodNodeSelector admission controller: <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/</a></p>

<p>Using the PodPreset admission controller:
<a href="https://kubernetes.io/docs/tasks/inject-data-application/podpreset/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/inject-data-application/podpreset/</a></p>
