DevOps/Kubernetes

[Kubernetes][CKA] ETCD

박한결 2023. 12. 13. 00:16

Overview of ETCD

  • Definition: ETCD is a distributed, reliable key-value store that is simple, secure, and fast. It is primarily used in clustered environments for configuration and state management.
  • Key-Value Store Explained: Unlike traditional databases that use tables, ETCD stores data in a key-value format. Each key-value pair (or 'document') can have a different structure, and changes to one document do not affect others.

Installation of ETCD

  • Process:
    1. Download ETCD binaries.
    2. Extract the binaries.
    3. Run the ETCD service.
  • Default Control: ETCD controller client is typically the default interface for interacting with ETCD.

ETCD Versions

  • Version 2: Widely used, with a stable API.
  • Version 3: Introduced significant changes, including modifications to the API.
  • etcdctl: This is a command-line tool designed to work irrespective of the ETCD API version. Key versions to check are the etcdctl version and the API version.
  • Version Switching: The ETCDCTL_API environment variable allows switching between different API versions.

ETCD's Role in Kubernetes

  • Function: Stores information about the Kubernetes cluster, including nodes, pods, configs, secrets, accounts, roles, bindings, and other data. ( 쿠버네티스 클러스터에 대한 정보 -nodes, pods, configs, secrets, accounts, roles, bindings 등-를 저장 )
  • Operation: Every operation in the cluster updates the ETCD server, and an operation is considered complete only after this update. ( 클러스터 내의 모든 작업은 ETCD 서버를 업데이트하며, 이 업데이트가 완료되면 작업이 완료된 것으로 간주 )

Kubeadm

  • Definition: Kubeadm is a tool for quickly installing and setting up a basic Kubernetes cluster. ( Kubeadm은 기본 쿠버네티스 클러스터를 빠르게 설치하고 설정하는 도구 )
  • ETCD Integration: Kubeadm can be used to set up ETCD as part of the Kubernetes cluster initialization process.

High Availability (HA) with ETCD

  • Multiple Master Nodes: In an HA setup, multiple master nodes are used to ensure cluster availability and resilience. ( HA 설정에서는 클러스터 가용성과 탄력성을 보장하기 위해 여러 마스터 노드가 사용됨 )
  • ETCD Configuration for HA:
    • Cluster Configuration: ETCD clusters need to be configured to work in sync across multiple master nodes.
    • advertise-client-urls: This parameter in ETCD configuration plays a critical role in defining how ETCD communicates with the Kubernetes cluster.
    • ETCD Cluster Health: Regular checks and maintenance of the ETCD cluster are vital for HA environments.

 


↘️ 더보기는 초안

더보기

ETCD ?

distributed reliable key-value store that is simple, secure and fast

Key-Value Store ?

traditional database : table format 

 

key-value : document

each file has different structure

one file does not effect to other file

 

install ETCD

order : download binaries - extract - run ETCD service

default controller : ETCD controller client 

 

ETCD versions

version2 - 많이 사용함

version3 - 변화가 많았음 ( api version 이 바뀜 => etcdctl 명령어도 바뀜 )

 

etcdctl  은 api 버전에 관계 없이 동작하도록 설계 되어있음

확인해야 하는 버전은 etcdctl version, api version 두 개가 있음

 

ETCDCTL_API 환경변수를 사용하면 버전을 바꿀 수 있음 

 

ETCD roles in Kubernetes

쿠버네티스 클러스터에 대한 정보를 저장

(Nodes, PODs, Configs, Secrets, Accounts, Roles, Bindings, Others )

 

클러스터에서 작업을 할 때 마다 ETCD 서버에 업데이트가 되고, 업데이트가 완료되야 작업이 완료된 것으로 간주됨

 

* advertise-client-urls

 

Kubeadm

 

HA

multiple master nodes

etcd configuration 

 

 

 

 

실습

https://github.com/kodekloudhub/certified-kubernetes-administrator-course/blob/master/docs/02-Core-Concepts/05-ETCD-in-Kubernetes.md