HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

gcloud — The official CLI tool for Google Cloud Platform. Some subcommands such as `app` and `init` have thei

Submitted by: @import:tldr-pages··
0
Viewed 0 times
theofficialcommandcligcloudtoolfor

Problem

How to use the gcloud command: The official CLI tool for Google Cloud Platform. Some subcommands such as app and init have their own usage documentation. More information: <https://docs.cloud.google.com/sdk/gcloud>.

Solution

gcloud — The official CLI tool for Google Cloud Platform. Some subcommands such as app and init have their own usage documentation. More information: <https://docs.cloud.google.com/sdk/gcloud>.

List all properties in one's active configuration:
gcloud config list


Login to a Google account:
gcloud auth login


Set the active project:
gcloud config set project {{project_name}}


SSH into a virtual machine instance:
gcloud compute ssh {{user}}@{{instance}}


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


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}}


Update all gcloud components:
gcloud components update


Display help for a given command:
gcloud help {{command}}

Code Snippets

List all properties in one's active configuration

gcloud config list

Login to a Google account

gcloud auth login

Set the active project

gcloud config set project {{project_name}}

SSH into a virtual machine instance

gcloud compute ssh {{user}}@{{instance}}

Display all Google Compute Engine instances in a project (by default instances from all zones are listed)

gcloud compute instances list

Context

tldr-pages: common/gcloud

Revisions (0)

No revisions yet.