-
Notifications
You must be signed in to change notification settings - Fork 1.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
GKE Cluster gets destroyed and reconfigured on reapply #1442
Comments
Thanks for the report @jlevertov.
This seems to me like something deferring the data source read which is the input to the random_shuffle. Are you using depends_on with the module? An option could be to make this conditional and only create the random resource if var.zones is not set. |
Hi, |
Any update on this? Having the same issue. |
Coulden't this be solved by adding
or I guess we could do it some other variable as well. |
This way we will still get random zones but only the first time the cluster is created. Solves terraform-google-modules#1442 Signed-off-by: Edvin Norling <edvin.norling@kognic.com>
This way we will still get random zones but only the first time the cluster is created. Solves terraform-google-modules#1442 Signed-off-by: Edvin Norling <edvin.norling@kognic.com>
It's presumably safe to apply the deleted random shuffle resource that shows up from this?
|
Yes @wyardley , i have done it many times. |
I know this issue is closed, but I'm running into issues with the random_shuffle trying to recreate my cluster. I'm using the beta-autopilot-private-cluster submodule and creating a regional cluster in us-central1, which is the only region where there are four zones. I am not supplying a zone list as that kind of defeats the purpose of a regional cluster, so the random_shuffle is being invoked. Given that node_locations is optional, why is this random_shuffle necessary at all with a regional cluster? With the random_shuffle returning three results, it will return all zones in every region other than us-central1, unless I'm missing something? Couldn't this module simply not set node_locations for regional clusters unless node_locations is explicitly set? If there's a reason I'm missing as to why node_locations is necessary, couldn't it be set to data.google_compute_zones.available[0].names without the random shuffle? I commented out node_locations in the submodule as a test and applied to my environment. It worked as I expected and I see all four zones of us-central1 listed in "Default node zones." |
TL;DR
Because of the zones random shuffle, when the cluster is regional no matter what, when I reapply the module (even if no change was made) terraform reads the cluster as needs to be recreated (destroyed and created)
Expected behavior
When no change is made in the module configuration, nothing should happen.
Observed behavior
when I reapply the module (even if no change was made) the cluster is being recreated (destroyed and created)
Plan example:
Logs Example:
Terraform Configuration
Terraform Version
Additional information
The cluster itself seems to not change and all the workloads and nodes stay the same.
The text was updated successfully, but these errors were encountered: