<p>I have a kubernetes cluster created and deployed with app.</p>

<p>First if I deployed with firstapp.yaml which created a pod and a service to expose the pod externally .</p>

<p>If i have two nodes in the cluster and then make another deployment with secondapp.yaml .</p>

<p>I noticed ,that the second deployment went to different node. Although this is desired behaviour for logical seperation .</p>

<p>Is it something that's provided by kubernetes. How will it manage deployments made using different files? will they always go on seperate nodes (if there are nodes provisioned) ? </p>

<p>If not, what is the practice to be followed if i want logical seperation between two nodes which i want to behave as two environments  , let's say dev and qa environment. </p>

Mandar Jogalekar
<p>No, they will not necessary go to different nodes. Scheduler determines where to put the  pod based on different criteria. </p>

<p>As for your last question - it makes no sense. You can use namespaces\network policies to separate environments, you shouldn't care on which node(s) your pods are. Thats the whole point of having a cluster.</p>

<p>You can use placement constraints to achieve what you ask for, but it makes no sense at all.</p>

<p><a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/configuration/assign-pod-node/</a></p>
