10 Kubernetes Backup Strategies to Protect Data

Ten Kubernetes backup strategies across etcd, API resources and volumes: RPO/RTO, CSI snapshots, consistent DB backups, immutability, restore drills.

Dec 17, 2025 - 14:24
Nov 10, 2026 - 15:08
 0  62
10 Kubernetes Backup Strategies to Protect Data

A sound Kubernetes backup strategy protects three things separately: cluster state in etcd, Kubernetes resources as manifests, and the data in persistent volumes. The ten strategies below cover how to capture each layer, how to make database backups consistent, where to store copies, and how to prove that a restore actually works.

This post is about the plan, not the products. If you are choosing software, read 12 Kubernetes backup tools for enterprise data, and for full-site failover planning see 10 Kubernetes disaster recovery tools. Managed-cloud options are compared in 10 cloud container backup tools. Background on the control plane is in Kubernetes architecture components.

Key takeaways

  • Back up three layers: etcd (self-managed clusters only), API resources, and volume data. Each fails in different ways and restores differently.
  • On managed services such as EKS, AKS and GKE, the provider runs etcd, so your job is resources and volumes.
  • Set RPO and RTO per application first. They decide backup frequency, method and storage location.
  • CSI volume snapshots are fast but live on the same storage system by default. Copy data off-cluster for real protection.
  • Databases need application-consistent backups: use the database's own tool or freeze writes with backup hooks.
  • A backup you have never restored is a hope, not a backup. Schedule restore tests.

The three layers and what protects them

LayerWhat it containsTypical methodRestores well for
etcdEvery API object and cluster stateetcdctl snapshot saveRebuilding the same self-managed control plane
API resourcesDeployments, Services, ConfigMaps, Secrets, CRDsGit (GitOps), Velero resource backupsMoving namespaces, restoring deleted objects, new clusters
Volume dataDatabase files, uploads, queuesCSI snapshots, file-level backup, database dumpsData loss, corruption, ransomware

1. Set RPO and RTO per workload before choosing tools

Recovery point objective (RPO) is how much data you can lose, measured in time. Recovery time objective (RTO) is how long recovery may take. A stateless web front end may have no data RPO at all, because Git holds everything. A payments database may need minutes. Write these down per application, then choose methods that meet them. Teams that skip this step usually back up everything once a night, which is too often for some workloads and far too rare for others.

2. Snapshot etcd on self-managed clusters

If you run your own control plane, for example with kubeadm, etcd holds the whole cluster state. The etcd disaster recovery guide shows the save command:

ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 \
  --cacert=/etc/kubernetes/pki/etcd/ca.crt \
  --cert=/etc/kubernetes/pki/etcd/server.crt \
  --key=/etc/kubernetes/pki/etcd/server.key \
  snapshot save /backup/etcd-$(date +%F-%H%M).db

The certificate paths above are kubeadm defaults; check yours. The same guide restores with etcdutl snapshot restore snapshot.db --data-dir <new-dir>, which creates new data directories. Run snapshots on a schedule and before every upgrade, and copy the files off the control plane nodes. An etcd snapshot restores the cluster to that point in time, which includes rolling back anything created after it, so it is a tool for control plane loss, not for recovering one deleted Deployment.

On EKS, AKS and GKE the provider manages etcd and you cannot snapshot it yourself. Skip this layer and focus on the next two.

3. Treat Git as the backup for declarative resources

If every manifest and Helm values file lives in Git and a GitOps controller such as Argo CD or Flux applies it, you can recreate most resources by pointing the controller at a new cluster. This is the cheapest and most reviewable backup of configuration you can have. It does not cover objects created at runtime (operators often create these), Secrets you keep out of Git, or any volume data. Use it as the base, not the whole plan.

4. Back up live API resources with Velero or similar

A tool such as Velero reads objects through the Kubernetes API and writes them to object storage, so it works on managed clusters too. It captures what Git misses: objects created by controllers, the actual state at backup time, and namespace-level restores. A scheduled backup looks like this:

velero schedule create prod-daily \
  --schedule="0 1 * * *" \
  --include-namespaces payments,orders \
  --ttl 720h0m0s

