etcd
etcd is an open-source, distributed, strongly consistent key-value store used to store critical configuration data and coordinate distributed systems, most notably serving as the primary datastore for Kubernetes cluster state.
Definition
etcd is an open-source, distributed, strongly consistent key-value store used to store critical configuration data and coordinate distributed systems, most notably serving as the primary datastore for Kubernetes cluster state.
Overview
etcd was built by CoreOS to solve a specific problem: distributed systems need a reliable place to store small amounts of configuration and coordination data that every node can trust, even during network partitions or node failures. It achieves this using the Raft Consensus algorithm, where a cluster of etcd nodes elects a leader and replicates every write to a majority of nodes before acknowledging it, guaranteeing strong consistency. etcd exposes a simple key-value API over gRPC, with support for watches that let clients subscribe to changes on a key or key range, and leases that automatically expire keys after a timeout, which is useful for service discovery and leader election patterns. These primitives make etcd well suited for storing service registry entries, feature flags, and locks in addition to raw configuration values. Its most consequential use is as the backing store for Kubernetes, which persists the entire desired and observed state of a cluster, including pods, deployments, and secrets, in etcd. Because every control-plane component reads from and writes to etcd, its availability and performance directly determine the health of the cluster it supports, making etcd operations — from proper hardware provisioning to regular backups — an important part of running Kubernetes reliably, a topic covered in the Kubernetes course.
Key Features
- Strongly consistent replication via the Raft consensus algorithm
- Simple key-value data model with a gRPC-based API
- Watch mechanism for subscribing to real-time key changes
- Lease-based key expiration for coordination and service discovery
- Multi-version concurrency control for consistent historical reads
- Built-in support for distributed locks and leader election
- Serves as the primary datastore for Kubernetes cluster state