Using environment variables to set gcloud config

Niel de Wet
1 min readDec 11, 2018

--

The gcloud utility (and therefore, CLOUDSDK) can be configured using environment variables. Available configuration options can be seen by running gcloud config --help.

Configuration options can be set using environment variables in this form:
CLOUDSDK_<SECTION>_<PROPERTY>

Example: Setting the cluster and project for kubectl cloud builder

In this example CLOUDSDK_COMPUTE_ZONE corresponds to gcloud config set compute/zone us-central1-a, CLOUDSDK_CONTAINER_CLUSTER to gcloud config set container/cluster cluster-1 and CLOUDSDK_CORE_PROJECT to gcloud config set core/project my-project-123456.

--

--

No responses yet