Google Cloud Labels:
- Creating Instance With Labels:
Command Reference:
gcloud compute instances create [instance-name] –labels key=value key-value
Example:
gcloud compute instances create test2 –zone us-central1-a –labels env=prod,owner=raghav,component=frontend
2. List Existing Labels:
Command Reference:
gcloud compute instances describe [instance-name] –format ‘default(labels)’
Example:
gcloud compute instances describe test2 –zone us-central1-a –format ‘default(labels)’
3. Update Existing Labels:
Command Reference:
gcloud compute instances update [instance-name] –update-labels key=value, key=value
Example:
gcloud compute instances update test2 –zone us-central1-a –update-labels owner=seshu, state=readyfordeletion
4. Remove Existing Labels:
Command Reference:
gcloud compute instances update [instance-name] –remove-labels key1, Key2
Example:
gcloud compute instances update test2 –remove-labels state