machine-controller icon indicating copy to clipboard operation
machine-controller copied to clipboard

Scaling from/to 0 capabilities

Open dcardellino opened this issue 2 years ago • 3 comments

Cluster Autoscaler added support for "Scaling from/to 0". Talking with @xmudrii I open this issue to verify if this is feasible.

https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/clusterapi#scale-from-zero-support

dcardellino avatar Apr 11 '23 10:04 dcardellino

This would be a great feature to reduce the cost of cloud development environments, by scaling down to 0 outside of business hours.

acbox avatar May 10 '23 09:05 acbox

As far as I understand it, isn't it just that we need to add Capacity in the machine status:

        // Capacity defines the resource capacity for this machine.
	// This value is used for autoscaling from zero operations as defined in:
	// https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md
	// +optional
	Capacity corev1.ResourceList `json:"capacity,omitempty"`

And the rest can be taken care of by the cluster autoscaler once certain annotations are provided.

Skarlso avatar Mar 01 '24 13:03 Skarlso

Here is an example on how to apply and use it with CAPA which is using CAPI: https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/3684

Skarlso avatar Mar 01 '24 14:03 Skarlso