Scope schedules by namespace or label so restores are small and quick. A whole-cluster restore is rarely what you need during an incident.

5. Use CSI volume snapshots for fast, frequent data copies

Kubernetes supports volume snapshots through the snapshot.storage.k8s.io/v1 API, but, as the Kubernetes volume snapshot docs state, only for CSI drivers, and only those drivers that implement snapshots. A snapshot request looks like this:

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
  name: orders-db-snap
  namespace: orders
spec:
  volumeSnapshotClassName: csi-snapclass
  source:
    persistentVolumeClaimName: data-orders-db-0

Snapshots are quick and cheap to take often, which helps RPO. Their weakness is location: by default they usually live in the same storage system or cloud region as the volume. They protect against accidental deletion and bad writes, not against losing the storage system or the account. Pair them with strategy 7.

6. Make database backups application-consistent

A snapshot of a running database volume is crash-consistent at best: like pulling the power cord. Most databases recover from that, but not always cleanly. Two better options:

  • Use the database's own backup tool, such as pg_dump or physical backups with WAL archiving for PostgreSQL, or a database operator's built-in backup feature. This gives point-in-time recovery when the engine supports it.
  • Quiesce before a snapshot with backup hooks. Velero runs commands in a pod before and after backup through annotations such as pre.hook.backup.velero.io/command and post.hook.backup.velero.io/command, documented on its backup hooks page. A pre hook can flush and lock tables; the post hook releases them.

Our post on how operators automate stateful apps shows why operator-managed databases often have the cleanest backup path.

7. Store copies off-cluster, in another region or account

Apply the 3-2-1 idea: at least three copies of important data, on two kinds of storage, with one copy somewhere else. In cloud terms that means backups in object storage outside the cluster, replicated to a second region, ideally in a separate account with different credentials. If an attacker or a script with cluster admin rights can delete both the workload and its backups, you have one failure domain, not two.

8. Make backups immutable

Ransomware and careless cleanup jobs both delete backups. Write-once storage stops that. On AWS, S3 Object Lock in compliance mode prevents deletion until the retention date; Azure Blob Storage and Google Cloud Storage have their own immutability and retention lock features. Grant the backup tool permission to write, not to delete, and keep retention rules separate from the cluster's credentials. See access logging and Object Lock in S3 for the AWS setup.

9. Protect Secrets and encryption keys alongside data

A restored database is useless if you cannot decrypt it or connect to it. Back up, or reproducibly manage, the things that are easy to forget:

  • Kubernetes Secrets, which Velero stores in its backup files, so protect that bucket like a secret store.
  • Keys held in an external manager such as a cloud KMS or Vault, with their own backup and recovery procedure.
  • Sealed Secrets or SOPS private keys, if you use them. Losing those keys means your Git copies cannot be decrypted.
  • Cluster certificates and kubeconfig files for self-managed clusters.

10. Test restores on a schedule

Run a restore into a scratch cluster or namespace at a regular interval, then check that the application starts and the data is correct. Record how long it took and compare it to the RTO from strategy 1. Typical findings from a first drill: a missing CRD that must be installed before the custom resources, a StorageClass name that differs between clusters, or an image the new cluster cannot pull. Each one is far cheaper to discover on a Tuesday afternoon than during an outage.

velero restore create orders-drill \
  --from-backup prod-daily-<timestamp> \
  --namespace-mappings orders:orders-drill

Putting the strategies together

WorkloadSuggested combination
Stateless web appGit (3) plus scheduled resource backup (4)
Database on a StatefulSetDatabase-native backup (6), CSI snapshots (5), off-site immutable copy (7, 8)
File uploads on a shared volumeVelero file-level or snapshot backup (4, 5), off-site copy (7)
Self-managed control planeetcd snapshots (2) plus everything above for workloads
Any regulated dataAdd immutability (8), key backups (9) and documented drills (10)

For how StatefulSets differ from Deployments in what they store, see StatefulSet vs Deployment.

Writing the backup policy down

A short written policy per cluster turns these strategies into something a new team member can follow during an incident. Keep it next to the runbooks and review it after each restore drill. A useful policy answers these questions:

QuestionExample answer
Which namespaces are in scope?All except kube-system and temporary preview namespaces
What are RPO and RTO per tier?Tier 1 databases: RPO 15 minutes, RTO 1 hour. Tier 2 apps: RPO 24 hours, RTO 4 hours
Which method covers each tier?Tier 1: database-native backup with log archiving plus daily snapshots. Tier 2: nightly Velero backup
Where are copies stored?Object storage in a second region and a separate backup account, with retention lock
How long are backups kept?Daily for 30 days, weekly for 12 weeks, as agreed with compliance owners
Who can delete backups?Nobody from the workload account. Expiry is handled by retention rules only
How often are restores tested?Tier 1 monthly, Tier 2 quarterly, plus after each cluster upgrade

The numbers in the right column are placeholders to show the shape of an answer. Set your own with the application owners, and revisit them when an application's importance changes, for example when an internal tool starts handling customer data.

Monitoring the backups themselves

Backup jobs fail quietly. A credential expires, a bucket policy changes, or a new namespace is never added to a schedule, and nobody notices until a restore is needed. Add the backups to your monitoring like any other service:

  • Alert when the latest successful backup for a schedule is older than the expected interval. Velero exposes Prometheus metrics, including backup success and failure counts, that you can alert on.
  • Alert on partial failures, not only on complete failures. A backup that skipped volumes may still report as finished.
  • Watch for new namespaces or StatefulSets that no schedule covers. A label-based schedule (for example, everything labelled backup=daily) plus an admission policy that requires the label closes that gap.
  • Track backup size over time. A sudden drop often means data was excluded by mistake.
  • For etcd, check that the snapshot file is valid with etcdutl snapshot status before shipping it off the node.

Common mistakes

  • Backing up only etcd on a self-managed cluster. An etcd snapshot holds object definitions, not the data inside persistent volumes. A restored PVC object pointing at a lost disk is still empty.
  • Restoring etcd to fix one deleted object. This rolls back the whole cluster. Use a resource-level restore instead.
  • Keeping backups in the cluster's own account with the same credentials. One compromised admin token can then remove both production and its backups.
  • Ignoring CRD order. Custom resources fail to restore if their CRDs and operators are not present first. Restore CRDs and operators, then the custom resources.
  • Assuming snapshots are application consistent. Without hooks or database-native tools, a snapshot of a busy database can need recovery on startup, and some writes may be lost.
  • Never restoring into a different cluster. StorageClass names, node labels, image pull secrets and ingress classes often differ. Only a cross-cluster drill reveals those gaps.

Learn it on real clusters

etcd backup and restore is part of the Certified Kubernetes Administrator curriculum. Our CKA training covers it with hands-on labs, along with storage, StatefulSets and cluster upgrades. Classes run in Kharadi, Pune and live online across India.

Frequently asked questions

What should a Kubernetes backup include?

Cluster state in etcd for self-managed clusters, Kubernetes API resources such as Deployments, ConfigMaps, Secrets and CRDs, and the data in persistent volumes.

Do I need to back up etcd on EKS, AKS or GKE?

No. The provider manages etcd on these services. Back up your API resources and persistent volume data instead.

Are CSI volume snapshots enough?

Not on their own. They usually stay in the same storage system or region as the volume, so copy data off-cluster to another region or account.

How do I back up a database running in Kubernetes?

Use the database's own backup tool or operator for consistent, point-in-time copies, or quiesce writes with pre and post backup hooks before taking a volume snapshot.

How often should I test Kubernetes restores?

On a regular schedule that matches how critical the workload is, and after major changes such as upgrades. Measure restore time against your RTO.

Is Git enough to back up Kubernetes?

Git covers declarative manifests. It misses runtime-created objects, Secrets kept out of Git, and all persistent volume data.

What is the difference between a backup strategy and a disaster recovery plan?

A backup strategy decides what to copy, how and where. A disaster recovery plan covers bringing services back after a major failure, including failover sites, people and order of operations.

References

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.