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

unable to change asg_desired_capacity value #510

Closed
2 of 4 tasks
aliartiza75 opened this issue Sep 16, 2019 · 10 comments
Closed
2 of 4 tasks

unable to change asg_desired_capacity value #510

aliartiza75 opened this issue Sep 16, 2019 · 10 comments

Comments

@aliartiza75
Copy link
Contributor

aliartiza75 commented Sep 16, 2019

I have issues

Hello everyone,

I deployed an eks cluster using this module but the issue is that I was not able to change the value of desired capacity(it default value is 1 i think so).

So what I did was that I increased the asg_min_size value from 1 to 2 but the issue it generated was that it increased the desired_capacity value from 1 to 2. Although I changed the value of asg_min_size from 2 to 1 still its value remained the same.

Although I know it is asg_desired_capacity has been added in the ignore loopback state, to make sure its value is ignored.

I just want to know is there a workaround for it. I think the point of ignoring its value must be mentioned in the document so that everyone knows about it easily.

I'm submitting a...

NONE

  • bug report
  • feature request
  • support request
  • kudos, thank you, warm fuzzy

What is the current behaviour?

I am unable to change the asg_desired_capacity value.

If this is a bug, how to reproduce? Please include a code sample if relevant.

Not sure, i think it is a bug that increasing the value of asg_min_size changes the value of asg_max_capacity, correct me if I am wrong.

What's the expected behaviour?

I should be able to change the asg_desired_capacity value.

Are you able to fix this problem and submit a PR? Link here if you have already.

I can update the document

Environment details

  • Affected module version: v5.0.1
  • OS: ubuntu:18.04
  • Terraform version: v0.12.7

Any other relevant info

@aliartiza75
Copy link
Contributor Author

aliartiza75 commented Sep 16, 2019

hi @max-rocket-internet,

You made a point in this link, kindly clarify what do you mean by it (like what cluster autoscaler does here and what are its trigger event).

thank you.

@max-rocket-internet
Copy link
Contributor

The cluster-autoscaler controls all scaling up and down of the cluster. It add nodes when there's Pending pods and drains and removes nodes when they are not required. It is changing the desired capacity of the ASG.

It is the normal way of scaling a cluster as it takes care of draining and moving pods in this process. It is aware of complexities like instance sizes, pod disruption budgets and more. It's this awareness that makes it really the only way to safely scale down a cluster automatically. And that's why asg_desired_capacity is ignored in Terraform.

You can manually and safely scale up the cluster yourself. But scaling down is more complicated 🙂

@aliartiza75
Copy link
Contributor Author

@max-rocket-internet thank you for clarification. It would be good if these details are added in the documentation if guys from your side are busy do let me know I will create a PR for it.

@aliartiza75
Copy link
Contributor Author

@max-rocket-internet although 1 issue still exists which is that if a person changes the value of the asg_min_size from 1 to 2. It changes the value of the desired_capacity that I confirmed from the aws console. But the real problem comes later on in which if the value of asg_min_size is changed from 2 to 1 it doesn't change the value of desired_capacity its value remain 2.

I think it is a bug that should be resolved.

@max-rocket-internet
Copy link
Contributor

let me know I will create a PR for it.

Please do 😃 Maybe add something to https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/autoscaling.md

I think it is a bug that should be resolved.

Maybe but it's very edge case. I don't know how we could resolve this while still ignoring changes to desired_capacity in Terraform?

For your reference, I just set these to min 1, max 100 and then never change it as the cluster-autoscaler does everything else. I think most people are doing something like this, i.e. set and forget.

@aliartiza75
Copy link
Contributor Author

yes, you are right but these things need to be mentioned in the documentation because it will cause problems for people who update the asg_min_size value by mistake and they will don't have a way to change the value of desired_capaity using terraform although they can change the value using aws console but i dont know that change take affect in the terraform.tfstate or not.

My Suggestions:

  • Add a table of variables in the main README.md because in main README.md no documentation exists. is it fine from you side?
  • I will also update the auto_scalaing doc as you suggested

@max-rocket-internet
Copy link
Contributor

  1. There's already a table of the main module variables in README. Worker group variables are documented in here so feel free to add a note there.
  2. Cool.

@aliartiza75
Copy link
Contributor Author

@max-rocket-internet i have created a PR for it kindly have a look at it

@aliartiza75
Copy link
Contributor Author

the issue has been resolved in #517, closing it.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants