-
-
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
feat: Drop random pets from Managed Node Groups #1372
feat: Drop random pets from Managed Node Groups #1372
Conversation
4071cd8
to
325f37c
Compare
cc @ArchiFleKs @daroga0002 @stevehipwell could you review this please ? |
/lgtm |
LGTM, I think this will prevent a lot of issues :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the only thing which is missing me is some docs on how to upgrade the module to a newer version.
I think a solution can be removal from terraform state current node groups, creating new groups from new module versions, and legacy node groups from AWS console/cli.
Maybe next week I will find some time to find upgrade path as my workload is using module version 13.2.1
@daroga0002 I think this is only a change if you've not been providing |
after introducing this change I believe it will force all group to recreate (because |
@daroga0002 does the launch templates being re-created actually matter? I don't think that the ASGs will be re-created as we're using |
@stevehipwell we are recreating whole But let me test it just to ensure |
Yes, I think the node group will be recreated. Should we let users to define a specific name like before ? Something like this: node_group_name_prefix = lookup(each.value, "name", null) == null ? lookup(each.value, "name_prefix", join("-", [var.cluster_name, each.key])) : null
node_group_name = lookup(each.value, "name", null) |
Just saw your reply @barryib. |
@barryib I'd like to see the ability to specify a name directly. |
Just giving here test result:
|
@daroga0002 I assume that's without the suggested changes in #1372 (comment)? |
yes, this is original PR, those changes proposed by @barryib will solve this issue and give additional possibility to switch to prefixed names (which from my side is desired feature) |
is there a way to extend this so that a |
@daroga0002 @ArchiFleKs @stevehipwell just updated my PR according to your reviews.
@jack1902 good point. We can't always create LT, because some users don't need it. But maybe we should create the LT if LT is needed and stop supporting external LT ? |
@barryib maybe, (the worker_sg piece really caught me off guard, since by default, the worker_sg is not attached to nodes created unless a launch template is defined) Might be worth updating the description on the Security Group to reflect this caveat OR like you say, allow people to extend a pre-defined launch template? [Happy to move this to thread since the change in this PR is a decent one, to swap nodes out without having to go through the process of creating a new managed node group through the petname piece] |
/lgtm |
37762ab
to
7c6224c
Compare
What about https://github.com/terraform-aws-modules/terraform-aws-eks#input_worker_create_cluster_primary_security_group_rules ? I personally always set it and this allow all the different type to worker to communicate together ? |
Heh, turned out I was logged in as my test user for the above comment. |
I'm don't use MNG, so don't test this intensively. So if changing something like ami_id will re-create the node group, then we should stick with the name_prefix to avoir node group name collision because of create_before_destroy. Edit: |
yep, exactly. I've had to vend this module and drop the lifecycle rule in my current project because of this. |
What is the best upgrade path when you're using Managed Node Groups with Terrarform ? |
@barryib AMI ID is in the launch template and doesn't force node group re-creation but enough arguments that might be changed regularly do so I'm thinking that |
@barryib any progress on this? |
f7bac54
to
568e62c
Compare
@stevehipwell still working on it. Just wanted to test it more. |
8200888
to
139f2f6
Compare
0514f9d
to
3b2c357
Compare
@ArchiFleKs @daroga0002 @stevehipwell a final review please. |
3b2c357
to
6913a44
Compare
6913a44
to
a1d7cdc
Compare
Thanks everyone for your help on this. |
…s#1372) BREAKING CHANGES: We now decided to remove `random_pet` resources in Managed Node Groups (MNG). Those were used to recreate MNG if something change and also simulate the newly added argument `node_group_name_prefix`. But they were causing a lot of troubles. To upgrade the module without recreating your MNG, you will need to explicitly reuse their previous name and set them in your MNG `name` argument. Please see [upgrade docs](https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/upgrades.md#upgrade-module-to-v1700-for-managed-node-groups) for more details.
for what its worth: I can report TF lets me upgrade from <=14.0.0 to 17.0, w/o having to recreate node-groups ! so thanks for this change ! steps to reproduce, might help someone coming here:
|
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. |
PR o'clock
Description
BREAKING CHANGES: We now decided to remove
random_pet
resources in Managed Node Groups (MNG). Those were used to recreate MNG if something changed and also simulate the new argumentnode_group_name_prefix
. But they were causing a lot of issues. To upgrade the module without recreating your MNG, you will need to explicitly reuse their previous name and set them in your MNGname
argument. Please see upgrade docs for more details.Checklist