Summary
etcd is an open-source distributed key-value store that provides reliable storage for critical data in distributed systems. It is best known as the backing store for all Kubernetes cluster state.
What is etcd?
etcd uses the Raft consensus algorithm to ensure that data is consistent across all nodes in a cluster, even in the presence of network partitions or node failures. Every write is committed only after a quorum of nodes acknowledges it, guaranteeing strong consistency.
In Kubernetes, etcd stores all API objects—pods, services, config maps, secrets, and more. The Kubernetes API server is the only component that communicates directly with etcd; all other components interact through the API server. This makes etcd the single source of truth for the entire cluster.
Beyond Kubernetes, etcd is used for distributed locking, leader election, and service discovery in other distributed systems.
Why is etcd relevant?
- Kubernetes dependency: Kubernetes cannot function without a healthy etcd cluster
- Strong consistency: Raft-based consensus guarantees no data divergence across nodes
- Watch API: Clients can subscribe to key changes in real time, enabling reactive systems
- Operational simplicity: A three- or five-node cluster provides high availability without complex setup