The secrets-store add-on mounts fields of your Secrets into pods as files. It runs the
Kubernetes Secrets Store CSI Driver with an EZGH provider, and reads each secret as the pod’s bot,
through pod identity. No API key is stored in the cluster.
Set it up
-
Add the add-on:
ezgh kubernetes addons create secrets-store --cluster kcl_3k9d0a1m2x7q --wait -
Give the pod’s service account a pod identity association with a bot that can read the secret (
secrets.versions.accesson it, or a grant). -
Create a
SecretProviderClasswith providerezghnaming the secrets and fields to mount, and mount it in the pod as a CSI volume with driversecrets-store.csi.k8s.io:apiVersion: secrets-store.csi.x-k8s.io/v1 kind: SecretProviderClass metadata: name: checkout namespace: shop spec: provider: ezgh parameters: objects: | - secret: stripe field: apiKey - secret: sec_6v2b8n4m1c3x path: database --- apiVersion: v1 kind: Pod metadata: name: checkout namespace: shop spec: serviceAccountName: checkout containers: - name: app image: shop/checkout:1.4 volumeMounts: - name: secrets mountPath: /mnt/secrets readOnly: true volumes: - name: secrets csi: driver: secrets-store.csi.k8s.io readOnly: true volumeAttributes: secretProviderClass: checkout
Each entry of objects:
| Field | |
|---|---|
secret |
The secret, by ID (sec_…) or name. Required |
version |
A version number. Default the latest |
field |
One field to mount. Left out, every field of the secret, each a file named after it |
path |
The file a field is written to (default the field’s name), or the directory every field is written under |
parameters.project reads the secrets from another project (prj_…); by default they’re read from
the cluster’s.
Rotation
The add-on reads each mounted secret again every 10 minutes and updates the files when a new version
is current. Applications that read the file again see the new value. Each read is a billed Secrets read;
the add-on’s rotationPollInterval configuration (at least 1m, for example 30m or 1h) changes how
often.