์จํ๋ ๋ฏธ์ค ์ฐ๋ถํฌ๋ฅผ ํ์ฉํ ์ฟ ๋ฒ๋คํฐ์ค ๊ตฌ์ฑ
์จํ๋ ๋ฏธ์ค ์ฐ๋ถํฌ๋ฅผ ํ์ฉํ ์ฟ ๋ฒ๋คํฐ์ค ๊ตฌ์ฑ
1. VM ์์ฑ
๋งํฌ : console.cloud.google.com

- ์คํ ๋ค๋ ๋ชจ๋๋ก ํด๋ฌ์คํฐ๋ฅผ ๊ตฌ์ฑ
- master ํ๋ worker ๋๊ฐ
์์คํ ๊ตฌ์ฑ์ ๋ชจ๋ VM ์๋์ ๊ฐ์ (*์ด๋ฆ๋ง ๋ค๋ฆ)



2. ๋ ธ๋ ์ค๋น
์์ ์ ์กฐ๊ฑด
- ํธํ๋๋ ๋ฆฌ๋ ์ค ๋จธ์
- 2GB ์ด์์ ๋จ์ ์ฅ์ฐฉํ ๋จธ์ (์ด ๋ณด๋ค ์์ผ๋ฉด ์ฌ์ฉ์์ ์ฑ์ ์ํ ๊ณต๊ฐ์ด ๊ฑฐ์ ๋จ์ง ์์)
- 2 ์ด์์ CPU
- ํด๋ฌ์คํฐ์ ๋ชจ๋ ๋จธ์ ์ ๊ฑธ์น ์ ์ฒด ๋คํธ์ํฌ ์ฐ๊ฒฐ
- ๋ชจ๋ ๋ ธ๋์ ๋ํด ๊ณ ์ ํ ํธ์คํธ ์ด๋ฆ
- ์ปดํจํฐ์ ํน์ ํฌํธ๋ค ๊ฐ๋ฐฉ
- ์ค์์ ๋นํ์ฑํ (kubelet์ด ์ ๋๋ก ์๋ํ๊ฒ ํ๋ ค๋ฉด ๋ฐ๋์ ์ค์์ ์ฌ์ฉํ์ง ์๋๋ก ์ค์ )
How do I disable swap?
I have some sensitive data in RAM that I prefer not to be on disk. How do I disable swap? I have more than enough RAM. If RAM consumption gets too high I have no problems with processes being term...
askubuntu.com
sudo swapoff -a # ํ์ฌ ์์คํ
์ ์ ์ฉ(๋ฆฌ๋ถํ
ํ๋ฉด ์ฌ์ค์ ํ์)
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab # ๋ฆฌ๋ถํ
ํ์
์ปจํ ์ด๋ ๋ฐํ์ ๊ตฌ์ฑ
๋ชจ๋ ๋ ธ๋์ ๋ค์ ๋ช ๋ น์ผ๋ก ๊ตฌ์ฑ์ ์ํํ๋ค.
https://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/install-containerd-on-ubuntu-22-04.html
How to Install Containerd on Ubuntu 22.04 / Ubuntu 20.04 | ITzGeek
containerd is an industry-standard container runtime that manages the complete container lifecycle of its host system. It handles image
www.itzgeek.com
# Using Docker Repository
sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
# containerd ์ค์น
sudo apt update
sudo apt install -y containerd.io
# sudo systemctl status containerd # Ctrl + C๋ฅผ ๋๋ฌ์ ๋๊ฐ๋ค.
# Containerd configuration for Kubernetes
cat <<EOF | sudo tee -a /etc/containerd/config.toml
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true
EOF
sudo sed -i 's/^disabled_plugins \=/\#disabled_plugins \=/g' /etc/containerd/config.toml
sudo systemctl restart containerd
# ์์ผ์ด ์๋์ง ํ์ธํ๋ค.
ls /var/run/containerd/containerd.sock
kubeadm, kubelet ๋ฐ kubectl ์ค์น
๋ชจ๋ ๋จธ์ ์ ๋ค์ ํจํค์ง๋ค์ ์ค์นํฉ๋๋ค.
- kubeadm : ํด๋ฌ์คํธ๋ฅผ ๋ถํธ์คํธ๋ฉํ๋ ๋ช ๋ น์ด๋ค. ํด๋ฌ์คํฐ๋ฅผ ์ด๊ธฐํํ๊ณ ๊ด๋ฆฌํ๋ ๊ธฐ๋ฅ์ ๊ฐ๋๋ค.
- kubelet : ํด๋ฌ์คํฐ์ ๋ชจ๋ ๋จธ์ ์์ ์คํ๋๋ ํ๋์ ์ปจํ ์ด๋ ์์๊ณผ ๊ฐ์ ์์ ์ ์ํํ๋ ์ปดํฌ๋ํธ์ด๋ค. ๋ฐ๋ชฌ์ผ๋ก ๋์ํ๋ฉฐ ์ปจํ ์ด๋๋ฅผ ๊ด๋ฆฌํ๋ค.
- kubectl : ํด๋ฌ์คํฐ์ ํต์ ํ๊ธฐ ์ํ ์ปค๋งจ๋ ๋ผ์ธ ์ ํธ๋ฆฌํฐ์ด๋ค. ํด๋ผ์ด์ธํธ ์ ์ฉ ํ๋ก๊ทธ๋จ์ด๋ค.
๋ชจ๋ ๋ ธ๋์์ ๋ค์ ๋ช ๋ น์ ์คํํฉ๋๋ค.
cat <<EOF > kube_install.sh
# 1. apt ํจํค์ง ์์ธ์ ์
๋ฐ์ดํธํ๊ณ , ์ฟ ๋ฒ๋คํฐ์ค apt ๋ฆฌํฌ์งํฐ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ ๋ฐ ํ์ํ ํจํค์ง๋ฅผ ์ค์นํ๋ค.
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl
# 2. ๊ตฌ๊ธ ํด๋ผ์ฐ๋์ ๊ณต๊ฐ ์ฌ์ด๋ ํค๋ฅผ ๋ค์ด๋ก๋ ํ๋ค.
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
# 3. ์ฟ ๋ฒ๋คํฐ์ค apt ๋ฆฌํฌ์งํฐ๋ฆฌ๋ฅผ ์ถ๊ฐํ๋ค.
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
# 4. apt ํจํค์ง ์์ธ์ ์
๋ฐ์ดํธํ๊ณ , kubelet, kubeadm, kubectl์ ์ค์นํ๊ณ ํด๋น ๋ฒ์ ์ ๊ณ ์ ํ๋ค.
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl
EOF
sudo bash kube_install.sh
kubeadm ๋ฒ์ ์ ํ์ธ
kubeadm version
๋ทํํฐ ๋ธ๋ฆฟ์ง ์ค์
๋ชจ๋ ๋ ธ๋์ ๋ค์ ๋ช ๋ น์ผ๋ก ๋ทํํฐ ๋ธ๋ฆฟ์ง ์ค์
sudo -i
modprobe br_netfilter
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
exit
- sudo -i ๋ฐ๋ก ๋ด์ฉ ๋ฐ๋ก exit ๋ฐ๋ก ์คํํ ๊ฒ
3. ํด๋ฌ์คํฐ ๊ตฌ์ฑ
์ฌ๊ธฐ์๋ถํฐ๋ ๊ฐ ๋ ธ๋์์ ์์ ํ๋ ๋ด์ฉ์ด ๋ค๋ฅด๊ธฐ ๋๋ฌธ์ ์ฃผ์๊ฐ ํ์
๋ง์คํฐ ๋ ธ๋ ์ด๊ธฐํ
๋ง์คํฐ ๋ ธ๋์์ init ์์ ์ ์์ํฉ๋๋ค.
sudo kubeadm init
์ดํ ๋ค์๊ณผ ๊ฐ์ด init์ ์ฑ๊ณตํฉ๋๋ค. ์ฑ๊ณตํ๋ฉด ๋ค์๊ณผ ๊ฐ์ด ๊ฐ์ด๋๊ฐ ๋ํ๋ฉ๋๋ค.
Your Kubernetes control-plane has initialized successfully!
# 1) ์ ์ ์ค์
To start using your cluster, you need to run the following as a regular user:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Alternatively, if you are the root user, you can run:
export KUBECONFIG=/etc/kubernetes/admin.conf
# 2) ํ๋ ๋คํธ์ํฌ ์ค์
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/
# 3) ์์ปค ๋
ธ๋ ์กฐ์ธ ๋ฐฉ๋ฒ
Then you can join any number of worker nodes by running the following on each as root:
kubeadm join 10.142.0.3:6443 --token xcs79e.vnernooln6yyimtv \
--discovery-token-ca-cert-hash sha256:c9f8642746515eadc28e72c~
์ ์ ์ค์
๋ค์ ๋ช ๋ น์ ์คํํ๋ฉด .kube/config ํ์ผ์ด ์ค์ ๋๋ฉด์ ์ฌ์ฉ์ด ๊ฐ๋ฅํด์ง๋๋ค. "๋ง์คํฐ ๋ ธ๋"์์๋ง ์งํ
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
์ธ์ฆ ์ ๋ณด๋ฅผ ์ฌ์ฉํด ๋ ธ๋ ๋ชฉ๋ก์ ํ์ธํฉ๋๋ค.
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
master-1 NotReady control-plane 5m v1.26.0
์์ปค ๋ ธ๋ ์กฐ์ธ
๋ณธ์ธ์ ์ฝ์์ ์ถ๋ ฅ๋ ํ ํฐ๊ณผ hash ๊ฐ์ ์ฌ์ฉํด ์กฐ์ธ์ ์ํํด์ผ ํฉ๋๋ค. ๋ค์ ๋ช ๋ น์ "์์ปค ๋ ธ๋"์์ ์ค์ต์ ์งํํฉ๋๋ค.
sudo kubeadm join 10.142.0.3:6443 --token xcs79e.vnernooln6yyimtv \
--discovery-token-ca-cert-hash sha256:c9f8642746515eadc28e72c687eface2~
๋ง์คํฐ ๋ ธ๋์์ ๋ ธ๋ ๋ชฉ๋ก์ ์กฐํํฉ๋๋ค.
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
master-1 NotReady control-plane 7m55s v1.26.0
worker-1 NotReady <none> 14s v1.26.0
worker-2 NotReady <none> 23s v1.26.0
*init์ด๋ join์ ์๋ชป ์ํํ ๊ฒฝ์ฐ
sudo kubeadm reset
*token ์ฌ๋ฐ๊ธ ๋ฐ๋ ๋ฐฉ๋ฒ (๋ง์คํฐ ๋ ธ๋์์)
ํ ํฐ ๋ฆฌ์คํธ ํ์ธํ๊ธฐ : sudo kubeadm token list
ํ ํฐ ์ฌ๋ฐ๊ธํ๊ธฐ : sudo kubeadm token create --print-join-command
ํ๋ ๋คํธ์ํฌ ๋ฐฐํฌ
"๋ง์คํฐ ๋ ธ๋"์์ ๋ค์ ๋ช ๋ น์ ์คํํ๋ฉด ์์ ๊ตฌ์ฑํ ์ ์ ์ค์ ์ ํตํด ํด๋ฌ์คํฐ์ cilium์ ์ค์นํฉ๋๋ค.
cilium ์ค์น
curl -L --fail -o cilium-linux-amd64.tar.gz \
https://github.com/cilium/cilium-cli/releases/latest/download/cilium-linux-amd64.tar.gz
sudo tar -xzvf cilium-linux-amd64.tar.gz -C /usr/local/bin
rm -f cilium-linux-amd64.tar.gz
cilium version
cilium ์ค์น ์ "ํด๋ฌ์คํฐ ์ค๋น ์ํ" ํ์ธ
kubectl get nodes
kubectl get pods -A
์ค์น
cilium install
cilium status --wait
kubectl get nodes -> ready ๋ก ํ์ธ

'์ฟ ๋ฒ๋คํฐ์ค > ์ฟ ๋ฒ๋คํฐ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [์ฟ ๋ฒ๋คํฐ์ค ์์] ์ฟ ๋ฒ๋คํฐ์ค ์ค์ต ํ๊ฒฝ ๊ตฌ์ถ(Mac OS) (0) | 2026.03.15 |
|---|---|
| [์ฟ ๋ฒ๋คํฐ์ค ์์] ์ฟ ๋ฒ๋คํฐ์ค ๋? (0) | 2026.03.14 |
| Minikube & K9s (๋ชจ๋ํฐ๋ง ๋ฐ ๋ฆฌ์์ค ๋ณด๊ธฐ) (0) | 2025.06.08 |
| Minikube & K9s (Kubernetes ๋คํธ์ํฌ ์ค์ต) (1) | 2025.06.07 |
| Minikube & K9s (K9s ๊ตฌ์ถ, ๋ฆฌ์์ค ์์ฑ ๋ฐ ๊ด๋ฆฌ ์ค์ต, ์ ๊ทผ์ ์ด ์ค์ต) (0) | 2025.06.06 |
๋๊ธ