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

Add support for userdata in managed NodeGroups #1192

Closed
1 of 4 tasks
psoares opened this issue Jan 21, 2021 · 4 comments
Closed
1 of 4 tasks

Add support for userdata in managed NodeGroups #1192

psoares opened this issue Jan 21, 2021 · 4 comments

Comments

@psoares
Copy link

psoares commented Jan 21, 2021

I have issues

Currently, using node_groups, I see no way of injecting custom userdata by default without resorting to a custom launch template. The feature seems available in worker_groups_defaults though, through several hooks: pre_userdata, post_userdata, userdata_template_file...

I'm submitting a...

  • bug report
  • feature request
  • support request - read the FAQ first!
  • kudos, thank you, warm fuzzy

What is the current behavior?

There is no attribute in node_groups_default for setting default userdata.

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

module "eks" {
  source                                             = "terraform-aws-modules/eks/aws"
  version                                            = "13.2.1"
  // [...]
  node_groups_defaults = {
    additional_tags = local.owner_tags
    // no parameter to set userdata (pre, post or completely new)
  }
  workers_group_defaults = {
    post_userdata = templatefile("${path.module}/post_userdata.sh.tmpl", {})
  }
  node_groups = {
    example = {
      name             = "example"
      desired_capacity = 1
      max_capacity     = 5
      min_capacity     = 1

      instance_type = "t3a.xlarge"
      
    }
  }
}```


## What's the expected behavior?
node_groups_defaults should have a placeholder for using custom userdata, just like worker_group_defaults.

## Are you able to fix this problem and submit a PR? Link here if you have already.
I may be. I have to look into it.
## Environment details

* Affected module version: 13.2.1
* OS: Windows 10
* Terraform version: 0.14.4

## Any other relevant info
@psoares
Copy link
Author

psoares commented Jan 21, 2021

Seems like it isn't and won't be supported by the aws. See hashicorp/terraform-provider-aws#13887

See also the corresponding request on the aws terraform module: aws/containers-roadmap#596.
They say they won't implement since this can be solved with launch templates (which is what I wanted to avoid in the first place).

@michelesr
Copy link

Other managed services like RDS have things like parameter groups to allow tweaking the configuration, so why can't we have a similar feature in EKS?

In my opinion the fact that you have to use a Custom AMI to be able to override the kubelet arguments is not flexible. It's nice to be able to managed nodegroup updates to the latest recommended AMI version from AWS, but if you use Custom AMI, how do you achieve that exactly?

Is there a way to disable the default merging of userdata from AWS without having to set ImageId explicitly in the Launch Template?

@barryib
Copy link
Member

barryib commented May 19, 2021

Closing since is has been implemented in #1138

@barryib barryib closed this as completed May 19, 2021
@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 21, 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

3 participants