-
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.node_config subfields can't be updated in-place #19225
google_container_cluster.node_config subfields can't be updated in-place #19225
Comments
cpu_manager_policy
on default nodepool
So I think what needs to happen is roughly something like "when anything in this block changes, call It may be necessary to update the cluster for some settings and the nodepool for others. |
GoogleCloudPlatform/magic-modules@db731f7 POC fix for |
GoogleCloudPlatform/magic-modules@efb71a9 |
Partial fix for hashicorp/terraform-provider-google#19225 This should resolve some confusing behavior with `cpu_manager_policy` * It frequently will show a permadrift when it can't be set * It also doesn't seem to accept the documented value of "none" as an empty value, though the previously undocumented empty string (`""`) seems to work. This doesn't resolve all of the issues, but resolves other issues where it must be set where it's not actually needed (for example, if `insecure_kubelet_readonly_port_enabled` is set). It appears that it was marked as `Required` somewhat arbitrarily, and it's also possible that some of what's in place is tied to an API level bug that may have since been resolved.
cpu_manager_policy
on default nodepool
Updated the title based on the discussion above and at GoogleCloudPlatform/magic-modules#11272 (comment) - the main thing to fix here is going to be that update-in-place is broken for most subfields of node_config. (Fixing the cpu_manager_policy issue is sort of separate but happy to track it here since there's already a PR open for it.) |
Thanks, had the same thought about updating the title to be more clear. When I created this, it wasn't quite as clear how related these issues all were, but it's becoming marginally clearer now. |
GoogleCloudPlatform/magic-modules#11553 is another one within |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Partial fix for hashicorp/terraform-provider-google#19225 This should resolve some confusing behavior with `cpu_manager_policy` * It frequently will show a permadrift when it can't be set * It also doesn't seem to accept the documented value of "none" as an empty value, though the previously undocumented empty string (`""`) seems to work. This doesn't resolve all of the issues, but resolves other issues where it must be set where it's not actually needed (for example, if `insecure_kubelet_readonly_port_enabled` is set). It appears that it was marked as `Required` somewhat arbitrarily, and it's also possible that some of what's in place is tied to an API level bug that may have since been resolved.
@melinath @rileykarson may be best for someone from Google to take this on, but if there's clear guidance about whether (and how) the node pool update stuff can be DRYed up / shared between the node_pool and container_cluster resources, I might be able to take a stab at it. |
@wyardley I don't think we have specific guidance about it, but you're welcome to take a stab. As long as it works and is easy to understand, there's a good chance we'll accept the change. Heads up that we're planning to switch the core engine from Ruby to Go in a couple weeks; I think that wouldn't impact this ticket too badly since it's working with handwritten files. The .erb formatting will change to go template formatting, but it might not be horrible to port over? Or you could wait until after the port lands. |
I guess the big thing I was looking for ideas on is whether the code can be shared between the two resources (and if so, what files should it be in). And yeah, I can work around the cutover one way or another. |
I also have GoogleCloudPlatform/magic-modules#11978 out which fixes the specific cause of that error (but still doesn't accurately model the API- we send the message we expect, and still have a permadiff). |
This sets the stage for consolidating the logic for updating nodepools between the `container_cluster` and `container_node_pool` resources, by creating a new `nodePoolNodeConfigUpdate()` function. Part of hashicorp/terraform-provider-google#19225
This resolves an issue where many subfields of `node_config` in a cluster (which affects the default node-pool "default-pool" when `remove_default_node_pool` is not set to `false`) don't support updates properly. Fixes hashicorp/terraform-provider-google#19225 Followup to GoogleCloudPlatform#11826 where the code used by the regular node pool update code was broken out.
I've added a change in the linked PR that I think will fix this for all remaining cases, and at that point, any additional DRYing up within that shared function could be totally optional and could be handled by anyone who felt like taking it on in the future. |
Also just did a quick verification that (even without these changes) when |
This resolves an issue where many subfields of `node_config` in a cluster (which affects the default node-pool "default-pool" when `remove_default_node_pool` is not set to `false`) don't support updates properly. Fixes hashicorp/terraform-provider-google#19225 Followup to GoogleCloudPlatform#11826 where the code used by the regular node pool update code was broken out.
While working on the fixes, I had a thought: at some point (not as part of this set of changes), I imagine it might be possible to build a single |
For anyone following, one thing I discovered is that Since I'm pretty sure these should be allowed to be updated in-place in the default node pool when defined in |
This resolves an issue where many subfields of `node_config` in a cluster (which affects the default node-pool "default-pool" when `remove_default_node_pool` is not set to `false`) don't support updates properly. Fixes hashicorp/terraform-provider-google#19225 Followup to GoogleCloudPlatform#11826 where the code used by the regular node pool update code was broken out.
This resolves an issue where many subfields of `node_config` in a cluster (which affects the default node-pool "default-pool" when `remove_default_node_pool` is not set to `false`) don't support updates properly. Fixes hashicorp/terraform-provider-google#19225 Followup to GoogleCloudPlatform#11826 where the code used by the regular node pool update code was broken out.
This resolves an issue where many subfields of `node_config` in a cluster (which affects the default node-pool "default-pool" when `remove_default_node_pool` is not set to `false`) don't support updates properly. Fixes hashicorp/terraform-provider-google#19225 Followup to GoogleCloudPlatform#11826 where the code used by the regular node pool update code was broken out.
This resolves an issue where many subfields of `node_config` in a cluster (which affects the default node-pool "default-pool" when `remove_default_node_pool` is not set to `false`) don't support updates properly. Fixes hashicorp/terraform-provider-google#19225 Followup to GoogleCloudPlatform#11826 where the code used by the regular node pool update code was broken out.
It appears that in-place updates were never implemented for `node_config.containerd_config`, when contained within either `google_container_cluster` or `google_container_node_pool` Fixes hashicorp/terraform-provider-google#19056 Related to hashicorp/terraform-provider-google#19225 Signed-off-by: William Yardley <[email protected]>
It appears that in-place updates were never implemented for `node_config.containerd_config`, when contained within either `google_container_cluster` or `google_container_node_pool` Fixes hashicorp/terraform-provider-google#19056 Related to hashicorp/terraform-provider-google#19225 Signed-off-by: William Yardley <[email protected]>
It appears that in-place updates were never implemented for `node_config.containerd_config`, when contained within either `google_container_cluster` or `google_container_node_pool` Fixes hashicorp/terraform-provider-google#19056 Related to hashicorp/terraform-provider-google#19225 Signed-off-by: William Yardley <[email protected]>
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. |
When defined as part of the default nodepool (via
node_config.kubelet_config
within agoogle_container_cluster
resource,cpu_manager_policy
(and, potentially, otherkubelet_config
settings) will not get updated properly if changed (note: they should function correctly when a cluster / nodepool are created initially.This seems likely to be because the code here and here is not in the path at all when the resource is invoked this way.
Note: this may affect other settings within
node_config
;it's just more urgent with this specific field because it'sRequired
, (though maybe it shouldn't need to be)?Edit:
Also, I think there are contexts whereThis is now fixed as part of #11572cpu_manager_policy
can / should be unset? I'm not sure exactly why the provider currently lists it as required to be set whenkubelet_config
is. It seems like there are cases where it's valid for it to be unset, and in fact, the provider doesn't seem to handle setting it properly in any of the cases / places I tested it.Community Note
Terraform Version & Provider Version(s)
Note: should be reproducible with regular Terraform and latest provider version as well.
Affected Resource(s)
google_container_cluster
Terraform Configuration
Debug Output
Expected Behavior
"static"
, Terraform should update the settings on the default node-pool in place to the expected value."none"
or unset, a permadiff should not be observed when the value is not set at the API levelActual Behavior
Note: the undocumented, but allowed, value
""
resolves the permadiff, presumably because the API is not returning it at all vs. returning the value"none"
with default settings, and because the provider doesn't seem to actually be trying to update the default nodepool settings when the setting is changed after the resource is initially created.Steps to reproduce
terraform apply
Important Factoids
See references below for more details
References
GoogleCloudPlatform/magic-modules#11272
#15767
b/361634104
The text was updated successfully, but these errors were encountered: