Managing Secrets in Argocd: Practical Patterns and Pitfalls
Use external secret managers with ArgoCD SyncWaves and GitOps tooling to securely manage secrets at scale.
Use external secret managers with ArgoCD SyncWaves and GitOps tooling to securely manage secrets at scale.
Secrets management in ArgoCD is a production-critical problem. Missteps here lead to downtime, security incidents, or compliance failures. Here’s how I’ve handled it across multiple environments, with a focus on reliability and auditability.
Actionable Workflow
-
Externalize secrets
- Never store secrets in Git. Use HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault.
- Inject secrets into clusters via ArgoCD SyncWaves or the External Secrets Operator (ESO).
-
Sync secrets declaratively
- Define secret references in ArgoCD applications using
project-sync-policyandsync-waveannotations. - Example:
annotations: argoproj.io/sync-wave: "2" external-secrets/managed: "true"
- Define secret references in ArgoCD applications using
-
Automate rotation
- Use Vault’s dynamic secrets or cloud provider APIs to rotate credentials on a schedule.
- Monitor rotation failures via alerts (e.g., Prometheus + Alertmanager).
-
Audit access
- Enable ArgoCD audit logging and integrate with SIEM tools (e.g., Splunk, ELK).
- Regularly review who synced what secrets and when.
Policy Example
Enforce secret sourcing and encryption:
# SyncWave policy snippet
syncWave:
- name: vault-secrets
annotationMatch:
- key: external-secrets/managed
value: "true"
dependency:
- name: base-infrastructure
actions:
- get:
- secret
- create:
- secret
Caveat: SyncWaves add complexity. Misconfigured dependencies can cause sync deadlocks. Test policies in staging first.
Tooling
- ArgoCD SyncWaves: Native support for staged secret synchronization.
- HashiCorp Vault: Centralized secret management with Kubernetes auth.
- External Secrets Operator (ESO): Simplifies cloud-native secret syncing.
- Sealed Secrets: For edge cases where external managers aren’t viable (but avoid if possible—keys are hard to manage at scale).
Tradeoff: External secret managers add latency and operational overhead. For low-risk environments, Sealed Secrets might be simpler.
Troubleshooting
Common failures:
-
Missing annotations:
- Check ArgoCD app manifest for
argoproj.io/sync-waveand secret source annotations. - Command:
kubectl describe app <app-name> -n argocd.
- Check ArgoCD app manifest for
-
SyncWave stalls:
- Look for dependency loops or missing resources in earlier sync waves.
- Command:
kubectl get syncwaves -n argocd --watch.
-
Permission errors:
- Ensure service account has RBAC access to secret manager (e.g., Vault token permissions).
- Check logs:
kubectl logs -l app.kubernetes.io/part-of=argocd -n argocd.
-
Expired certificates:
- Rotate TLS certs for secret managers and update ArgoCD’s trust store.
Final Notes
There’s no one-size-fits-all. Start with the simplest solution that meets your compliance needs (e.g., ESO + cloud KMS), then layer in SyncWaves for advanced use cases. Always assume secrets will leak—design for fast rotation and least privilege.
Source thread: How do you guys manage secrets in ArgoCD?

Share this post
Twitter
Google+
Facebook
Reddit
LinkedIn
StumbleUpon
Pinterest
Email