GitOps Best Practices and Production Lessons
What I Learned Running GitOps in Production
The Incident That Taught Me About Secrets
# DO NOT DO THIS!
apiVersion: v1
kind: Secret
metadata:
name: db-secret
stringData:
password: "SuperSecret123!" # ← Visible in Git history!Secret Management
DON'T: Store Secrets in Git
DO: Use Sealed Secrets
Install Sealed Secrets Controller
Install kubeseal CLI
Create and Seal Secret
DO: Use External Secrets Operator
Install External Secrets Operator
Configure SecretStore (AWS Example)
Create ExternalSecret
Disaster Recovery
Backup Strategy
Backup ArgoCD Configuration
Automated Backup with CronJob
Disaster Recovery Procedure
Monitoring ArgoCD
Prometheus Metrics
Scrape Configuration
Key Metrics to Monitor
Grafana Dashboard
Alerting Rules
Troubleshooting Common Issues
Issue 1: Application Stuck in Progressing
Issue 2: Sync Takes Too Long
Issue 3: Out of Sync but Looks Identical
Issue 4: Secret Sync Failures
Production Checklist
Pre-Production
Application Setup
Ongoing Operations
Cost Optimization
ArgoCD Resource Tuning
Application Controller Tuning
Repo Server Caching
Security Best Practices
1. Least Privilege RBAC
2. Network Policies
3. Git Repository Protection
4. Secret Scanning
Performance Tuning
Large-Scale Deployments (200+ Apps)
Key Takeaways
Final Thoughts
Last updated