-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Disable EKS auto mode fails #3273
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
Comments
Just hit this issue myself |
Same here There are three structures in the cluster config that are created/modifed as a result of enabling auto mode.
Prior to enabling auto mode,
After enabling auto mode, the
These structures can not be removed once they have been added so simply commenting out the
or disabling it
results in the module trying to set the
|
@bryantbiggs I see that you were attempting to solve this problem in #3253 and had to revert in #3255 Are you still working on this problem? If so, do you have an estimate on when a fix will be released? Thanks |
This has to be fixed in the provider first |
this issue looks pretty similar, but the error message is somehow different: hashicorp/terraform-provider-aws#40582 |
The API has a number of constraints that make this a litle difficult, but it does work. 1. The node_role_arn cannot be changed without recreating the cluster. This is an API limitation, not a terraform provider bug. https://docs.aws.amazon.com/eks/latest/APIReference/API_ComputeConfigRequest.html 2. If node_pools is not empty, then the node_role_arn *must* be provided. 3. If the node_role_arn is provided, then node_pools must not be empty! If you enable Auto Mode and set node_pools to a non-empty value, which requires setting node_role_arn, you cannot later change node_pools to an empty value, unless you also unset the node_role_arn. But if you unset the node_role_arn, then the cluster will be recreated due to the first point above. So, we *can* support disabling auto-mode without recreating a cluster, but only if node_pools is not empty and if node_role_arn does not change. Fixes terraform-aws-modules#3273
I've posted another attempt to address this problem, see #3308. I've confirmed it works to enable and disable Auto Mode, and enable it again. There are some limitations imposed by the API (not the provider), such that you can't change from a non-empty node_pools config to an empty node_pools config. But other than that, works fine. |
Well I guess the PR doesn't update once closed, but the branch has the fix. You can review the changeset here, instead, master...lorengordon:terraform-aws-eks:fix/compute-config-false-or-null |
@bryantbiggs I get that one should track the issue on the provider, just a question though, how is this module compatible with what the latest published version of the provider documents? I mean that in the docs, it says:
However, in the module's code, this is not respected unless I'm missing something:
BTW, the use case I'm seeing this is when creating a new cluster. Thanks! |
What's not respected? |
The code generates the following blocks if
I would expect the following, based on what I understand in the provider's doc though:
Right? (Edit: Added some missing brackets) |
No |
I see, would you share (or point towards) why though? Am I missing something in the provider's doc or in this module's implementation? |
@cmam-programize I believe you actually are correct, and that is exactly why my changeset works, where the current release and prior attempted fixes fail. |
I wanted to add this in my own terraform setup to just add a variable to enable/ disable auto mode, Like this
So when I set
I get a similar sort of error
Even if I create a cluster with a managed nodepool with EKS enabled False, things start to break, sadly. It feels like AWS is pushing EKS Auto but in the current state it is giving me a bit of a headache Will keep a sharp eye on the provider issue though 👀 |
@MDBeudekerCN I had a similar solution that unfortunately also caused me to run into this issue. I, too, set up a variable to enable/disable auto mode which was implemented like this: # Enable EKS auto
cluster_compute_config = {
enabled = var.eks_auto_mode
node_pools = var.eks_auto_mode ? ["general-purpose", "system"] : []
} Going to try updating our private version of this module with the fixes mentioned by @lorengordon just above your comment |
@swirle13 Be sure to read the full message in my last commit on that changeset. It describes a current limitation of the provider resource, but otherwise does work fine for the use case you mentioned. Edit: Actually that commit message is a little outdated. I tested a few things in the console, and posted the findings to the provider issue ... |
This issue has been automatically marked as stale because it has been open 30 days |
Description
Disabling eks auto mode on an existing cluster fails. Apparently there are some related changes and issues that claimed to solve and reverted it again. As all related issues are closed i am have decided to raise a new issues.
Versions
Module version [Required]:
Terraform version:
Terraform v1.10.2
Provider version(s):
Reproduction Code [Required]
working with auto mode
changing to:
Steps to reproduce the behavior:
Expected behavior
no error
Actual behavior
Terminal Output Screenshot(s)
Additional context
The text was updated successfully, but these errors were encountered: