<p>I have two namespace qa and dev. qa and dev pods can run in same node. When I delete the dev release/pods, k8's just reschedules some of the qa pods in different nodes.
Similar things happen when I enable autoscaling that is when scaling down, k8's will reschedule other services pods in the same/different namespace.
1) How do I prevent k8's rescheduling 
2) How do I handle this in case of autoscaling?</p>

Nithin Venugopal
<p>If you want to schedule your pod on specific node then you can use <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector" rel="nofollow noreferrer">node selector</a>.</p>

<pre><code># To set level on node run
$ kubectl label nodes &lt;node-name&gt; &lt;label-key&gt;=&lt;label-value&gt;

# On pod spec set

  nodeSelector:
    &lt;label-key&gt;=&lt;label-value&gt;

</code></pre>

<p>If you want to prevent re-schedule then use <a href="https://kubernetes.io/docs/tasks/run-application/configure-pdb/" rel="nofollow noreferrer">Pod disruption budget</a> and set <code>maxUnavailable: 0</code>, it will never remove your pods</p>

<pre><code>apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
  name: pdb
spec:
  maxUnavailable: 0
  selector:
    matchLabels:
      app: demoapp
</code></pre>
