Use it when the control plane is slow or unavailable, or for backup and restore.
etcd
etcd is the consistent key-value store holding all Kubernetes state, run as a Raft cluster (usually 3 or 5 members).
1. etcdctl endpoint health --cluster (with certs).
2. etcdctl endpoint status -w table — leader, DB size.
3. Disk latency (wal_fsync metrics).
4. Snapshot: etcdctl snapshot save /backup/etcd.db.
5. Defragment when DB grows.
API server → etcd leader → Raft replication → committed
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 How to verify Verify boundary
Check that all members are healthy and one leader exists. Watch fsync and commit latency metrics. Restore a snapshot into a test cluster to show the backup works.
Step 2 Common failures Narrow the fault
An even member count adds no fault tolerance. Exceeding the database quota raises a NOSPACE alarm and blocks writes. Slow disks cause leader elections and API timeouts.
Quorum needs a majority of members. Back up with etcdctl snapshot save regularly. Slow disks (fsync latency) make the whole cluster slow.
etcdctl endpoint health --cluster— first check for this topickubectl get pods -o wide— pods, status, node, IPkubectl describe pod <pod>— events and conditionskubectl logs <pod> [-c <c>] [--previous]— container logs (incl. previous crash)kubectl get events --sort-by=.lastTimestamp— recent cluster events
ReferenceWhat it is1 section · depth on demand
How it works
etcd uses the Raft protocol: one leader accepts writes and replicates them to followers; a write is committed when a majority stores it. Compaction and defragmentation keep the database size under its quota.
ReferenceImportant terms & boundaries3 sections · depth on demand
Operating etcd
ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert=ca.crt --cert=server.crt --key=server.key endpoint health
etcdctl member list
etcdctl snapshot save /backup/etcd-$(date +%F).db
etcdctl defrag
Documented example, not captured output. Run 3 or 5 members on fast SSDs with low latency; back up snapshots regularly (they contain Secrets — encrypt them). The default space quota is 2 GB; exceeding it makes the cluster read-only (alarm NOSPACE).
In depth
etcd stores every Kubernetes object. It is a Raft cluster: a write is committed when a majority (quorum) of members has persisted it.
Fault tolerance by member count
| Members | Quorum | Failures tolerated |
|---|---|---|
| 1 | 1 | 0 |
| 3 | 2 | 1 |
| 4 | 3 | 1 |
| 5 | 3 | 2 |
An even number adds cost and latency but no extra tolerance.
Backup and restore
etcdctl snapshot save /backup/etcd-$(date +%F).db # with --endpoints, --cacert, --cert, --key
etcdutl snapshot status /backup/etcd-2026-11-27.db -w table
etcdutl snapshot restore /backup/etcd-2026-11-27.db --data-dir /var/lib/etcd-restore
A restore creates a new cluster from the snapshot; point the etcd static Pod (or service) at the new data directory on every member, and restore all members from the same snapshot.
Signals of an unhealthy cluster
| Signal | Meaning |
|---|---|
etcd_server_leader_changes_seen_total rising | Leader elections — usually slow disk or network |
etcd_disk_wal_fsync_duration_seconds p99 > ~10 ms | Disk too slow for etcd |
alarm:NOSPACE | Database exceeded its quota; writes rejected |
After clearing space: etcdctl compact <rev>, etcdctl defrag on each member, then etcdctl alarm disarm. Put etcd on SSDs and keep it away from noisy disks.
Common mistakes
- etcd without backups.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.