gcloud commands cheatsheet

gcloud container clusters get-credentials cluster=<cluster> --zone=<zone> --project <project_id>
gcloud  compute snapshots list
gcloud  compute disks list
gcloud  compute instance list
gcloud compute snapshots update <snapshot_name> --update-labels="zone=us-central1-b,region=us-central1"
gcloud compute disks update <disk_name> --zone <zone> --update-labels="zone=us-central1-b,region=us-central1"
gcloud compute instances list --format json --filter="networkInterfaces.subnetwork=https://www.googleapis.com/compute/v1/projects/<project>/regions/<region>/subnetworks/<subnet_name>" | jq '.[] | .name'


gcloud compute instances list --zones=us-central1-b,us-central1-c,us-central1-d
gcloud compute instances add-metadata <compute_instance_name> --metadata="<common_metadata_keys>"  --zone="<zone>" --project=<project_id>
gcloud deployment-manager deployments create gke-cluster --config=cluster_config.yaml

Leave a Comment

Your email address will not be published.