cloudposse / terraform-aws-eks-node-group

Terraform module to provision a fully managed AWS EKS Node Group
https://cloudposse.com/accelerate
Apache License 2.0
90 stars 128 forks source link

Support attribute-based instance type selection #120

Closed nitrocode closed 1 year ago

nitrocode commented 2 years ago

what

why

references

test

module "eks_node_group" {
  # Use source to point to this branch
  # NOTE: this branch is experimental and will be removed upon merge
  source = "git::https://github.com/cloudposse/terraform-aws-eks-node-group?ref=instance_requirements"

  # should select t3.medium (untested)
  instance_requirements = {
    memory_mib = {
      min = 4
      max = 4
    }
    memory_gib_per_vcpu = {
      min = 0.5
      max = 0.5
    }
    vcpu_count = {
      min = 2
      max = 2
    }
    cpu_manufacturers    = ["amazon-web-services"]
    instance_generations = ["current"]
  }
  # ...
}
nitrocode commented 2 years ago

/test all

jtdoepke commented 2 years ago

I think the provider version needs to be bumped to>= 4.14.0 because that's when instance_requirements was added to launch templates.

Also, maybe instance_requirements should be part of the create_before_destroy pet name?

nitrocode commented 2 years ago

/test all

nitrocode commented 2 years ago

Also, maybe instance_requirements should be part of the create_before_destroy pet name?

I don't think the instance_requirements should be part of that because then this will auto create the node group which would destroy the existing one. The instance_requirements will only affect the launch template and then we can approach rotating the node group safely outside of terraform.

nitrocode commented 2 years ago

/test test/bats

nitrocode commented 2 years ago

/test test/bats

nitrocode commented 2 years ago

/test test/bats

nitrocode commented 2 years ago

/test all

mergify[bot] commented 2 years ago

This pull request is now in conflict. Could you fix it @nitrocode? 🙏

nitrocode commented 2 years ago

@jtdoepke see the above test in the PR description. Please test this out if you have time. :)

awoimbee commented 1 year ago

This PR won't work, EKS managed node groups are not compatible with instance_requirements. What will happen here is that AWS/EKS will spawn t3.medium nodes only