machine-controller
machine-controller copied to clipboard
Scaling from/to 0 capabilities
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
This would be a great feature to reduce the cost of cloud development environments, by scaling down to 0 outside of business hours.
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.
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