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

EKS Node Launch Template support #24

Closed
dotCipher opened this issue Aug 26, 2020 · 14 comments
Closed

EKS Node Launch Template support #24

dotCipher opened this issue Aug 26, 2020 · 14 comments

Comments

@dotCipher
Copy link
Contributor

Describe the Feature

The eks-node-group resource now supports launch templates.

See associated aws post as well as eks launch templates docs for more information.

Expected Behavior

  1. Define launch_template somewhere in call-site of this module
  2. Reference launch_template output within attribute of cloudposse/terraform-aws-eks-node-group

Use Case

I'd like to be able to add user data (ie. install SSM agent) to my EKS managed node groups, and I am unable to do that without adding launch templates.

Describe Ideal Solution

There should be a launch_template attribute that is 'settable' for the module

Alternatives Considered

Only alternative would be to remove dependency to this module and hand write it 😛

Additional Context

@dotCipher
Copy link
Contributor Author

dotCipher commented Aug 27, 2020

Seems like this might be dependent on the version bump PR: #25

@dotCipher
Copy link
Contributor Author

FWIW, I'd gladly help write the PR, can someone point me in the right direction for the testing workflow used? ie. what commands to run, etc?

@danjbh
Copy link
Contributor

danjbh commented Aug 27, 2020

I'm going to push to get this knocked out today and would appreciate another set of eyes & testing when the new PR ready. I'll post it here once it's ready. Stay tuned!

@danjbh
Copy link
Contributor

danjbh commented Aug 27, 2020

Hey there @dotCipher , I have a first draft of this prepped that allows you to...

  1. Completely override the launch template by passing aws_launch_template.foo.id and launch_template.foo.version to the module
  2. Override only the userdata by passing it to the module as a typical, b64 encoded string
  3. Not do anything extra and we'll use a minimal, default aws_launch_template (and default userdata) -- the primary enhancement here being that it adds the tag_specifications config option that will pass on our tags to instances, volumes, and elastic-gpu

Beyond that, there is one snag I ran into w/ the instance types -- a launch template won't accept a list of instance types, which the module is currently accepting. The aws_eks_node_group resource actually accepts a list, although the documentation says it can only handle a single value currently (woohoo).

Anyhow, I need to sort through that bit before I can push another PR and I may not have it ready until tomorrow. But definitely let me know your thoughts on the above in the meantime!

@danjbh
Copy link
Contributor

danjbh commented Aug 28, 2020

Hey there @dotCipher , feel free to check out #27

@dotCipher
Copy link
Contributor Author

Awesome, thanks @danjbh! I posted some questions on the PR

@danjbh
Copy link
Contributor

danjbh commented Aug 30, 2020

Hey @dotCipher , just a friendly warning here -- I found some issues w/ the latest version of the module after merging that PR. I would hold off on using the module until I can get things fixed.

@dotCipher
Copy link
Contributor Author

Thanks for the heads-up @danjbh, I'll keep a look out for your fix

@dotCipher
Copy link
Contributor Author

Out of curiosity, what were the issues you found?

@danjbh
Copy link
Contributor

danjbh commented Aug 31, 2020

Out of curiosity, what were the issues you found?

I didn't realize that if we don't specify our own custom AMI, that it actually appends it's own bootstrap.sh script in userdata AFTER the userdata script that we supply. So it was effectively trying to run bootstrap.sh twice, which was... undesirable :)

@dotCipher
Copy link
Contributor Author

Does the AMI get set to custom version if the userdata is set? Would I be able to use the module as-is now if I am not using a custom AMI?

@danjbh
Copy link
Contributor

danjbh commented Aug 31, 2020

Nope, we can set our userdata without specifying a custom AMI, so you should be able to install your SSM agent using 0.10.0 of the module by setting the before userdata variable.

@dotCipher
Copy link
Contributor Author

Ah ok great thanks!

@dotCipher
Copy link
Contributor Author

Feel free to close this out then, appreciate the help! I'll follow up with a new ticket if I have any issues

@danjbh danjbh closed this as completed Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants