kubecost / cluster-turndown

Automated turndown of Kubernetes clusters on specific schedules.
Apache License 2.0
259 stars 23 forks source link

Add option to disable/remove autoscaling on node pools during turndown #49

Open michaelmdresser opened 2 years ago

michaelmdresser commented 2 years ago

If a cloud provider (GKE, EKS) autoscaler is present on node pools, turndown currently evicts pods and then relies on the autoscaler to reduce the node count. However, sometimes autoscaler parameters may be set with a too-high minimum node count, resulting in smaller than expected savings during turndown. This is a request to add an option to turndownschedules.kubecost.com to force turndown to behave like it does if an autoscaler isn't present.

This could be achieved by (1) modifying the minimum node count or (2) removing the autoscaling node pool entirely during turndown and recreating it on turnup.

michaelmdresser commented 2 years ago

See current behavior in turndown for reference, "Resize all the non-autoscaling node pools to 0":

https://github.com/kubecost/cluster-turndown/blob/28ab31c60b40582523c53c5407562f5b0123a364/pkg/turndown/turndown.go#L224-L245

Ayush9026 commented 1 year ago

Hi @michaelmdresser i want to work on this issue.

michaelmdresser commented 1 year ago

Hi @Ayush9026, you're welcome to investigate this behavior and open a pull request! I'll just warn you that we'll ask for thorough testing before we're willing to approve and merge. I think this issue's description is fairly thorough and provides at least a lead in to the code. Thanks for your interest.