Search code examples
google-cloud-platformgcloud

In GCP, how to add label in containers k8s cluster, not to update?


I am trying to add label in k8s cluster, but unfortunately it delete all the add new one.

gcloud container clusters update example-cluster --zone us-west1-a --update-labels env=dev

I want to add label(preserve previous labels) in existing cluster. Is there any way to do that?

Thanks


Solution

  • Another easy way to add labels is through restAPI

    Check this link https://cloud.google.com/healthcare/docs/how-tos/labeling-resources