Velero로 백업하는 걸 해보고 나니까 몇 가지 궁금한 게 생겨서 귀염둥이 지피티쟝에게 물어봤다.

How etcd works in Amazon EKS?

Amazon EKS (Elastic Kubernetes Service) uses etcd as the primary data store for Kubernetes cluster data, including information about nodes, pods, services, and other resources. etcd is a distributed key-value store that is designed to be highly available, fault-tolerant, and consistent.

In Amazon EKS, etcd is deployed as a StatefulSet, which provides a stable network identity and persistent storage for the etcd nodes. etcd is typically deployed as a three-node cluster to ensure high availability, but you can configure it to use a different number of nodes if needed.

When you create an EKS cluster, the Kubernetes API server is automatically configured to use the etcd cluster for data storage. The etcd nodes communicate with each other using the Raft consensus algorithm to ensure that data is replicated across all nodes and that updates are made in a consistent and fault-tolerant manner.

In addition to the primary etcd cluster, Amazon EKS also uses a snapshot agent to periodically back up the etcd data to an Amazon S3 bucket. This provides a way to restore the etcd data in case of a disaster or other data loss event.

Overall, etcd is a critical component of the Amazon EKS control plane, providing a reliable and consistent data store for Kubernetes cluster data. By using etcd, Amazon EKS can provide a highly available and scalable Kubernetes control plane that can support a wide range of workloads and applications.

EKS는 etcd를 k8s 클러스터 데이터를 저장하기 위한 기본 데이터 저장소 primary data store로 쓴다. 여기서 k8s 클러스터 데이터에는 node, pod, svc 등 resource에 대한 정보가 포함된다. etcd는 고가용성(HA; High Availability), *fault-tolerance, 일관성을 위해 설계된 분산형 key-value 저장소다.

EKS에서 etcd는 StatefulSet으로 deploy되며 etcd 노드에 대한 안정적인 **네트워크 식별자, *******persistent storage**를 제공한다. etcd는 보통 3개의 etcd 노드로 구성된 클러스터 형태로 배포된다. 이는 고가용성을 확보하기 위한 구조이며, 클러스터 내 etcd 노드 갯수를 필요 시 변경할 수 있다.

EKS 클러스터를 형성할 때 k8s API server는 자동으로 데이터 저장소로 etcd를 쓰도록 구성된다. etcd 노드들은 데이터가 모든 노드에 대해 falut-tolerant하고 일관성 있게 복제 및 수정되도록 Raft 알고리즘에 의해 communicate한다.

EKS는 etcd 클러스터와 더불어 snapshot agent를 사용한다. snapshot agent는 정기적으로 etcd 데이터를 Amazon S3 bucket에 백업해 etcd 데이터를 재해나 그 밖에 데이터 손실이 일어날 수 있는 경우로부터 복구할 수 있도록 한다.

etcd는 EKS control plane에서 매우 중요한 컴포넌트로, k8s 클러스터 데이터에 대한 신뢰할 수 있고 일관적인 데이터 저장소를 제공한다. etcd를 사용함으로써 EKS는 고가용성 및 scaling이 가능한 kubernetes control plane을 제공할 수 있고, 이를 통해 다양한 워크로드와 애플리케이션을 지원할 수 있다.

요약

  1. EKS도 k8s처럼 etcd 씀
  2. etcd 짱 좋음
  3. etcd는 etcd 클러스터로 사용함

etcd 클러스터 형태는 external임 stacked임?

In Amazon EKS, the etcd cluster is typically deployed as an internal component of the EKS control plane, meaning it is "stacked" within the Kubernetes infrastructure rather than being deployed as a separate external service.

(대충 EKS 클러스터 만들면 etcd 쓰게 자동으로 구성된다는 내용)

However, it's worth noting that there are some scenarios where you might deploy an external etcd cluster with EKS, such as when you need more control over the etcd deployment or when you want to integrate EKS with an existing etcd deployment. In these cases, you would need to configure the Kubernetes API server to use the external etcd cluster, rather than the internal etcd cluster provided by EKS.

EKS에서 etcd 클러스터는 보통 EKS control plane의 내부 컴포넌트로 deploy된다. 그러니까 stacked topology다.