Terraform-aws-eks: EKS ASG Worker Desired Capacity Change being ignored

Created on 12 Oct 2018  路  6Comments  路  Source: terraform-aws-modules/terraform-aws-eks

I have issues

For an existing Cluster that has been deployed using version 1.6 I would like to modify the worker counts.

I'm submitting a...

  • [x] support request

What is the current behavior?

When editing asg_desired_capacity it does not affect terraform plan and the ASG is not modified.

module "eks_dev" {
  source  = "terraform-aws-modules/eks/aws"
  version = "1.6.0"
...
  workers_group_defaults = {
   key_name = "exploration-zone"
   asg_desired_capacity          = "4"                             # Desired worker capacity in the autoscaling group.
   asg_max_size                  = "5"                             # Maximum worker capacity in the autoscaling group.
   asg_min_size                  = "2"                             # Minimum worker capacity in the autoscaling group.
   instance_type = "m4.large" # Size of the workers instances.
...

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

  • Deploy an EKS Cluster with custom worke_group_defaults
  • After succesfull deployment, try to modify the asg_desired_capacity

What's the expected behavior?

  • The asg parameter change should be reflected in terraform plan and applicable.

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

sry, no.

Environment details

AWS region us-east-1

  • Affected module version:
  • OS: Terraform executed in both ubuntu 16.04 as well as hashicorp/terraform:light
  • Terraform version: 0.11.8

Any other relevant info

Also testes with 1.7 release. No impact.
.terraform was also removed and terraform init performed.

Most helpful comment

This is because desired_capacity is ignored due not wanting it to interfere with the cluster-autoscaler: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/workers.tf#L22

So currently you would need to set this manually outside of Terraform.

Feel free to make a PR to make this setting optional 馃檪

All 6 comments

This is because desired_capacity is ignored due not wanting it to interfere with the cluster-autoscaler: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/workers.tf#L22

So currently you would need to set this manually outside of Terraform.

Feel free to make a PR to make this setting optional 馃檪

Thank you for the quick and helpful response. I think the auto-scaler aspect is a fair point. I am fine if this is working as intended for the time being and will make use of the autoscaler once the environment has been bootstrapped.

OK cool, thanks for the update.

Would it make sense to exclude desired_capacity from the ignore lifecycle hook unless autoscaling_enabled is true for a given worker group?

Sure

lifecycle block does not support interpolations https://github.com/hashicorp/terraform/issues/3116

Was this page helpful?
0 / 5 - 0 ratings