You are currently viewing gcloud core concepts

gcloud core concepts

  • Post author:
  • Post category:GCP

gcloud core concepts

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have learned how to install and configure gcloud.

https://cloudaffaire.com/gcloud-installation-and-configuration/

In this blog post, we will discuss some of the core concepts for gcloud.

gcloud core concepts:

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.

Release levels:

  • General Availability: Commands are considered fully stable and available for production use. Advance warnings will be made for commands that break current functionality and documented in the release notes.
  • Beta: Commands are functionally complete, but may still have some outstanding issues. Breaking changes to these commands may be made without notice.
  • Alpha: Commands are in early release and may change without notice.

Command groups:

Within each release level, gcloud CLI commands are organized into a nested hierarchy of command groups, each of which represents a product or feature of the Cloud Platform or its functional subgroups.

Example:

  • gcloud compute: Commands related to Compute Engine in general availability
  • gcloud compute instances: Commands related to Compute Engine instances in general availability
  • gcloud beta compute: Commands related to Compute Engine in Beta
  • gcloud alpha app: Commands related to managing App Engine deployments in Alpha

Properties:

gcloud CLI properties are settings that affect the behavior of the gcloud CLI and other Cloud SDK tools. Some of these properties can be set by either global or command flags – in which case, the value set by the flag takes precedence.

Configurations:

A configuration is a named set of gcloud CLI properties. It works like a profile, essentially. Starting off with Cloud SDK, you’ll work with a single configuration named default and you can set properties by running either gcloud init or gcloud config set. This single default configuration is suitable for most use cases. If you’d like to work with multiple projects or authorization accounts, you can set up multiple configurations with gcloud config configurations create and switch among them accordingly.

Global flags:

The gcloud CLI provides a set of gcloud CLI-wide flags that govern the behavior of commands on a per-invocation level. Flags override any values set in SDK properties.

Positional Arguments and Flags:

While both positional arguments and flags affect the output of a gcloud CLI command, there is a subtle difference in their use cases. A positional argument is used to define an entity on which a command operates while a flag is required to set a variation in a command’s behavior.

Demo:

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/docs/properties

https://cloud.google.com/blog/products/gcp/filtering-and-formatting-fun-with

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