loading...
Cover image for What is etcd ? Kubernetes bitesize

What is etcd ? Kubernetes bitesize

adipolak profile image Adi Polak ・2 min read

Kubernetes in Bitesize (8 Part Series)

1) What are Kubernetes minions? 2) Kubernetes in Bitesize 3 ... 6 3) What are Kubernetes pods ? 4) Kubernetes Self-Healing Reconciliation Loop 5) Can we extend the Kubernetes API? How? 6) Want to monitor Kubernetes? Start with collecting logs! 7) Define your Kubernetes namespaces now! 8) What is etcd ? Kubernetes bitesize

"etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster of machines. It gracefully handles leader elections during network partitions and can tolerate machine failure, even in the leader node."


In K8s cluster, etcd is part of the master, it stores all its data – its configuration data, its state, and its metadata. Since K8s is a distributed system, it needs a distributed data store like etcd. etcd lets any of the nodes in the Kubernetes cluster read and write data.

It gets more complicated than that since in real-world etcd is deployed as a cluster of its own. The cluster will contain at least 3 nodes for the sake of good replication, durability and high availability.
The nodes communication are handled by the Raft algorithm, watch animation here.

ProTip: use at least 5 nodes for production etcd cluster.

Security is everyone job !!!

Access to etcd is equivalent to root permission in the cluster. Due to the sensitivity of the data, it is recommended to grant permission to only those nodes that require access to etcd clusters.
Make sure to set up firewall rules or use security features by etcd.

Plan for:

  • Securing communication with certificates
  • Limiting access of etcd clusters with authentication

Scale


You will probably won't need more than 5 nodes. Scaling etcd increases availability but reduces performance pretty drastic due to it being strongly consistence. Don't overdo it.

That was "what is etcd in 2 minutes or less".
Enjoyed it? check out the Kubernetes bitesize series.

Kubernetes in Bitesize (8 Part Series)

1) What are Kubernetes minions? 2) Kubernetes in Bitesize 3 ... 6 3) What are Kubernetes pods ? 4) Kubernetes Self-Healing Reconciliation Loop 5) Can we extend the Kubernetes API? How? 6) Want to monitor Kubernetes? Start with collecting logs! 7) Define your Kubernetes namespaces now! 8) What is etcd ? Kubernetes bitesize

Posted on by:

adipolak profile

Adi Polak

@adipolak

1 out of 25 influential women in Software Development according to Apiumhub. I am a software developer who would like to learn more!

Discussion

markdown guide
 

Thanks for writing this series of posts! 🙌

I was curious to learn more about the cluster sizing recommendations (with respect to 3 vs 5 etcd nodes) and found the following FAQ helpful:

github.com/etcd-io/etcd/blob/maste...