Kubernetes autoscaler min of 0?

Posted October 26, 2021 149 views

I have workloads that are intermittent and heterogeneous. Sometimes a k8s job will be scheduled to run on a pod that needs 400m memory, another time it’ll be a job that requires 24g of memory. What I want to have happen is for the autoscaler to automatically spin up a droplet (node) that’ll be able to run that pod.

Most of the time there’ll be no jobs, so it doesn’t make sense to have nodes running at those times.

It’s fine if takes a minute or two for a node to come up for the job to run.

It’s fine if the node stays up for some minimum amount of time before it shuts off (e.g. an hour).

Is there anyway to have the autoscaler scale a node group to 0?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @offbynull!

Unfortunately, it is not currently supported to set the autoscaling of a nodepool to 0.

You can see this mentioned in our product docs here How to Enable the Cluster Autoscaler for a DigitalOcean Kubernetes Cluster

Minimum Nodes: Determines the smallest size the cluster will be allowed to “scale down” to; must be no less than 1 and no greater than Maximum Nodes.

That being said, there could be a way to automate this yourself using the DO API! See the API docs for controlling node count here:

Hope this was helpful!