Disaster Recovery in the Age of Kubernetes
Stateless apps are easy. Stateful apps are hard. Using Velero for backup/restore and GitOps for rapid cluster recreation.
When Everything Goes Wrong
Disaster Recovery (DR) is not about backups; it's about RTO (Recovery Time Objective) and RPO (Recovery Point Objective).
1. Stateless Recovery: GitOps
If you lose your cluster, you should be able to provision a new one and run:
argocd app sync all
ArgoCD (GitOps) ensures your cluster state matches Git. This covers Deployment, Service, ConfigMap.
2. Stateful Recovery: Velero
For PersistentVolumes (PVs), you need snapshots. Velero integrates with AWS S3 / Azure Blob to snapshot disks.
velero backup create disaster-recovery-backup --include-namespaces=production
3. Multi-Cluster Architecture
Active-Passive vs Active-Active.
- Active-Passive: Cheaper, higher failover time.
- Active-Active: Complex data sync required (e.g., CockroachDB, Kafka MirrorMaker).
Strategy: Test your DR plan. If you haven't restored from backup, you don't have a backup.