CI/CD Secrets Sync

Kubernetes secrets sync automation in CI/CD using the Doppler and Kubernetes CLI.

Prerequisites

Service Token

Accessing your secrets in CI/CD environment using the Doppler CLI requires a Service Token to provide read-only access to a specific config via the DOPPLER_TOKEN environment variable.

Secrets Sync

Run this command prior to the deployment application step to sync the latest version of secrets to the Kubernetes secret for your application:

kubectl create secret generic your-app-secrets \
  --save-config \
  --dry-run=client \
  --from-env-file <(doppler secrets download --no-file --format docker) \
  -o yaml | \
  kubectl apply -f -

👍

Awesome Work!

Now you know how to sync Kubernetes secrets in CI/CD using the Doppler and Kubernetes CLI.