Understanding Argo CD Data
Argo CD stores its state in:- Kubernetes etcd: All Application CRDs, AppProjects, and configuration
- Redis: Temporary cache only (can be safely rebuilt)
- Git repositories: Source of truth for application manifests
Redis is used only as a disposable cache and can be safely rebuilt without service disruption.
Backup Procedures
Using argocd admin export
Theargocd admin tool provides built-in export functionality to backup all Argo CD data.
1
Check Argo CD version
Determine your Argo CD version to use the correct Docker image:
2
Configure kubeconfig
Ensure your
~/.kube/config points to your Argo CD cluster:3
Export data to backup
Create a backup file containing all Argo CD resources:For non-default namespace:
What Gets Backed Up
The export includes:- Application definitions
- AppProject configurations
- Repository credentials (encrypted)
- Cluster credentials (encrypted)
- ConfigMaps (argocd-cm, argocd-rbac-cm, etc.)
- Secrets (argocd-secret, repository secrets, cluster secrets)
Automated Backup Strategy
Implement automated backups using a CronJob:Restore Procedures
Restoring from Backup
1
Prepare target cluster
Install Argo CD on the target cluster if not already present:
2
Import backup data
Restore the backup using the import command:For non-default namespace:
3
Verify restoration
Check that applications and configurations are restored:
Alternative Backup Methods
Kubernetes etcd Backup
Since Argo CD data lives in Kubernetes, backing up etcd provides a complete snapshot:Velero Integration
Use Velero for cluster-wide backup including Argo CD:Disaster Recovery Scenarios
Scenario 1: Complete Cluster Loss
Recovery steps for complete cluster failure
Recovery steps for complete cluster failure
- Provision new cluster: Set up a new Kubernetes cluster
- Install Argo CD: Deploy Argo CD fresh installation
- Restore backup: Import the latest backup file
- Verify applications: Check that all applications are present
- Trigger sync: Applications will automatically reconcile with Git
Scenario 2: Corrupted Application State
Recovery steps for corrupted application data
Recovery steps for corrupted application data
- Identify affected applications: Review application health status
- Delete corrupted application: Remove the Application CR
- Restore from backup: Import backup or recreate from Git
- Resync application: Trigger full sync
Scenario 3: Lost Repository Credentials
Recovery steps for lost credentials
Recovery steps for lost credentials
Repository credentials are stored in Kubernetes secrets:
Best Practices
Regular Backups
Schedule automated backups daily or before major changes. Store backups in multiple locations.
Test Restores
Regularly test restore procedures in a non-production environment to verify backup integrity.
Version Compatibility
Use the same Argo CD version for backup and restore operations to avoid compatibility issues.
Secure Storage
Encrypt backup files and store them in secure, access-controlled locations with retention policies.
Backup Retention Policy
Implement a retention strategy:- Daily backups: Retain for 7 days
- Weekly backups: Retain for 4 weeks
- Monthly backups: Retain for 12 months
- Pre-upgrade backups: Retain indefinitely