terraform-provider-google icon indicating copy to clipboard operation
terraform-provider-google copied to clipboard

GKE Nodepool adding tags should not recreate

Open Evesy opened this issue 2 years ago • 1 comments

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 to hashibot, 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

Evesy avatar Sep 22 '22 10:09 Evesy

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

edwardmedia avatar Sep 22 '22 13:09 edwardmedia

This also applies to labels also reported here. Seems like there is a PR but needs to account for labels as well.

g-awmalik avatar Sep 27 '22 23:09 g-awmalik

@edwardmedia - would you like us to create another issue for label or can we track it here?

g-awmalik avatar Sep 28 '22 19:09 g-awmalik

@g-awmalik we can track labels over here. Let me update the subject

edwardmedia avatar Oct 06 '22 17:10 edwardmedia

Hello, here is the initial PR (under review) that allows to update nodepool labels without causing the nodepools to be re-created.

LucaPrete avatar Dec 11 '22 18:12 LucaPrete

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).

korenlev avatar Jan 27 '23 02:01 korenlev

According to this doc since GKE 1.23.4-gke.300 nodepool labels may be modified in-place even if cluster auotscaler is enabled.

michaelbannister avatar Jun 12 '23 15:06 michaelbannister

Ah, just found this was released in provider version 4.48.0 (changelog)– should this issue be closed?

michaelbannister avatar Jun 12 '23 15:06 michaelbannister

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

rileykarson avatar Jun 13 '23 18:06 rileykarson

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.

melinath avatar Jan 19 '24 22:01 melinath

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.

github-actions[bot] avatar Feb 19 '24 02:02 github-actions[bot]