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