External Secrets Operator
:::warning Experimental
The external-secrets integration is experimental and not yet covered by the
same stability guarantees as the default derived-secrets model. It is being
rolled out incrementally: the infrastructure and application secrets are
migrated, but a few edge cases remain (see Not yet migrated),
and MIJNBUREAU_MASTER_PASSWORD is still required at render time. Validate
behaviour in a non-production environment before relying on it.
:::
MijnBureau can source its secrets from an external secret manager instead of
deriving them from MIJNBUREAU_MASTER_PASSWORD. The stack is:
- OpenBao — the source of truth. Secrets are stored (and generated) in an OpenBao KV v2 store.
- External Secrets Operator (ESO) — syncs OpenBao values into ordinary
Kubernetes
Secretobjects viaClusterSecretStore+ExternalSecretCRs. - App charts — consume the ESO-synced
Secret(viaexistingSecret/usersExistingSecret/secretKeyRef) instead of rendering their own.
scripts/generate-openbao-secrets.sh ──writes──▶ OpenBao KV v2
▲
ClusterSecretStore `openbao` (K8s SA auth)
▲
ExternalSecret per app ──syncs──▶ Kubernetes Secret
▲
app charts consume via existingSecret / secretKeyRef
The switch
One flag in helmfile/environments/default/secrets.yaml.gotmpl:
secrets:
backend: derived # derived (default) | external
store:
name: openbao
server: "https://openbao.<yourdomain>"
mount: kv # KV v2 mount
pathPrefix: mijnbureau
kubernetes:
serviceAccount: external-secrets
audience: vault
backend: derived— current behaviour: every secret is derived fromMIJNBUREAU_MASTER_PASSWORD, and charts render inlineSecrets.backend: external— every app switches to OpenBao-backed secrets. The ClusterSecretStore and per-app ExternalSecrets are rendered, and the CNPG/valkey/seaweedfs charts stop rendering their inlineSecrets.
There is no per-app opt-in: flipping backend to external affects all apps at
once.
Generating secrets into OpenBao
export BAO_ADDR=https://openbao.<yourdomain>/
export BAO_TOKEN=<token-with-write-on-kv/mijnbureau/*>
export BAO_KV_MOUNT=kv # matches secrets.store.mount
./scripts/generate-openbao-secrets.sh [--env demo] [--force] [--dry-run]
The script generates every secret in its final form (40/50/63-char hex,
Fernet keys, msgk_ API keys, channel UUIDs) and writes them to
kv/data/mijnbureau/<env>/<owner>/<key>. It is idempotent (skips existing
values unless --force, which rotates and therefore breaks existing DB/app
access until the apps restart against the new values).
Secrets shared between apps (Keycloak client secrets, calendars↔messages channel keys, …) are stored once under their owner path, so both sides read the same value.
ESO resources in the repo
- Chart
helmfile/apps/common/charts/externalsecretrenders aClusterSecretStoreandExternalSecrets, with support for mixing static values (e.g. usernames) with remote refs. - Release
openbao-store(inhelmfile/apps/common/helmfile-externalsecret.yaml.gotmpl) renders the cluster-scopedClusterSecretStore, gated onsecrets.backend: external. - Per-app release
<app>-externalsecret(in eachhelmfile/apps/<app>/helmfile-child.yaml.gotmpl) renders that app'sExternalSecrets in its namespace, gated onsecrets.backend: externaland the demo environment.
The ClusterSecretStore authenticates with OpenBao using the Kubernetes auth
method (ServiceAccount external-secrets), so ESO and that ServiceAccount/role
must exist in the cluster before enabling external.
What is migrated
| Area | Mechanism |
|---|---|
| CNPG database credentials | cnpg-cluster-credentials chart stops rendering -app / -superuser Secrets; ESO syncs them from <owner>/database and <owner>/database_admin |
| Valkey | auth.usersExistingSecret: <app>-valkey-auth (key default) |
| Object store | auth.existingSecret: <app>-seaweedfs (keys access-key, secret-key) |
Not yet migrated
The following are still on the derived model (and still require
MIJNBUREAU_MASTER_PASSWORD) even when secrets.backend: external:
-
Application-level secrets of the Django/LaSuite apps — admin/superuser passwords, Django
SECRET_KEYs, OIDC client secrets, Fernet keys, and the composed connection strings (REDIS_URL,CELERY_BROKER_URL) rendered into the per-appSecret(e.g.drive,messages,calendars). These contain values ESO cannot build from a single remote ref (they mix a secret with host/port/config), so they need per-app runtime composition rather than a flag flip. -
External provider credentials — the six values that cannot be randomly generated are written by the generator as placeholders and must be replaced with real values:
kv/mijnbureau/<env>/ai/llm_apiKeykv/mijnbureau/<env>/ai/whisperx_apiKeykv/mijnbureau/<env>/ai/ocr_apiKeykv/mijnbureau/<env>/livekit/meet_apiKeykv/mijnbureau/<env>/livekit/meet_apiSecretkv/mijnbureau/<env>/smtp/passwordOverwrite them with:
bao kv patch kv/mijnbureau/<env>/<owner> <key>=<real-value>
Note:
MIJNBUREAU_MASTER_PASSWORDis still required at render time even inexternalmode, because the not-yet-migrated derived values are still computed. It is ignored for the migrated infra secrets. Once the app-level secrets are migrated too, the master password can be dropped entirely.