How to scale nodes in an instance group down to zero using kops?

9/22/2019

I have deployed a cluster on AWS with kops comprising of multiple instance groups, with different machine types based on the task they perform. It is quite possible that at some point in time, there is no load on one or more instance groups, so is there any way to scale the nodes in those instance groups down to zero when there is no need for such instances to save cost?

-- Gullible Worm
amazon-web-services
kops
kubernetes

1 Answer

9/22/2019

Yes, there is. An "off the shelf" way of doing this would be the kops' projects cluster-autoscaler.

I've not used cluster-autoscaler myself specifically with kops (I've used kops before, but didn't have a need for this kind of autoscaling), however I have used cluster-autoscaler with other Kubernetes flavours such as Amazon managed Kubernetes (EKS).

That said, I have no doubt that cluster-autoscaler works great with kops. At the end of the day, its still an Amazon EC2 autoscale group that will be controlled by cluster-autoscaler based on your workloads.

Cluster-autoscaler provides lots of configuration options for you to tweak to scale specifically how you want it to scale.

-- Shogan
Source: StackOverflow