What is etcd and where is it used in k8s: Basics on Kubernetes.

In this series of basics on Kubernetes, today we will talk about etcd and what is its task. In the previous article, we talked about Kube proxy and what was its exact task. You can read the article below.

What is etcd?

etcd is distributed key-value store and it is strongly consistent. etcd works on the concept of leader and slaves. In most of cases it has 3 or 5 nodes for the quorum. It uses raft protocol for leader election. Only one node at a time is serving read and write in the etcd cluster.

etcd provides api to connect to it and perform operations. You can read about the apis here. https://etcd.io/docs/v2.3/api/

etcd is open source and is written in Golang. You can have a look at the project here. https://github.com/etcd-io/etcd

What is the job of etcd in Kubernetes?

etcd acts as a backend to Kubernetes. Everything you create or make changes to is stored as a key-value in etcd. It is like a database of all the states of Kubernetes. If you have launched a Kubernetes with the same etcd backup, you will end up in almost the same state as it was before.

etcd is well protected in Kubernetes and only Kube API server can talk to it. Any other component that wants to interact with etcd has to do through API server.

This was a very small introduction of etcd and where is it used in Kubernetes. If you like the article please share and subscribe.

Gaurav Yadav

Gaurav is cloud infrastructure engineer and a full stack web developer and blogger. Sportsperson by heart and loves football. Scale is something he loves to work for and always keen to learn new tech. Experienced with CI/CD, distributed cloud infrastructure, build systems and lot of SRE Stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.