<p>I am running single-node GKE cluster with configuration of 4vCPU &amp; 16 GB Memory. Now i am planning to add one more node pool 1 vCPU and 3.75 GB of RAM.</p>

<p>Right now on a single node, I am running load like Elasticsearch, Redis, Rabbitmq with stateful sets having disk attach.</p>

<p>I have not added any affinity &amp; anti-affinity in Pod configuration. If i will be adding new node may possible some of pods schedule to new node. While i am only planning to run stateless pods on new pods. </p>

<p>Is there any way i can stop scheduling ES, Redis or RabbitMQ on new node without adding affinity or anything don't want to restart(Touch) pod or service. ES, Redis, RabbitMQ should have to stuck on the old node only.</p>

Harsh Manvar
<p><a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector" rel="nofollow noreferrer"><code>nodeSelector</code></a> and <code>kubectl patch</code> could be the solution.</p>

<p><strong>Using a new label</strong> </p>

<p>You must fist label the node running the statefull workloads with for instance the following label <code>statefullnode=true</code> using the following command:</p>

<p><code>kubectl label nodes &lt;node-name&gt; statefullnode=true</code></p>

<p>Then you must patch each deployments running on this node using <code>kubectl patch</code>:</p>

<pre><code>kubectl patch deployments nginx-deployment -p '{"spec": {"template": {"spec": {"nodeSelector": {"statefullnode": "true"}}}}}'
</code></pre>

<hr>

<p><strong>Using the node name</strong></p>

<p>If you don't want to label your node you can simply use the node name as label for the nodeSelector.
For instance if your node's name is <strong>my-gke-node</strong> then run:</p>

<pre><code>kubectl patch deployments nginx-deployment -p '{"spec": {"template": {"spec": {"nodeSelector": {"kubernetes.io/hostname": "my-gke-node"}}}}}'
</code></pre>

<hr>

<p>Run <code>kubectl get nodes</code> to get the names of your cluster’s nodes.</p>
