Why it matters

Every K8s cluster runs etcd. Understanding matters for K8s ops and recovery.

Advertisement

The architecture

Key-value store: keys can be hierarchical (paths). Values arbitrary bytes.

Raft consensus: 3 or 5 nodes; leader replicates.

etcd basicsKey-valuehierarchical pathsRaft consensus3 or 5 membersWatchesnotificationsK8s uses etcd for all cluster state; etcd health = K8s health
etcd components.
Advertisement

How it works end to end

Watch API: subscribe to key prefix. Notifications on changes.

Leases: TTL on keys. Used for ephemeral state.

Transactions: compare-and-set on multiple keys atomically.

K8s usage: all K8s objects stored as etcd keys.