카테고리 없음

Kubernetes Explorer 00. Mastering Container Orchestration

BOOKSEAL 2025. 4. 28. 10:17

What's next after Docker Compose? Want a smarter way to handle many Docker containers? Let's explore Kubernetes! This wiki uses our meeting notes to guide you through the key ideas of Kubernetes in an easy and interesting way.

도커 컴포즈 다음 단계는 무엇일까요? 여러 개의 도커 컨테이너를 더 스마트하게 관리하고 싶으신가요? 쿠버네티스의 세계로 떠나봅시다! 이 위키는 회의록을 바탕으로 쿠버네티스의 핵심 개념을 쉽고 흥미롭게 안내합니다.


Step 1: First Look at Kubernetes - K8s vs K3s

1단계: 쿠버네티스 첫인상 - K8s vs K3s

  • What is Kubernetes (K8s)?: It's a powerful tool to manage and deploy many Docker containers together. Think of it like a conductor leading an orchestra of containers.

  • 쿠버네티스(K8s)란 무엇일까요?: 여러 개의 도커 컨테이너를 묶어 관리하고 배포하는 강력한 도구입니다. 마치 오케스트라 지휘자처럼 컨테이너들을 조율하죠.

  • But what is K3s?: It's a lighter version of K8s with just the essential features. It has fewer parts and is smaller to install (under 100MB!), making it easier to learn and test. The name '3' is like half of '8', showing it's lighter.

  • 그런데 K3s는 뭔가요?: K8s의 핵심 기능만 남긴 가벼운 버전입니다. 모듈 수가 적고 설치 용량도 작아서(100MB 이하!) 배우거나 테스트하기에 부담이 적습니다. '8'을 반으로 가른 '3'이라는 이름처럼, 더 가볍고 빠르죠!

  • Why start with K3s?: The main ideas are similar to K8s, but it's simpler, which is great for beginners. It's light, so it can even run in places with fewer resources, like embedded devices.

  • 왜 K3s로 시작할까요?: 핵심 개념은 K8s와 비슷하지만, 구조가 단순해서 처음 배우기 좋습니다. 가볍기 때문에 리소스가 적은 환경(임베디드 등)에서도 사용할 수 있다고 합니다.


Step 2: Looking Inside Kubernetes - Core Parts

2단계: 쿠버네티스 핵심 부품 살펴보기

  • Pod: The smallest unit you deploy in Kubernetes. It holds one or more Docker containers. Think of it as almost the same as a Docker container.

  • Pod (파드): 쿠버네티스 배포의 가장 작은 단위입니다. 도커 컨테이너 하나 또는 여러 개가 모여 하나의 파드를 이룹니다. 도커 컨테이너와 거의 같다고 생각해도 좋습니다.

  • Node: A worker machine (real server or virtual machine) where Pods run. A Node groups multiple Pods.

  • Node (노드): 파드들이 실제로 실행되는 작업 공간(물리 서버 또는 가상 머신)입니다. 여러 개의 파드를 묶어서 하나의 노드가 됩니다.

  • Cluster: The whole system, made up of multiple Nodes grouped together. Like managing computers in different data centers (Seoul, Chuncheon, Seongnam) as one.

  • Cluster (클러스터): 여러 노드를 묶은 전체 시스템입니다. 서울, 춘천, 성남에 있는 데이터 센터 컴퓨터들을 하나로 묶어 관리하는 것과 비슷합니다.

  • kubectl: The command-line tool (CLI) to talk to your Kubernetes cluster. Both K8s and K3s use the same commands.

  • kubectl (큐브컨트롤): 쿠버네티스 클러스터와 대화하는 명령어 도구(CLI)입니다. K8s와 K3s 모두 동일한 명령어를 사용합니다.

  • Kubelet: An agent that runs on each Node. It gets instructions from the master and manages the Pods on its Node, like a site manager.

  • Kubelet (큐블렛): 각 노드에서 실행되며, 마스터의 지시를 받아 파드를 관리하는 '현장 감독관' 같은 에이전트입니다.

  • Control Plane / Server: The 'brain' of the cluster that manages and controls everything. Usually, you don't run your apps (Pods) directly here; they run on Agent/Worker Nodes. K8s often calls this the Control Plane, while K3s might call it the Server.

  • Control Plane (컨트롤 플레인) / Server: 클러스터 전체를 관리하고 제어하는 '두뇌'입니다. 워크로드(애플리케이션 파드)는 보통 여기에 직접 올리지 않고, 에이전트 노드에 배치합니다. K8s에서는 컨트롤 플레인, K3s에서는 서버라고 부르기도 합니다.

  • etcd / Built-in DB: A database that stores all the information about the cluster's state (like which Pods are running where). K8s usually uses 'etcd', while K3s uses its own lightweight built-in database (like Kine). This stores Kubernetes' own info, different from a Docker Compose volume.

  • etcd / 내장 DB: 클러스터의 모든 상태 정보(어떤 파드가 어디서 실행 중인지 등)를 저장하는 데이터베이스입니다. K8s는 보통 etcd를, K3s는 자체 개발한 가벼운 내장 DB(예: Kine)를 사용합니다. 도커 컴포즈의 볼륨과는 다른, 쿠버네티스 자체 메타데이터 저장소입니다.


