본문 바로가기
DevOps/DockerKubernetes

쿠버네티스 아키텍처

by 계영수 2022. 9. 4.
728x90

쿠버네티스를 공부함에 있어서, 아키텍처를 이해하는 것이 중요하다.

▶ Node

Node는 쿠버네티스 서비스가 돌아가는 기계로, 물리 서버 혹은 가상 서버일 수 있다. 쿠버네티스는 노드에 설치되어 있는 도커를 이용하여 컨테이너에 대해서 오케스트레이션 서비스를 구현한다. Node는 과거에서 'minions'라고 불리기도 했다.

▶ Cluster

만약 노드에 장애가 발생하면, 서비스 운영에 문제가 발생하기 때문에, 서비스의 가용성을 위해서 여러대의 노드를 운영하게 된다. 이렇게 여러대의 노드를 하나의 그룹으로 묶어놓고, 다양한 기능(로드 밸런싱, 페일오버등)을 제공하도록 만든 것이 클러스터이다.

클러스터내에 있는 노드들을 관리(오케스트레이션)하기 위해서, 노드를 관리하는 하는 노드가 필요하다. 이런 노드를 마스터 노드라고 한다.

▶ 쿠버네티스 구성요소

 

▷API Servers

쿠버네티스에 관리를 목적으로 접근하기 위한 억세스 포인트로, 사용자, 다양한 관리도구, 명령어 인터페이스등이 연결되는 포인트이다.

 

▷ etcd

etcd is a distrubuted reliable key value store used by kubernetes to store all data used to manage the cluster. Think of it this way, When you have multiple nodes and multiple Masters in your cluster, etcd stores all that information on all the node in the cluster in a distributed manner. etcd is responsible for implementing locks within the cluster to ensure that there are no conflicts between the Master.

 

▷ Scheduler

The Schedulere is responsible for distributing work or containers across multiple nodes. It looks for newly created containers and assigns them to nodes.

 

Controller

The controllers are the brain behind cochestration. They are responsible for noticing and responding when nodes, containers or end points goes down. The Controllers make decisions to bring up new containers in such cases.

 

▷ Container Runtime

The Container Runtime is the underlying software that is used to run containers. In our cases it happens to be Docker. But there are other options as well.

 

▷ Kubelet

The Kubelet is the agent that runs on each node in cluster. The agent is responsible for making sure that the containers are running on the nodes as expected. 

 

▶ Kubectl

The kubectl tool is used to deploy and manage applications on a Kubernetes cluster.  To get cluster information, to get the status of other nodes in the cluster and to manage many other things. The "kubectl run" command is used to deploy an application on the cluster.

The "kubectl cluster info" command is used to view information about the cluster and the "kubectl get nodes" command is used to list all the nodes part of the cluster. 

728x90