Google Cloud Storage

Spinnaker supports using Google Cloud Storage for persisting your Application settings and configured Pipelines.

Using Google Cloud Storage (GCS) as a storage source means that Spinnaker will store all of its persistent data in a Bucket .

Prerequisites

You need a Google Cloud Platform (GCP) project to host your bucket in. The next steps assume you’ve already created a project , and installed gcloud . You can check that gcloud is installed and authenticated by running:

  1. gcloud info

Downloading credentials

Spinnaker needs a service account to authenticate as against GCP, with the roles/storage.admin role enabled. If you don’t already have such a service account with the corresponding JSON key downloaded, you can run the following commands to do so:

  1. SERVICE_ACCOUNT_NAME=spinnaker-gcs-account
  2. SERVICE_ACCOUNT_DEST=~/.gcp/gcs-account.json
  3. gcloud iam service-accounts create \
  4. $SERVICE_ACCOUNT_NAME \
  5. --display-name $SERVICE_ACCOUNT_NAME
  6. SA_EMAIL=$(gcloud iam service-accounts list \
  7. --filter="displayName:$SERVICE_ACCOUNT_NAME" \
  8. --format='value(email)')
  9. PROJECT=$(gcloud config get-value project)
  10. gcloud projects add-iam-policy-binding $PROJECT \
  11. --role roles/storage.admin --member serviceAccount:$SA_EMAIL
  12. mkdir -p $(dirname $SERVICE_ACCOUNT_DEST)
  13. gcloud iam service-accounts keys create $SERVICE_ACCOUNT_DEST \
  14. --iam-account $SA_EMAIL

Once you have run these commands, your GCS JSON key is sitting in a file called $SERVICE_ACCOUNT_DEST.

Editing Your Storage Settings

Halyard will create a bucket for you if the bucket you specify doesn’t exist yet, or if you don’t specify one at all. All that’s required are the following values (we’ve provided defaults for you):

  1. PROJECT=$(gcloud config get-value project)
  2. # see https://cloud.google.com/storage/docs/bucket-locations
  3. BUCKET_LOCATION=us
  4. SERVICE_ACCOUNT_DEST=# see Prerequisites section above

First, edit the storage settings:

  1. hal config storage gcs edit --project $PROJECT \
  2. --bucket-location $BUCKET_LOCATION \
  3. --json-path $SERVICE_ACCOUNT_DEST

There are more options described here if you need more control over your configuration.

Finally, set the storage source to GCS:

  1. hal config storage edit --type gcs

Next steps

After you’ve set up GCS as your external storage service, you’re ready to deploy Spinnaker .

Last modified December 22, 2021: docs(fix): Fix various encoding issues (#170) (0475fe5)