I’m trying to add labels to my GKE clusters (created by terraform). The objective is the tag my resources for billing purposes. These are not k8s labels which are different and are working at the node group level. These simple do not apply at the google_container_cluster
level. labels (k8s labels) do work at the google_container_node_pool
level. however I’m not looking for k8s label. I’ve also tried resource labels, no success.
resource "google_container_cluster" "k8s" {
name = lower(random_pet.name.id)
.
.
node_config {
tags = ["test", "pass"]
labels = {
env = lower(random_pet.name.id)
}
}
..
here is a screen under the main page from my gke cluster where I expect my labels or tags to be applied. Nothing errors out but the labels are not applied. during the plan stage I do see labels will be applied, but they don’t show up in gke once the terraform automation finishes.