<p>i am running single replicas of some applications with default <strong>maxsurge</strong> and <strong>maxunavilable</strong>  25%. using <strong>kind: deployment</strong> with <strong>rollingupdate</strong> replicas=1.</p>
<p>now if GKE scaling down the node it first deleting pod and after that creating a new pod on another node which creating some downtime for the application.</p>
<p>is there any solution? what is the best practices?</p>
<p>i can run multiple replicas of some services but not for all services.</p>
<p>what is the best way to handle this situation?</p>
<p>using node affinity? can anyone please share an example if possible?</p>
<p>thanks in advance.</p>

<p>I don't know exactly on GKE, but probably there is the same as in AWS.</p>
<p>You can configure the service to prevent scale in actions on certain nodes, so, pair that with nodeAffinity, and you can have a deployment running always on a particular node which is configured to not be removed during scaling events.</p>
<p>UPDATE</p>
<p>well, in fact, reading the docs, you have everything you need documented <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler#scheduling-and-disruption" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler#scheduling-and-disruption</a></p>
