-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Fix allow several instance types #54
Fix allow several instance types #54
Conversation
With the introduction of SPOT instances for managed node groups it is also now possible to specify more than a single instance_type
/test all |
I'll take a look later at fixing the tests - seems to be that they expect the validation message to be in a certain format. |
fix of |
Signed-off-by: Patrick Jahns <github@patrickjahns.de>
/test all 🤞 - hope this works |
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.
@osterman @aknysh We need to discuss how to support this feature moving forward.
One problem is that supporting this feature requires AWS Terraform provider >= 3.20 and I do not know if we want to push that requirement on our customers. At a minimum, though, we need to make that change in versions.tf as part of this PR.
A bigger problem is that AWS is currently split on how they support this, which brings us a split in how we can support it. I would prefer to defer support until AWS resolves their split, but I can see where our customers would get upset about that.
According to the AWS documentation:
If you specify launchTemplate, then you can specify zero or one instance type in your launch template or you can specify 0-20 instance types for instanceTypes.
The problem for us with this module is that there are a set of features only available by specifying the launch template: See
terraform-aws-eks-node-group/main.tf
Line 9 in b4c6e02
features_require_launch_template = local.enabled ? length(var.resources_to_tag) > 0 || local.need_userdata || local.features_require_ami : false |
This module automatically creates a launch template if the requested configuration requires it, which means that it is not obvious whether or not you can specify more than one instance type, and makes error messages confusing. (I think the test for whether or not we can have more than once instance type is more complex than allowed in a custom validation. If I am wrong about that, then I guess a custom validation with appropriate explanation would be they way to move forward.)
The support for Regarding:
The next sentences from the AWS documentation clarified it the launch template situation for me
So I understood this, as that you are limited to 0-1 instance-types when you specify it via the launch template - but if you specify the instance types via the For users of the module, it is probably good to raise awareness, that when they use a custom launch template they shall rather omit the |
Anything I can do here to move forward with this PR? |
This pull request is now in conflict. Could you fix it @patrickjahns? 🙏 |
This Pull Request has been updated, so we're dismissing all reviews.
variables.tf
Outdated
EOT | ||
validation { | ||
condition = ( | ||
length(var.instance_types) == 1 | ||
length(var.instance_types) > 20 |
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.
The condition argument is an expression that must use the value of the variable to return true if the value is valid, or false if it is invalid.
length(var.instance_types) > 20 | |
length(var.instance_types) >= 1 && length(var.instance_types) <= 20 |
One remaining issue is that this module creates launch templates implicitly for the user to enable certain features. We now need to update the module so that the launch template does NOT specify instance types and ensure that the |
/test all |
what
capacity_type
see upstream prwhy
references
instanceTypes
in current AWS eks api