tree: b4fb0d95010dbce304bc72cb4e304a81a1fad6d8 [path history] [tgz]
  1. README.md
  2. add-secret-from-directory.sh
  3. add-secret-from-stdin.sh
  4. add-service-account-from-stdin.sh
  5. add-service-account.sh
  6. apply-all-secrets-to-cluster.sh
  7. apply-secret-to-cluster.sh
  8. config.sh
  9. copy-between-clusters.sh
  10. copy-from-cluster.sh
  11. copy-secret-between-clusters.sh
  12. delete-secret.sh
  13. download-secret.sh
  14. edit-secret.sh
  15. get-secret.sh
  16. init-berglas.sh
  17. list-secrets-by-cluster.sh
  18. list-secrets.sh
kube/secrets/README.md

Secrets

Secrets for all clusters are stored encrypted in Google Cloud Storage with the keys managed via Google KMS. We use the breglas tool to manage the encrypted information.

There is a command to copy secrets between cluster directories, and a command to apply all secrets for a cluster, thus making it easy to spin up a new cluster.

All commands move the secrets through stdin/stdout, except edit-secrets.sh which uses a temporary ramdisk to store the files which gets unmounted immediately after editing. In all cases secrets never sit on the developers drive.

The add-service-account.sh script emits the full service account email address on stdout, which is useful for scripts that need to do further processing, such as giving that service account access to a specific PubSub topic.

Access control

Files are only accessible by members of skia-root@google.com.

Configuration

The configuration is stored in config.sh. If you change the bucket or project you will have to re-run init-berglas.sh.

Format

All secrets are stored as base64 encoded kubernetes secrets serialized as YAML.

Secrets are stored in a sub-directory in Google Cloud Storage, the name of which is the name of the cluster they are used in.

We will use the cluster name etc as a special cluster name for secrets that aren't used in k8s, but are still secrets we need easy access to, such as the authorized_keys file we distribute to all the jumphosts.

Naming

The GKE cluster names as returned from kubectl config current-context aren't the normal names like skia-public that are are used to, so there are helper functions in config.sh to translate between common names and the values returned from current-context.