How do you back up a Kubernetes cluster?
IntermediateConceptBackup, DR, Runbooks & SRE Metrics
Answer
- Declarative state: keep manifests in Git (GitOps), so the cluster can be rebuilt by re-syncing Argo CD or Flux.
- etcd snapshots for self-managed control planes:
etcdctl snapshot save /backup/etcd-$(date +%F).db. - Velero for namespaced resources and persistent volumes (via snapshots or file-level backup with Kopia):
velero backup create shop-daily --include-namespaces shop --ttl 720h
velero schedule create shop-nightly --schedule "0 2 * * *" --include-namespaces shop
velero restore create --from-backup shop-daily
- Databases: use database-native backups (pg_dump, WAL archiving, RDS snapshots), not just volume snapshots, for consistency.