gcloudgoogle-cloud-sdk

Setting GCloud SDK properties through environment variables


I'm trying to configure properties for the Google Cloud SDK in a non-interactive environment (specifically, a Docker container), and I'd like to use environment variables to do it (because it seems much simpler to get right and portable compared to volume-mounting config files...). However, I can't find any documentation on what the environment variables should be called, etc.

Is it possible to configure the Google Cloud SDK using environment variables, and how do I do so?


Clarification: For now, the only property I care about is the default project, core/project in this listing.


Solution

  • There is a set of environment variables (CLOUDSDK_) that match some (all?) of the gcloud config properties.

    I was unable to find these documented but I'm aware of them through the kubectl Cloud Builder (see here) and this post

    I've submitted an issue asking Google to document these (more clearly).