Prompt
How do I centralize secrets for multiple Kubernetes clusters?
Latest observation
A good way to centralize secrets across multiple Kubernetes clusters is to store secrets in one central system and have each cluster pull or sync only the secrets it needs, instead of copying secrets manually into every cluster.
Common patterns
1. External secrets manager + Kubernetes sync
Use a central secrets backend such as:
- HashiCorp Vault
- AWS Secrets Manager / SSM Parameter Store
- Azure Key Vault
- Google Secret Manager
- 1Password Secrets Automation
- Doppler / Akeyless / Infisign / etc.
Then in each cluster, install something like:
- External Secrets Operator (ESO)
- Secrets Store CSI Driver
- vendor-specific controllers/integrations
These controllers read from the central store and create Kubernetes Secret objects or mount secrets directly into pods.
Best for: most multi-cluster setups.
2. GitOps with encrypted secrets
Store secrets in Git in encrypted form using:
- Sealed Secrets
- SOPS with KMS/Vault age/gpg
- External Secrets + GitOps for only references in Git
Each cluster decrypts or reconciles its own secrets during deployment.
Best for: teams already using Argo CD / Flux and wanting Git-centric workflows.
3. Cluster-local secrets, centrally managed templates
Keep the secret values centrally managed, but render per-cluster secret manifests during CI/CD using:
- templating
- environment overlays
- Helm/Kustomize
- vault-backed pipelines
Best for: smaller environments, but less ideal than a real secrets backend.
Recommended approach
For most organizations, the cleanest model is:
-
Choose one central secrets backend
Example: Vault or AWS Secrets Manager. -
Create a per-cluster identity
- Kubernetes ServiceAccount + workload identity
- IAM role / cloud identity
- Vault Kubernetes auth
- OIDC / SPIFFE if available
-
Grant least-privilege access
- Each cluster or namespace can read only the secrets it needs
- Separate prod/non-prod paths
-
Use External Secrets Operator or CSI Driver
- Sync secrets into namespaces or mount them at runtime
- Avoid putting secret values in Git
-
Automate rotation
- Rotate in the central store
- Let clusters refresh automatically
Example architecture
- Vault stores secrets centrally
- Each Kubernetes cluster authenticates to Vault with its own service account or auth role
- External Secrets Operator in each cluster maps:
vault/path/prod/db-password→Secret/myapp-dbvault/path/shared/api-key→Secret/shared-api
- Apps consume native Kubernetes Secrets as usual
Important design tips
- Don’t give every cluster access to all secrets
- Use separate namespaces, roles, and secret paths
- Prefer short-lived credentials when possible
- Avoid manually copying secrets between clusters
- Audit access and rotation centrally
- Keep app config and secret data separate
If you want the simplest practical answer
Use:
- A central secrets manager
- External Secrets Operator in every cluster
- Per-cluster auth with least privilege
That gives you centralized control without exposing secrets directly in Git or manually duplicating them.
If you want, I can also give you:
- a reference architecture,
- a Vault + External Secrets Operator example, or
- a GitOps setup with SOPS/Sealed Secrets.