2018-05-28 19:25:10 +01:00
|
|
|
# gcloud
|
|
|
|
|
|
|
|
> The official CLI tool for Google Cloud Platform.
|
2024-01-08 13:59:32 +00:00
|
|
|
> Note: `gcloud` subcommands have their own usage documentation.
|
2019-06-07 11:58:20 +01:00
|
|
|
> More information: <https://cloud.google.com/sdk/gcloud>.
|
2018-05-28 19:25:10 +01:00
|
|
|
|
|
|
|
- List all properties in one's active configuration:
|
|
|
|
|
|
|
|
`gcloud config list`
|
|
|
|
|
2024-01-08 13:59:32 +00:00
|
|
|
- Login to a Google account:
|
2019-06-24 23:57:48 +01:00
|
|
|
|
|
|
|
`gcloud auth login`
|
|
|
|
|
2018-05-28 19:25:10 +01:00
|
|
|
- Set the active project:
|
|
|
|
|
|
|
|
`gcloud config set project {{project_name}}`
|
|
|
|
|
|
|
|
- SSH into a virtual machine instance:
|
|
|
|
|
2023-12-27 06:22:49 +00:00
|
|
|
`gcloud compute ssh {{user}}@{{instance}}`
|
2018-05-28 19:25:10 +01:00
|
|
|
|
2024-01-08 13:59:32 +00:00
|
|
|
- Display all Google Compute Engine instances in a project (by default instances from all zones are listed):
|
2018-05-28 19:25:10 +01:00
|
|
|
|
|
|
|
`gcloud compute instances list`
|
|
|
|
|
2024-01-08 13:59:32 +00:00
|
|
|
- Update a kubeconfig file with the appropriate credentials to point `kubectl` to a specific cluster in Google Kubernetes Engine (GKE):
|
2018-05-28 19:25:10 +01:00
|
|
|
|
|
|
|
`gcloud container clusters get-credentials {{cluster_name}}`
|
|
|
|
|
2024-01-08 13:59:32 +00:00
|
|
|
- Update all `gcloud` components:
|
2018-05-28 19:25:10 +01:00
|
|
|
|
|
|
|
`gcloud components update`
|
|
|
|
|
2023-12-27 06:41:30 +00:00
|
|
|
- Display help for a given command:
|
2018-05-28 19:25:10 +01:00
|
|
|
|
|
|
|
`gcloud help {{command}}`
|