What does etcd do?

Knowledge Videos

Short animated explainers, organised by subject.

What does etcd do?

etcd as the Kubernetes database: keys, leader election, Raft quorum, watches and backups.

Transcript

etcd is the database of Kubernetes: every object, from pods to secrets, is stored there.

It is a key-value store: each object lives under a key, built from its type, namespace and name.

Several etcd members form a cluster and elect a leader. Only the leader accepts writes.

A write is committed once a majority of members have it. This is the Raft algorithm.

That is why clusters run three or five members. With three, one can fail and the cluster still has a quorum.

Clients can watch a key, and etcd pushes every change. That is how the scheduler, controllers and kubelets react in real time.

Lose etcd without a backup, and you lose the cluster state. So take regular snapshots.

Store. Agree. Watch.

More in this series