Cross-cluster DR with Velero — restore to another cluster/region.
Architecture:
Velero setup (primary):
1velero install \2 --provider aws \3 --bucket my-velero-backups \4 --backup-location-config region=us-east-1 \5 --snapshot-location-config region=us-east-1 \6 --use-node-agent
Automatic backup:
1velero schedule create daily-full \2 --schedule="0 2 * * *" \3 --ttl=720h \4 --include-namespaces production \5 --snapshot-volumes=true67velero schedule create hourly-incremental \8 --schedule="0 * * * *" \9 --ttl=168h \10 --include-namespaces production
Restore to DR cluster:
1# Install Velero on DR cluster2velero install \3 --provider aws \4 --bucket my-velero-backups \5 --backup-location-config region=us-east-1 \6 --use-node-agent78# List backups9velero backup get1011# Restore12velero restore create dr-restore-$(date +%Y%m%d) \13 --from-backup daily-full-20240115020000 \14 --namespace-mappings production:production-dr \15 --restore-volumes=true1617# Monitoring18velero restore get19velero restore logs dr-restore-20240115
Post-restore:
1# Update DNS on DR2aws route53 change-resource-record-sets \3 --hosted-zone-id Z123 \4 --change-batch file://dns-failover.json56# Verification7kubectl get pods -n production-dr8kubectl get svc -n production-dr9curl -H "Host: myapp.com" http://dr-endpoint/myapp.com/health
Velero Plugins:
DR Testing (monthly):
1# 1. Restore to test namespace2velero restore create dr-test \3 --from-backup daily-full-latest \4 --namespace-mappings production:dr-test56# 2. Verify7kubectl get pods -n dr-test8kubectl exec -n dr-test deploy/myapp -- curl localhost:8080/health910# 3. Cleanup11kubectl delete namespace dr-test
RPO/RTO: RPO = frequency of backups (hourly). RTO = time to restore + DNS propagation (30-60 min).