<p><br/>
I'd need to force moving a Pod from one Openshift Node to another, in order to do some performance tests. From the documentation it seems that setting the nodeSelector in the Deployment config is the way to go, but it doesn't work, according to my tests.
Here is what I have tried as a test:</p>

<p><strong>Create nginx Pod</strong></p>

<pre><code>oc new-app -f https://raw.githubusercontent.com/sclorg/nginx-ex/master/openshift/templates/nginx.json
</code></pre>

<p>The Pod is running on "ip-10-0-121-229.us-east-2.compute.internal" Node.
Now I patch the node selector, setting a target Node:</p>

<pre><code>oc patch dc nginx-example  -p '{"spec":{"template":{"spec":{"nodeSelector":{"kubernetes.io/hostname": "ip-10-0-169-74.us-east-2.compute.internal"}}}}}'
</code></pre>

<p>However the Pod is still running on the same Node. Even by killing the Pod it re-attaches there.
Any suggestion?
Thanjs</p>

<p>you can try this -</p>

<pre><code>kubectl get pod -o  wide
</code></pre>

<p>this will give you the VM on which your pod is running</p>

<p>then execute</p>

<pre><code>kubectl cordon {name_of_that_node_in_which_POD_is_running}
</code></pre>

<p>then delete the pods, those you want to get aligned to other node</p>

<p>then run</p>

<pre><code>kubectl uncordon {the_node_that_was_cordoned_above}
</code></pre>
