11. gcloud¶
gcloud is a command-line tool that lets us the command line to perform
Google Cloud tasks such as cluster provisioning, as an alternative to use
the web UI.
See [gcloud-01] for an overview and useful links (installation, etc.) and [gcloud-02] for a complete reference of gcloud commands.
Once installed, we can run the following regularly to update to the latest version:
In order to use gcloud with your account, use the gcloud init command.
This will open a browser window to login to authorize google cloud SDK to use
your account, this will also set project and zone. Settings will be saved in a config
file (~/.config/gcloud/configurations/config_default)
To create a cluster, first set a project and zone for it using the corresponding
gcloud commands (note: this is not needed if those were already set with
gcloud init):
Then create the cluster: .. code-block:: none
> gcloud container clusters create mycluster –num-nodes=1
To get cluster info: .. code-block:: none
> gcloud container clusters list > gcloud container clusters describe opsdash
If you are using an existing Kubernetes Engine cluster or if you have created a cluster through Google Cloud Platform Console, you need to run the following command to retrieve cluster credentials and configure kubectl command-line tool with them:
11.1. References¶
gcloud command-line tool overview (Retrieved 2019-09-17)
gcloud reference (Retrieved 2019-09-23)