Prompt
What should I use for secret rotation in Kubernetes?
Latest observation
For Kubernetes, the best choice depends on what kind of secrets you need to rotate and how much automation you want. In practice, these are the most common good options:
Best options
1. External Secrets Operator + external secret manager
Use this if you want Kubernetes to pull secrets from a dedicated secret store like:
- HashiCorp Vault
- AWS Secrets Manager
- Azure Key Vault
- Google Secret Manager
- 1Password / Doppler / etc.
Why it’s good:
- Rotation happens in the external secret manager
- Kubernetes just syncs the current value
- Easier to centralize auditing and access control
- Good for app credentials, API keys, DB passwords
Typical setup:
- Store secrets in Vault / cloud secret manager
- Rotate them there on a schedule
- External Secrets Operator updates Kubernetes Secrets automatically
2. Vault with dynamic secrets
Use this if you need true automatic rotation and short-lived credentials.
Why it’s good:
- Can generate ephemeral credentials on demand
- Great for databases, cloud creds, TLS certs
- Supports leases and automatic revocation
Best for:
- Database usernames/passwords
- Cloud IAM credentials
- Service-to-service secrets
This is often the most robust solution for rotation.
3. cert-manager for TLS certificates
If the “secret” is a certificate, use cert-manager.
Why it’s good:
- Automates certificate issuance and renewal
- Works with Let’s Encrypt, Vault, cloud CAs, etc.
- Standard solution for K8s TLS cert rotation
What not to rely on
- Manually updating Kubernetes Secrets for rotation at scale
- Storing secrets only in Git without encryption/management
- Base64-encoded Secrets as if they were secure by themselves
Kubernetes Secrets are not a rotation system; they are just a storage mechanism.
Quick recommendations by use case
- General app secrets → External Secrets Operator + AWS Secrets Manager / Vault
- Database credentials → Vault dynamic secrets
- TLS certificates → cert-manager
- Multi-cloud / on-prem → Vault is usually the most flexible
- Simple setup on one cloud → native cloud secret manager + External Secrets Operator
If you want a short answer
Use a real secret manager (Vault or your cloud provider’s secret manager) and sync it into Kubernetes with External Secrets Operator.
For TLS certs, use cert-manager.
If you want, I can also give you:
- a recommended architecture
- a comparison table of Vault vs cloud secret managers
- or a step-by-step setup for your environment.