You are currently viewing gcloud installation and configuration

gcloud installation and configuration

  • Post author:
  • Post category:GCP

gcloud installation and configuration

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have listed all the available services under GCP.

https://cloudaffaire.com/google-cloud-platform-services/

GCP provides multiple ways to interact with the above services. You can use google cloud console, Cloud SDK, API, etc. to create and manage resources in GCP. In this blog post, we will discuss gcloud, a command-line interface provided by google to interact with GCP resources.

What is gcloud?

The gcloud command-line interface is a tool that provides the primary CLI to Google Cloud Platform. You can use this tool to perform many common platform tasks either from the command-line or in scripts and other automations.

The gcloud CLI is a part of the Google Cloud SDK. You must download and install the SDK on your system and initialize it before you can use the gcloud command-line tool.

By default, the SDK installs those gcloud CLI commands that are at the General Availability level only. Additional functionality is available in SDK components named alpha and beta. These components allow you to use the gcloud CLI to work with Google Cloud Bigtable, Google Cloud Dataflow and other parts of the Cloud Platform at earlier release levels than General Availability.

Google provides gcloud interface directly in your browser which is preinstalled and preconfigured. To access your gcloud interface from browser you can simply login to your cloud console and click on ‘Activate cloud shell’.

gcloud installation and configuration

gcloud installation and configuration

But if you want to use gcloud from a remote system or from a compute instance, you need to install and configure the gcloud tool.

gcloud installation and configuration:

Prerequisite for gcloud:

  • A GCP account with at least one project
  • A service account with proper access to the project.

Step 1: Create a service account for gcloud

Login to the GCP console and click on ‘IAM & admin’ > ‘Service accounts’

gcloud installation and configuration

Click ‘CREATE SERVICE ACCOUNT’

gcloud installation and configuration

Provide a name to your service account and click ‘CREATE’

gcloud installation and configuration

Provide access to your project to the service account

gcloud installation and configuration

Create a key file and click ‘DONE’

gcloud installation and configuration

gcloud installation and configuration

Note: One key file with .json extension will be downloaded automatically, keep this file in a safe location. We will use this key file during gcloud configuration.

Step 2: gcloud installation and configuration

Hope you have enjoyed this blog post.

To get more details on gcloud and Google cloud SDK, please refer below GCP documentation

https://cloud.google.com/sdk/docs/

https://cloud.google.com/sdk/gcloud/reference/