Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scale down or drain node with running single replicas

i am running single replicas of some applications with default maxsurge and maxunavilable 25%. using kind: deployment with rollingupdate replicas=1.

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.

is there any solution? what is the best practices?

i can run multiple replicas of some services but not for all services.

what is the best way to handle this situation?

using node affinity? can anyone please share an example if possible?

thanks in advance.

like image 550
chagan Avatar asked Oct 29 '25 05:10

chagan


1 Answers

I don't know exactly on GKE, but probably there is the same as in AWS.

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.

UPDATE

well, in fact, reading the docs, you have everything you need documented https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler#scheduling-and-disruption


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!