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

feat: Enable ebs_optimized setting for node_groups #1459

Conversation

alzabo
Copy link
Contributor

@alzabo alzabo commented Jun 23, 2021

PR o'clock

Description

Add logic to selectively enable ebs_optimized in node group LT

  • Setting ebs_optimized on an individual node_group to a boolean value
    will set the launch template to true or false
  • Likewise, setting ebs_optimized on node_groups_defaults to a boolean
    will set it in the LT
  • ebs_optimized in the node_group is null, instance_types are checked
    against var.workers_group_defaults. If any instance type does not
    support EBS optimization, the property will be set to false in the LT,
    otherwise it will be set to true

Checklist

Fixes #1489

Add logic to selectively enable ebs_optimized in node group LT

- Setting ebs_optimized on an individual node_group to a boolean value
  will set the launch template to true or false
- Likewise, setting ebs_optimized on node_groups_defaults to a boolean
  will set it in the LT
- ebs_optimized in the node_group is null, instance_types are checked
  against var.workers_group_defaults. If any instance type does not
  support EBS optimization, the property will be set to false in the LT,
  otherwise it will be set to true
@nodesocket
Copy link

nodesocket commented Jul 13, 2021

@alzabo Is this supported? I could not find a way to enable EBS optimized for my node group.

node_groups = {
    general = {
      desired_capacity       = 3
      max_capacity           = 3
      min_capacity           = 3
      instance_types         = ["m5.xlarge"]
      disk_size              = 250
      public_ip              = true
      capacity_type          = "ON_DEMAND"
      ami_release_version    = "1.20.4-20210628"
      create_launch_template = true
      enable_monitoring      = true

      k8s_labels = {
        Env = var.environment
      }

      tags = {
        Env          = var.environment
        AutoSnapshot = "true"
      }
    }
  }

@nodesocket
Copy link

@alzabo I manually edited the launch template in AWS console and flipped on EBS optimized, however now Terraform is wanting to undo that change every time I apply. Can we get this merged in? I need to have EBS optimized instances in my node group. Thanks.

  # module.stage.module.node_groups.aws_eks_node_group.workers["general"] will be updated in-place
  ~ resource "aws_eks_node_group" "workers" {
        id                     = "acme-stage:acme-stage-general20210713190011077200000002"
        tags                   = {
            "AutoSnapshot" = "true"
            "Env"          = "stage"
        }
        # (16 unchanged attributes hidden)

      ~ launch_template {
            id      = "lt-0b296712f77a5062f"
            name    = "acme-stage-general20210713172835067400000004"
          ~ version = "3" -> "$Latest"
        }

        # (1 unchanged block hidden)
    }

  # module.stage.module.node_groups.aws_launch_template.workers["general"] will be updated in-place
  ~ resource "aws_launch_template" "workers" {
      ~ default_version         = 3 -> (known after apply)
      + description             = "EKS Managed Node Group custom LT for acme-stage-general"
      - ebs_optimized           = "true" -> null
        id                      = "lt-0b296712f77a5062f"
      ~ latest_version          = 3 -> (known after apply)
        name                    = "acme-stage-general20210713172835067400000004"
        tags                    = {
            "AutoSnapshot" = "true"
            "Env"          = "stage"
        }
        # (8 unchanged attributes hidden)

      ~ block_device_mappings {
            # (1 unchanged attribute hidden)

          ~ ebs {
              - encrypted             = "true" -> null
                # (5 unchanged attributes hidden)
            }
        }



        # (4 unchanged blocks hidden)
    }

@alzabo
Copy link
Contributor Author

alzabo commented Jul 20, 2021

@nodesocket yeah. I think you'd have to supply your own launch template with the current released versions of this module without this patch or similar.

@nodesocket
Copy link

@alzabo is there anyway to get EBS support natively pushed and deployed? I'd be willing to sponsor this work. Need to deploy a handful more of clusters, and the one I already deployed is complaining because I manually modified the launch template in AWS web console. Terraform wants to undo those changes when I plan and apply.

@nodesocket
Copy link

nodesocket commented Jul 29, 2021

Willing to sweeten the pot. How's a bounty of $50 @alzabo @antonbabenko to get this merged and deployed?

@LukaszRacon
Copy link

@nodesocket
Copy link

@LukaszRacon I'd really prefer not to do that just to flip EBS optimized on. Everything else is fine as is.

@nodesocket
Copy link

@antonbabenko @barryib or @max-rocket-internet any takers on the bounty I am offering to get this tested, merged, and deployed?

@antonbabenko
Copy link
Member

@nodesocket I will be able to do it if @barryib can't do it by Monday 23rd of August. I short-list this issue on my todo list.

@nodesocket
Copy link

@antonbabenko fantastic. Where should I send the $50? Is this right? https://www.paypal.me/antonbabenko

@antonbabenko antonbabenko merged commit 3b12298 into terraform-aws-modules:master Aug 25, 2021
@antonbabenko
Copy link
Member

Here we go! 🎉

v17.2.0 has been just released.

@nodesocket
Copy link

@antonbabenko thanks so much for getting this merged in and deployed. Can I send the $50 to PayPal https://www.paypal.me/antonbabenko?

@antonbabenko
Copy link
Member

@nodesocket Sure, you can use any of the ways listed here. Thank you!

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, 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 13, 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

Successfully merging this pull request may close these issues.

Enable ebs optimized for node group
4 participants