
etcd Has a Free API — The Distributed Key-Value Store Behind Kubernetes
etcd is the distributed key-value store that powers Kubernetes. Every K8s cluster uses etcd to store its entire state — pods, services, configs, secrets. But etcd is useful far beyond Kubernetes. Free, open source, CNCF graduated. Used by CoreDNS, Rook, and M3. Why Use etcd? Strong consistency — Raft consensus, linearizable reads Watch mechanism — real-time notifications on key changes Distributed locking — leader election and mutual exclusion TTL keys — auto-expiring entries for service discovery gRPC + HTTP — both protocols supported Quick Setup 1. Install # Docker docker run -d -p 2379:2379 -p 2380:2380 --name etcd \ quay.io/coreos/etcd:v3.5.12 \ /usr/local/bin/etcd --advertise-client-urls http://0.0.0.0:2379 --listen-client-urls http://0.0.0.0:2379 # Install etcdctl brew install etcd 2. Basic Key-Value Operations # PUT etcdctl put mykey "hello world" curl -s -X POST http://localhost:2379/v3/kv/put \ -d '{"key": "' $( echo -n mykey | base64 ) '", "value": "' $( echo -n "hello world"
Continue reading on Dev.to DevOps
Opens in a new tab


