jenkins-x/terraform-aws-eks-jx

Changes to desired node count do not result in changes to autoscaling group

thecooldrop opened this issue · 2 comments

Summary

When desired_node_count input variable is changed this does not lead to change in the backing autoscaling group, thus making it impossible to increase the desired number of nodes deployed into cluster via GitOps.

Steps to reproduce the behavior

  1. Generate a clone of this repository for yourself
  2. In clone repository change the main.tf looks like:
module "eks-jx" {
  source             = "github.com/jenkins-x/terraform-aws-eks-jx?ref=v1.15.12"
  cluster_name       = var.cluster_name
  cluster_version    = var.cluster_version
  region             = var.region 
  vault_user         = var.vault_user
  is_jx2             = false
  jx_git_url         = var.jx_git_url
  jx_bot_username    = var.jx_bot_username
  jx_bot_token       = var.jx_bot_token
  force_destroy      = var.force_destroy
  desired_node_count = 2
  min_node_count     = 1
  max_node_count     = 3
  node_machine_type  = "t3.medium"
}
  1. Clone the repository localy

  2. Execute terraform init and terraform apply and approve

  3. Change the main.tf so that desired_node_count=3

  4. Execute terraform apply

  5. Observe that no changes are made to autoscaling group.

Expected behavior

Changes to desired_node_count are propagated the autoscaling group used by the EKS cluster

Actual behavior

Changes to desired_node_count do not result in changes to the autoscaling group.

Terraform version

Terraform v0.13.2

  • provider registry.terraform.io/hashicorp/aws v3.37.0
  • provider registry.terraform.io/hashicorp/helm v2.1.1
  • provider registry.terraform.io/hashicorp/kubernetes v2.1.0
  • provider registry.terraform.io/hashicorp/local v2.1.0
  • provider registry.terraform.io/hashicorp/null v3.1.0
  • provider registry.terraform.io/hashicorp/random v3.1.0
  • provider registry.terraform.io/hashicorp/template v2.2.0

Module version

1.15.2

Operating system

Linux Ubuntu

@thecooldrop this is the expected behavior, that setting is ignored by terraform. See: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/autoscaling.md#notes. Internally the eks jx module uses that module. I wonder if we should just remove the desired count. Personally, I let cluster autoscaler to set the desired count. Also this: terraform-aws-modules/terraform-aws-eks#510 (comment)

closing this, as this is a desired behavior.