What is the 'etcd' in Kubernetes?

Kubernetes Fundamental
이민석's avatar
Mar 05, 2024
What is the 'etcd' in Kubernetes?

Introduction

Thank you for clicking through to my arcticle. I've been a DevOps engineer for 2 years in dev-team of 7 engineers.

My name is MINSEOK, LEE, but I use Unchaptered as an alias on the interenet. So, you can call me anythings "MINSEOK, LEE" or "Unchaptered" to ask something.


 

Topic

In this article, I'll cover the following:

  1. What is the 'etcd' in kubernetes?

References

What is the etcd?

  • The etcd is OpenSource Key-Value Storage used to hold and manage the critical information that distributed systems need to keep ruing.

  • The etcd is some kind of backbone network to continuously execute distributed workloads.

Why etcd?

The 6 kind of reason to use etcd in kubernetes or distributed system.

  • Fully Replicated : Every node in an etcd cluster has access the full data store.

  • Highly Available : The etcd designed to have no SPoF(Single Point of Failure) and gracefullly tolerate hardware failures and network partitions.

  • Reliably Consistent : Every data "read" retruns the latest data "write" across all clusters.

  • Fast : The etcd has been benchmarked at 10,000 writes per second.

  • Secure : The etcd supports automatic TLS(Transport Layer Security) and optional SSL(Secure Socket Layer) client certificate authentication.

    • Because the etcd stores vital and highly sensitive configuration data, administartors should implement RBAC(Role Based Access Controls) within etcd are limited to the least-privileged level of access necessary to perform their jobs.

  • Simple : Any application, from simple web apps to highly complex container orchestration engines such as Kubernetes, can read or write data to etcd using standard HTTP/JSON tools.

The algorithm of Raft Consensus Algorithm

seongjin me (blog) | Learn about the Raft Consensus Algorithm and the concept of quorum to make distributed systems more fault tolerant.

In distributed system applied raft consensus algorithm, all nodes have state followings:

  1. Leader
    The representative node for cluster.
    The Leader is responsible for receiving, propagating and responding to all commands sent to cluter by clients.
    The Leader also propagate owned status message(heartbeat) to all followers.

  2. Follower
    The follower process the command, received from leader.

  3. Candidate
    In the absence of the leader, the status of a follower that has been transitioned to determine a new leader.
    Do not received a status message(hearbeat) from the leader for a certain amount of time, follower are switched to candidates.

노드 간 통신 구조 다이어그램 (출처 : ScyllaDB)

Share article

Unchaptered