-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
google_container_cluster tries to recreate cluster always when used in combination with google_container_node_pool #2115
Comments
Hmm, looking at that plan, what stands out to me is:
So here's what I think's happening:
It's not perfect, but I believe if you move the node_config block from container_cluster into the node_pool, that confusion will be resolved. I'll investigate and see if we can't come up with a better solution for this to make it work intuitively. |
That actually makes a lot of sense. I didn't think about that. Thank you very much! (yes, it does indeed fix the problem) |
omg thanks for this, i've been banging my head with this for a few days ;) |
So it sounds like we either have a documentation problem or a validation problem. I'm not 100% up to speed on the reason we have node_config at the cluster and node pool levels, so I'm not comfortable enough that I have all the use cases in mind to be able to say what the ideal solution is here, but I think we can improve this either through documentation or through not letting cluster set node_config, or through potentially handling an empty node_config on a node pool better. I'll leave this open so we can investigate those options. |
@paddycarver the answer to your question is that the |
Wow, until this is resolved, a big fat warning should be added to the docs. We advertise this as the recommended way to bootstrap a GKE cluster, yet recreate the cluster on every terraform apply. |
don't advertise a separately managed node pool as recommended, until hashicorp#2115 is fixed.
Flipped default and added warning in #3733. |
Hey @flokli! Our recommendation is to use separately managed node pools and not use the default node pool at all. If you specify a As shown in the recommended example, |
@rileykarson if I copy that exact example: and |
I just tested this and I can confirm that the 'recommended' example destroys itself on every run of |
The same is true of the other example using the default node pool, and neither is related to configuration of node pools. This is related to a breaking change from the GKE API where a default value was changed. Patching with GoogleCloudPlatform/magic-modules#1844. See #3672 / #3369. |
https://www.terraform.io/docs/providers/google/r/container_cluster.html#node_config is more clear about being used for the default node pool now. I don't think there's anything actionable to fix here, so I'm going to close this out. If anyone has anything unresolved and thinks this should be reopened, feel free to comment and I will. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Terraform Version
Terraform v0.11.8
Affected Resource(s)
Terraform Configuration Files
Debug Output
A lot of info in those logs to share them openly. Any tool there to anonimase them? Happy to share them if there is no sensitive data on them. I couldn't find much info about it.
Panic Output
It does not crash
Expected Behavior
Once applied succesfully, if I terraform plan again, no changes should be needed.
Actual Behavior
If right after applying the changes successfully, I terraform plan, I get:
Steps to Reproduce
terraform apply
2
terraform apply
againImportant Factoids
This was not happening when using the default node pool. I started seeing the issue after using my own node pool instead, so I think it may be related to the node pool.
References
Maybe related to hashicorp/terraform#18209 ?
The text was updated successfully, but these errors were encountered: