Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] EKSCTL can create scheduled scaling rules #5524

Open
kderck opened this issue Jul 20, 2022 · 9 comments
Open

[Feature] EKSCTL can create scheduled scaling rules #5524

kderck opened this issue Jul 20, 2022 · 9 comments
Labels
kind/feature New feature or request priority/important-longterm Important over the long term, but may not be currently staffed and/or may require multiple releases

Comments

@kderck
Copy link

kderck commented Jul 20, 2022

What feature/behavior/change do you want?

I would like to be able to control Auto Scaling Groups created by EKS with eksctl. We use a Scheduled Scaling a part of ASG to scale down the clusters after work hours to reduce cost It would be nice if we could include the scaling rules inside of the yaml.

Why do you want this feature?

It would be able to track these rules as infrastructure as code.

@kderck kderck added the kind/feature New feature or request label Jul 20, 2022
@github-actions
Copy link
Contributor

Hello kderck 👋 Thank you for opening an issue in eksctl project. The team will review the issue and aim to respond within 1-3 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website

@Himangini Himangini added the priority/important-longterm Important over the long term, but may not be currently staffed and/or may require multiple releases label Jul 25, 2022
@tnh
Copy link

tnh commented Aug 25, 2022

Plus 1 on this - having the ability to apply scheduled scaling rules within eksctl can allow us to program scaledown events for dev clusters to save money.

@lfpalacios
Copy link

Hi all, any updates on this? Applying it manually after cluster creation is not an effective manner. It would save us a lot of money and overhead

@bcoromina
Copy link

bcoromina commented Jan 25, 2023

Hi, why don't you use cluster autoscaler https://github.com/kubernetes/autoscaler? You can still set a maximum in the ASG group.
Does aws provides cheaper EC2 instances using a Scheduled Scaling?

@kderck
Copy link
Author

kderck commented Jan 25, 2023

Hi @bcoromina the Cluster Autoscaler communicates with the EC2 Auto Scaling Group to scale up, or to scale down. The Cluster Autoscaler does this by making requests to the Auto Scaling Group API. There is no option in the Cluster Autoscaler to scale down to 0 at specific times. The reason we want to scale down to this is so we can safe cost by turning nodes off overnight and turning them on in the morning to safe cost.

@bcoromina
Copy link

If you want to force instance to 0 at specific time and ignore the possible activity that makes sense.

@hassaanakram
Copy link
Contributor

Hey @Himangini
This seems like a good new addition to eksctl. I'd like to take a stab at it.

@Himangini
Copy link
Collaborator

@hassaanakram Ty for showing interest in contributing to eksctl 🎉 . Please feel free to open a PR, we're happy to review it ✨ Here's the contributing guide to get you started 👍🏻

@hassaanakram
Copy link
Contributor

hassaanakram commented Jun 22, 2023

Hi @Himangini

I have some questions, but before that some context:

Scheduled Scaling action is a property of the Auto scaling group and therefore the ASG must exist before Scheduled Scaling rules may be applied. Therefore, the Scheduled Scaling resource cannot be added to the NodeGroup CloudFormation template and must come after the NodeGroup ASG creation.

I can see two ways to do that (after node group creation)

  1. Create a new stack for the Scheduled Scaling Config as a sequential task after NG creation (right now, I have implemented this)
  2. Use https://github.com/weaveworks/eksctl/blob/0a5bae44cda1a58bb3410f9949a81090c6d8eb12/pkg/awsapi/autoscaling.go#L476 as a sequential task

I am not really sure which is the idiomatic way to move forward here. Your input will be appreciated. Thanks!

Draft PR for ref: #6732

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request priority/important-longterm Important over the long term, but may not be currently staffed and/or may require multiple releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants