kubernetes
etcd Backup Size Estimator
Estimate the size of etcd snapshots and monthly backup storage for your Kubernetes cluster. Plan S3 storage costs for etcd backup retention.
Related tool
K8s Cluster Cost
Calculate the monthly cost of running a self-managed Kubernetes cluster on Hetzner Cloud, Vultr, or DigitalOcean. Choose server types for control planes, workers, and load balancers with HA mode.
etcd Backup Strategy for Kubernetes
etcd is the only stateful component of a Kubernetes cluster. Losing etcd data = losing the cluster. All other K8s components are stateless and rebuild from etcd on restart.
What etcd Contains
- ›All Kubernetes objects: Deployments, Services, ConfigMaps, Secrets, PVCs, etc.
- ›Cluster state: node registrations, pod scheduling decisions
- ›RBAC: roles, bindings, service accounts
- ›Custom Resource Definitions and their instances
It does NOT contain: actual container images, PVC data (that's in Longhorn/NFS/etc), application state.
Snapshot Size Factors
etcd snapshot size = objects × avg size × 1.4 (B-tree overhead) + 20 MB (etcd metadata)
Secrets inflate snapshots significantly — base64-encoded TLS certs can be 10–50 KB each. If you have many TLS secrets (cert-manager, wildcard certs per namespace), your snapshot will be larger than expected.
Automated Backup Setup
# CronJob to back up etcd daily to S3
0 2 * * * /usr/local/bin/etcd-backup.shThe script should:
- 1.Take snapshot to local disk
- 2.Verify snapshot (etcdctl snapshot status)
- 3.Upload to S3 with date-stamped filename
- 4.Delete local file
- 5.Prune old S3 objects beyond retention window
Restore Process
- 1.Stop API server (remove /etc/kubernetes/manifests/kube-apiserver.yaml)
- 2.Restore snapshot:
etcdctl snapshot restore backup.db --data-dir /var/lib/etcd - 3.Restart etcd and API server
- 4.Verify:
kubectl get nodes
Worked example: etcd Backup Size
What the calculator returns for its default inputs — change any value in the form above to recalculate.
| Input | Value |
|---|---|
| Kubernetes Object Count | 1000 |
| Average Object Size | 5 KB |
| Backups per Day | 1 /day |
| Retention Period | 7 days |
| Result | Value |
|---|---|
| Estimated snapshot size | 27 MB |
| Monthly backup storage | 0.8 GB |
| Retention storage needed | 0.2 GB |
| Backups per month | 30 |
| S3 cost / month | $0.00 |
| etcd quota status | OK — well within the etcd default 2 GiB quota |
How the calculation works
- ›Snapshot size ≈ objects × average object size × 1.4 (etcd keeps revisions and metadata) + 20 MB.
- ›Retention storage = snapshot size × backups per day × retention days — what your bucket holds at any time.
- ›S3 cost = retention storage × $0.023 per GB-month (AWS S3 Standard list price; S3-compatible providers are usually cheaper).
- ›Quota check: etcd's default database quota is 2 GiB (
--quota-backend-bytes), and 8 GiB is the commonly recommended maximum. A snapshot close to the quota means the database needs compaction/defragmentation or a higher quota.
Take snapshots with etcdctl snapshot save (kubeadm clusters) and verify them with etcdutl snapshot status — an untested backup is not a backup.
Key Terms
Full glossary →etcd
A distributed key-value store used by Kubernetes to store all cluster state and configuration. etcd is the single source of truth for the entire cluster.
kubeadm
A tool for bootstrapping Kubernetes clusters. It automates the setup of control plane components and joining worker nodes, following Kubernetes best practices.
Temporal
A durable workflow orchestration platform. Temporal persists workflow state in a database (PostgreSQL or Cassandra), enabling long-running, fault-tolerant business processes to survive process restarts.
Frequently Asked Questions
How do I take an etcd snapshot?
Run: `ETCDCTL_API=3 etcdctl snapshot save /backup/etcd-$(date +%Y%m%d).db --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt --key=/etc/kubernetes/pki/etcd/healthcheck-client.key`. Store the snapshot file in S3 for offsite backup.
What is the etcd default database size limit?
etcd defaults to a 2 GB storage quota (--quota-backend-bytes). Kubernetes clusters almost always raise this — 8 GB is the commonly recommended upper bound for production. If your database exceeds its quota, etcd goes read-only and the cluster becomes unable to schedule new pods. Keep etcd snapshots well below your configured quota and monitor with the `etcd_mvcc_db_total_size_in_bytes` metric.
How often should I back up etcd?
At minimum, once daily. For production clusters: every 4–6 hours. For clusters with active CI/CD pipelines deploying frequently: hourly. Store at least 7 days of backups. Always test restores — a backup you've never tested is not a backup.
Can I store etcd backups in Hetzner Object Storage?
Yes. Hetzner Object Storage is S3-compatible. Configure your backup script to upload to Hetzner's S3 endpoint. Pricing is €0.0119/GB/month — a 500 MB snapshot stored for 7 days costs less than €0.01/month.
Related Tools
K8s Cluster Cost
Calculate the monthly cost of running a self-managed Kubernetes cluster on Hetzner Cloud, Vultr, or DigitalOcean. Choose server types for control planes, workers, and load balancers with HA mode.
Longhorn Storage
Calculate the total storage required for Longhorn distributed block storage, including replica overhead, snapshot retention, and S3 backup sizing on Hetzner Object Storage.
Cert Expiry
Calculate when your Kubernetes certificates expire and whether you need to renew them. kubeadm certificates are valid for 1 year — missing renewal breaks the cluster.
Observability Sizing
Size your Prometheus, Grafana, Loki, and Alertmanager stack. Calculate RAM, disk, and CPU requirements based on your cluster size and retention period.
Related Generators
Related Comparisons
Related Guides
storage
Longhorn vs Rook/Ceph for Kubernetes Storage: Which Should You Use?
A practical comparison of Longhorn and Rook/Ceph for self-hosted Kubernetes storage — setup complexity, resource usage, performance, and when each is the right choice.
kubernetes
etcd: What It Is, Why It Matters, and How to Back It Up
A practical guide to etcd in Kubernetes — what it stores, what happens when it fails, how to take and restore snapshots, and how to automate backups with a CronJob.
kubernetes
CI/CD for Kubernetes with GitHub Actions: A Complete Guide (2026)
A practical walkthrough of building a full GitHub Actions pipeline that builds a container image, pushes it to a registry, and deploys to Kubernetes — with secrets handling, rollback, and Helm support.