-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Update a launch template of a managed node group without recreating that managed node group #1109
Comments
I tried what happens if I remove
Maybe this is a clue? I don't understand what purpose the
|
I finally took a deeper look into this issue. Learnings:
=> RECREATING the Node Group is incorrect behaviour. Changing the Launch Template will create a new version of that Launch Template. However, updating the Managed Node Group use this new version of the Launch Template is a separate action. Managed Node Group can have either:
Launch Template versions are meant to be used as a managed way to distribute updates to Managed Node Groups. If the Managed Node Group is recreated from scratch, rather than updated in-place, it defeats the purpose. Workaround - The random_pet resource is harmfulIssue can be fixed as follows:
TL;DR With explicit node_group name, Avoid random_pet - it is a nice helper for starting up easily but it will only cause debug pains in a live environment. |
This is particullary issue when Terraform is applied from Linux and the from Windows machine (or vice versa), because userdata.sh.tpl differs because of the different newlines ... |
This is indeed a pain for production use. @pre How did you manage to delete random.tf? |
I forked this module and stopped dreaming about community maintained terraform. |
we just ran into this problem as well. is there plan to fix this in the module? |
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. |
I have issues with updating a launch template of a Managed Node Group
I'm submitting a...
What is the current behavior?
Practically any change to a Launch Template will force recreation of a Managed Node Group.
If this is a bug, how to reproduce? Please include a code sample if relevant.
Use eg. the examples from https://github.com/terraform-aws-modules/terraform-aws-eks/tree/e4520d2c2e1b1a182d4abb8bdaf032534f5ed89f/examples/launch_templates_with_managed_node_groups
See concrete examples at the bottom
Using node_group
name
instead ofname_prefix
to remove any traces ofrandom_pet
does not have an effect.Run
terraform apply
twice, so that the second run does not show any changes.Update any attribute in the Launch Template. For example, do a change in the userdata template or change
block_device_mappings > ebs > volume_size
.What's the expected behavior?
Changing the Launch Template happens in-place (as it currently does), this works and Launch Template gets a new version number.
Existing Managed Node Group is updated to the new Launch Template version number:
Existing Managed Node Group is not replaced with a new resource. Instead the existing MNG is kept.
Something causes
ami_type
,disk_size
andnode_group_name
to change and force a replacement. I have tried setting them explicitly innode_groups_defaults
, or in thenode_group
but it does not have an effect. I have tried leaving them out - no effect, still trying to recreate the MNG.Related
Environment details
Any other relevant info
Terraform output
Node Group
Launch Template
The text was updated successfully, but these errors were encountered: