terraform-provider-google
terraform-provider-google copied to clipboard
GKE Nodepool adding tags should not recreate
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
- Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
- If an issue is assigned to the
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.
Affected Resource(s)
- google_container_node_pool
Previous issue: https://github.com/hashicorp/terraform-provider-google/issues/2532
The GKE API supports updating tags on an existing node pool; an operation is kicked off which adds network tags to all the existing node pools, similar to a version upgrade operation.
Currently, modifying tags on the google_container_node_pool
resource causes it to be deleted & recreated. It feels like this behaviour should be changed to support the inline updating of existing node pools
Looks like tags and labels are updatable now
https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters.nodePools/update
Change label to enhancement
This also applies to labels also reported here. Seems like there is a PR but needs to account for labels as well.
@edwardmedia - would you like us to create another issue for label or can we track it here?
@g-awmalik we can track labels over here. Let me update the subject
Hello, here is the initial PR (under review) that allows to update nodepool labels without causing the nodepools to be re-created.
If the node_pool is configured with auto scaling enabled then Update any metadata in node pool will FAIL with the following google error:
"Updates for 'labels' are not supported in node pools with autoscaling enabled (as a workaround, consider temporarily disabling autoscaling or recreating the node pool with the updated values.)"
You can publish this error back to the user, so he can decide to use this temp workaround by google or not. You can validate this with upstream (the relationship with auto scaling property).
According to this doc since GKE 1.23.4-gke.300 nodepool labels may be modified in-place even if cluster auotscaler is enabled.
Ah, just found this was released in provider version 4.48.0 (changelog)– should this issue be closed?
Labels are possible, but network tags are not. I'll update the issue. It does seem possible to update them: https://cloud.google.com/kubernetes-engine/docs/how-to/autopilot-network-tags#standard_1
I believe this was resolved by https://github.com/GoogleCloudPlatform/magic-modules/pull/6599 - even though the title of the PR (and the release note) talk about labels, the actual implementation seems to add support for updating network tags.
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.