Skip to content
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

Support Resource Manager Tags for GKE #16614

Open
maxi-cit opened this issue Nov 28, 2023 · 6 comments
Open

Support Resource Manager Tags for GKE #16614

maxi-cit opened this issue Nov 28, 2023 · 6 comments

Comments

@maxi-cit
Copy link

maxi-cit commented Nov 28, 2023

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 the 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 the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Currently, only VMs and Instance have Resource Manager Tags support.
This will allow to set custom firewall rules within the nodes that belong to a GKE Cluster.

New or Affected Resource(s)

  • google_container_cluster
  • google_container_node_pool

Potential Terraform Configuration

node_config = {
...
    resource_manager_tags = {
      "tagKeys/${google_tags_tag_key.key.name}" = "tagValues/${google_tags_tag_value.value.name}"
    }
...
}

References

b/315953619

@bcorbitt-ps
Copy link

Question on what was implemented in GoogleCloudPlatform/magic-modules#9531.
It appears to me that resource_manager_tags was implemented for the node_config block within the google_container_cluster resource and has not been implemented (yet?) in google_container_node_pool, making this applicable only for the default pool. Is that accurate?

@maxi-cit
Copy link
Author

maxi-cit commented Mar 5, 2024

Hello @bcorbitt-ps node_pool resource references the same object (node_config) as the cluster resource so it may seem that it is only implemented for clusters. I added a usage example for 'node_pools' in the tests.

Let me know if you find something to fix.

@bcorbitt-ps
Copy link

Thanks for the reply @maxi-cit. Everything planned and applied, but I was unable to "see" the tags anywhere. (Nothing in the console, nothing returned for gcloud resource-manager tags bindings list), but appears I may not have found just the right command. gcloud beta container node-pools describe <node-pool> --format="value(config.resourceManagerTags)" appears to be that command. Now I just need to verify that the tag alone (without a binding?) is sufficient to inherit a rule. Thanks a bunch for the contribution here!

@sanmaym
Copy link

sanmaym commented Mar 8, 2024

I also followed up on this and found this public documentation page I think we need to incorporate "autoprovisioning-resource-manager-tags" support in container-cluster resource to apply all secure tags at a cluster level?

Cluster-level setting

GKE applies the tags to all new auto-provisioned node pools in the cluster. If you use this flag on an existing cluster, existing node pools retain any tags that were applied before the update

@maxi-cit
Copy link
Author

Hello @sanmaym, I added support for auto provisioned clusters in this PR.
In case there isnt anything more to add I think we can close this issue

@sanmaym
Copy link

sanmaym commented Mar 29, 2024

@maxi-cit thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants