Google Cloud Platform – GCP Cloud SDK

How to Install Docker on macOS

Throughout this book, we have been using the cloud SDK in some shape or form. Cloud SDK provides a set of tools to manage GCP resources. Recall the use of the command gcloud which is just one of the command line tools that cloud SDK offers. Cloud SDK has other command line tools as well, such as gsutil and bq. Cloud SDK can be installed on various platforms such as Linux, Debian/Ubuntu, macOS, RedHat, and Windows.

Cloud SDK is made up of components. Components are installable parts of the SDK, such as command-line tools or packages that contain dependencies for tools in SDK. Components also allow you to access tools that are in Alpha or Beta testing phases. When you install the cloud SDK, the following components are installed: gcloud, bq, gsutil, and core. The gcloud tool gives you the ability to interact with GCP using commands in the terminal. This is ideal for day-to-day users and even for scripting. The bq tool is a BigQuery command-line toolkit, and gsutil is a tool set for Cloud Storage operations. The core tool is an SDK library used by SDK tools.

You can install the Cloud SDK by going to  and downloading the version that is appropriate for your machine. You need to make sure you have Python 2.7.x. Once downloaded, unpack the archive and run the command, gcloud init to initialize the SDK. The gcloud init command is the first command that you run to configure your account. Once this is done, all gcloud commands will be executed within the realms of that GCP account and within the confines of a project:

You can review your active configuration properties by typing gcloud config list:

In the preceding screenshot, note that this configuration is marked as default. You can create multiple configurations and name them, and switch between them as per your requirement. Typically, while operating multiple projects, this multi-configuration capability will be helpful. Use the gcloud config configurations create [name] command to create a named configuration. You can also list all available configurations using the gcloud config configurations list command.

To view the components installed, type gcloud components list:

You can always use gcloud components install <component name> to install a new component that is not part of the default.

For example, gcloud components install kubectl installs the Kubernetes components.

To update your Cloud SDK version, simply run gcloud components update to update your tools.

Comments are closed.