Step 3: Magic of Deploying and Managing Apps

3단계: 애플리케이션 배포와 관리 마법

  • Deployment: Defines how to deploy and update your application (Pods). You can tell it, "Always keep 3 copies of this app running".

  • Deployment (디플로이먼트): 애플리케이션(파드)을 어떻게 배포하고 업데이트할지 정의합니다. "이 앱은 항상 3개를 실행시켜줘" 같은 명령을 내릴 수 있습니다.

  • ReplicaSet: Works with Deployments to make sure the right number of Pod copies (replicas) are always running. If a Pod dies, the ReplicaSet automatically starts a new one to prevent downtime. Having extra copies might seem wasteful, but it's key for keeping your service stable.

  • ReplicaSet (레플리카셋): 디플로이먼트의 지시에 따라 지정된 수의 파드 복제본을 항상 유지하는 역할을 합니다. 만약 파드 하나가 죽으면, 레플리카셋이 자동으로 새 파드를 띄워 서비스 중단을 막습니다. 놀고 있는 복제본이 낭비처럼 보일 수 있지만, 서비스 안정성을 위한 필수 요소입니다.

  • Service: Groups Pods together and gives them a single, stable network address (endpoint) so they can be reached from inside or outside the cluster. This is different from the services: in Docker Compose. Kubernetes Services are more about managing network connections for Pods.

  • Service (서비스): 여러 파드를 하나로 묶어 외부 또는 내부에서 접근할 수 있는 고정된 네트워크 주소(엔드포인트)를 제공합니다. 도커 컴포즈의 services: 와는 역할이 다릅니다. 쿠버네티스의 서비스는 파드들을 관리하고 연결하는 네트워크 개념에 가깝습니다.

  • Ingress: Acts as a 'gateway' for traffic coming from outside the cluster to reach services inside. It can set up rules, like sending traffic to different services based on the URL path.

  • Ingress (인그레스): 클러스터 외부에서 내부 서비스로 들어오는 트래픽을 관리하는 '관문'입니다. URL 경로에 따라 다른 서비스로 트래픽을 보내는 라우팅 규칙 등을 설정할 수 있습니다.

  • Load Balancing: Spreads incoming traffic evenly across multiple Pods behind a Service or Ingress. It can even automatically increase the number of Pods if traffic gets heavy.

  • Load Balancing (로드 밸런싱): 서비스나 인그레스를 통해 들어온 트래픽을 여러 파드에 골고루 분산시켜 주는 기능입니다. 트래픽이 몰리면 자동으로 파드 수를 늘리는 것도 가능합니다.


Step 4: Handy Tools for Easier Kubernetes Use

4단계: 더 편리한 쿠버네티스 활용 도구들

  • Argo CD: A tool for GitOps. It automatically syncs the state defined in a Git repository with the actual state of your Kubernetes cluster. When you push code changes to Git, Argo CD detects them, deploys them to the cluster, and monitors the status.

  • Argo CD: Git 저장소에 정의된 상태와 쿠버네티스 클러스터의 실제 상태를 자동으로 동기화해주는 도구(GitOps)입니다. 코드 변경 사항을 Git에 푸시하면 Argo CD가 감지하여 클러스터에 자동으로 배포하고, 상태를 모니터링합니다.

  • Vagrant: A tool to easily create and manage Virtual Machine (VM) environments using code. It controls VM software like VirtualBox through APIs to automate everything from downloading an Ubuntu image to setting up networking and creating VMs. Useful for setting up a Kubernetes practice environment (Server Node VM, Agent Node VM).

  • Vagrant (바그란트): 코드를 통해 가상 머신(VM) 환경을 쉽게 만들고 관리하는 도구입니다. VirtualBox 같은 VM 프로그램을 API로 제어하여, 우분투 이미지 다운로드부터 네트워크 설정, VM 생성까지 스크립트로 자동화할 수 있습니다. 쿠버네티스 실습 환경(서버 노드, 에이전트 노드 VM) 구축에 유용합니다.

  • K3d: A tool to quickly create K3s clusters locally using Docker. It runs K3s inside Docker containers without needing full VMs, making it a very fast and light way to test Kubernetes.

  • K3d: 도커를 사용하여 K3s 클러스터를 로컬 환경에 빠르게 생성하는 도구입니다. VM 없이 도커 안에서 K3s를 실행하므로, 더 가볍고 빠르게 쿠버네티스를 테스트해볼 수 있습니다.

  • GitLab: A Git repository management tool you can install and run on your own server. You can set up a local GitLab server instead of using GitHub and practice connecting it with Argo CD.

  • GitLab: 로컬 환경에 직접 설치하여 사용하는 Git 저장소 관리 도구입니다. GitHub 대신 로컬 GitLab 서버를 구축하여 Argo CD와 연동하는 실습도 가능합니다.


Ready to start your Kubernetes adventure? Follow these steps to explore the world of container orchestration!

이제 쿠버네티스 탐험을 시작할 준비가 되셨나요? 각 단계를 차근차근 따라가며 컨테이너 오케스트레이션의 세계를 경험해보세요!