Use Secrets in a cluster

Keep Kubernetes Secrets in step with {{product}} Secrets through the External Secrets add-on, with no key stored in the cluster.

Last updated 24 November 2026View as Markdown

Replace my-cluster with your cluster's name or id, DB_URL with a secret of yours and shop with a namespace.

The external-secrets add-on runs the External Secrets Operator. Each store in its options becomes a ClusterSecretStore. An ExternalSecret in the cluster names a secret; the operator reads it from Deutsche Cloud Secrets, writes a Kubernetes Secret and refreshes it.

  • The cluster holds no Deutsche Cloud credential. The operator proves itself with its service-account token, and Deutsche Cloud answers only for the secrets the store lists.
  • A store lists secret names (DB_URL) or name prefixes (PAYMENTS_*); never every secret.
  • With environment, a name means that environment's secret, else the shared one. Without it, shared secrets only.
  • With namespaces, only ExternalSecrets in those namespaces may use the store.
  • Every read is in the secret's access log, with the cluster as the reader, and in the audit log as secrets:GetSecretValue.

Prerequisites

  • Permission for eks:CreateAddon on the cluster. In the console, also eks:DescribeCluster to open the cluster.
  • secrets:GetSecretValue on every secret a store names, or on every secret (secret/*) for a PREFIX_* entry: a prefix also reaches secrets created later.

Install the add-on

  1. Open Kubernetes, open the cluster, then choose Add-ons.
  2. Choose Add an add-on, then External Secrets.
  3. Name the store, list its secrets, and choose an environment and namespaces if you want.
  4. Choose Install.

Sync a secret into a namespace

apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: db
  namespace: shop
spec:
  refreshInterval: 1h
  secretStoreRef: { kind: ClusterSecretStore, name: ews }
  target: { name: db }
  data:
    - secretKey: url
      remoteRef: { key: DB_URL }

kubectl get secret db -n shop shows the Secret once the operator has read it. A secret whose value is JSON can be split into keys with dataFrom: [{ extract: { key: NAME } }].

Keep refreshInterval at an hour or more unless a value changes often: each refresh is a read in the secret's access log. A store answers at most 600 reads a minute per cluster.

Change or remove

Changing the stores (Change in the console, dcloud eks addons update) needs secrets:GetSecretValue on what the new stores name. Removing the add-on deletes the operator and the stores; the Kubernetes Secrets it wrote stay until you delete them.

Did this page help you?