DEV Community

Cover image for What is etcd ? Kubernetes bitesize
Adi Polak
Adi Polak

Posted on

22 7

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.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (1)

Collapse
 
downey profile image
Tim Downey

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...

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay