Secret Types
The operator supports five secret types:| Secret Field | Required Keys | Purpose |
|---|---|---|
authSecret | password | Redis authentication |
aclConfigSecret | acl | ACL user rules |
tlsSecret | tls.crt, tls.key | TLS encryption |
caSecret | ca.crt | Client cert verification |
backupCredentialsSecret | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY (S3) or GOOGLE_APPLICATION_CREDENTIALS (GCS) | Backup storage |
Auto-Generated Auth Secret
Ifspec.authSecret is not specified, the operator auto-generates a secret with a random password.
Implementation (internal/controller/cluster/secrets.go:78-117):
Projected Volumes
All secrets are mounted into pods as a single projected volume at/projected.
Why projected volumes?
- Atomic updates (all-or-nothing)
- No environment variable leakage in logs/dumps
- Supports secret rotation without pod restart
internal/controller/cluster/pods.go:189-216):
Secret Rotation
The operator tracks secretResourceVersion to detect changes and trigger reconciliation.
Status Tracking
status.secretsResourceVersion maps secret names to their current ResourceVersion:
internal/controller/cluster/secrets.go:19-76):
Rotation Workflow
-
Update the secret:
-
Operator detects change:
- Reconciliation triggered by secret watch
reconcileSecrets()comparesResourceVersion- Event emitted:
SecretRotated
-
Projected volume updated:
- Kubelet updates
/projected/*files (eventually consistent, ~1 minute) - Instance manager detects file changes via filesystem watch
- New password applied via
CONFIG SET requirepass
- Kubelet updates
-
Verify rotation:
ACL Rotation
ACL rotation is live (no pod restart required):-
Update
aclConfigSecret: -
Instance manager detects
/projected/aclchange -
Runs
ACL LOADto reload rules - No connection interruption
TLS Rotation
TLS rotation requires pod restart (Redis limitation):-
Update
tlsSecret: - Operator detects rotation
- Rolling update triggered (replicas first, then primary)
- Each pod restarts with new TLS config
Secret Examples
Auth Secret
ACL Config Secret
admin:
TLS Certificates
Generate self-signed cert (testing only):Client CA Certificate
Backup Credentials (S3)
Backup Credentials (GCS)
Best Practices
Use external secret management
Integrate with External Secrets Operator:Rotate secrets regularly
Automate rotation with a CronJob:Never commit secrets to Git
Use sealed secrets or SOPS for GitOps:Principle of least privilege
Create separate auth secrets per application:Troubleshooting
Secret not found error
Symptom:Projected volume not updating
Symptom: Updated secret but pods still use old value. Cause: Kubelet caches projected volumes (update latency ~60s). Debug:Wrong secret key name
Symptom: Instance manager fails to start. Cause: Secret uses wrong key name (e.g.,pass instead of password).
Solution: Ensure exact key names:
authSecret→passwordaclConfigSecret→acltlsSecret→tls.crt,tls.keycaSecret→ca.crt