LinuxCommandLibrary

gcloud

gcloud

TLDR

List all properties in one's active configuration

$ gcloud config list
copy


Login to a Google account
$ gcloud auth login
copy


Set the active project
$ gcloud config set project [project_name]
copy


SSH into a virtual machine instance
$ gcloud compute ssh [user]@[instance]
copy


Display all Google Compute Engine instances in a project (by default instances from all zones are listed)
$ gcloud compute instances list
copy


Update a kubeconfig file with the appropriate credentials to point kubectl to a specific cluster in Google Kubernetes Engine (GKE)
$ gcloud container clusters get-credentials [cluster_name]
copy


Update all gcloud components
$ gcloud components update
copy


Display help for a given command
$ gcloud help [command]
copy

Copied to clipboard