[k3s] k3s ์„ค์น˜ / k3s installation(xubuntu)

๐Ÿ‘‰๐Ÿป k3s๋Š” ๊ฒฝ๋Ÿ‰ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ์ž…๋‹ˆ๋‹ค.
k3s is a lightweight Kubernetes.

๐Ÿ‘‰๐Ÿป ํด๋ผ์šฐ๋“œ ํ™˜๊ฒฝ์—์„œ๋Š” ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค(k8s)๋ฅผ ์‚ฌ์šฉํ•ด๋„ ๋˜์ง€๋งŒ ์‚ฌ์–‘์ด ๋‚ฎ์€ ๊ฐœ์ธ pc์˜ ๊ฒฝ์šฐ๋Š” ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค๋Š” ๋ถ€๋‹ด์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
In a cloud environment, you can use Kubernetes (k8s), but for personal PCs with low specifications, Kubernetes can be a burden.

๐Ÿ‘‰๐Ÿป๊ทธ๋ž˜์„œ ํด๋ผ์šฐ๋“œ ํ™˜๊ฒฝ์ด ์•„๋‹Œ ๊ณณ์—์„œ ๊ฐ€๋ณ๊ฒŒ ์„œ๋ฒ„๋ฅผ ๊ตฌ๋™ํ•  ๊ฒฝ์šฐ์—๋Š” k3s๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๊ฒŒ ํšจ์œจ์ ์ž…๋‹ˆ๋‹ค.
Therefore, using k3s is efficient when running a lightweight server in a non-cloud environment.

๐Ÿ‘‰๐Ÿป ์•„๋ž˜๋Š” ๊ฐ„๋‹จํžˆ ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.
Below is a simple installation method.

๐Ÿ‘‰๐Ÿป ์ฐธ๊ณ ๋กœ ์ œ๊ฐ€ ํ…Œ์ŠคํŠธ ํ•˜๋Š” ํ™˜๊ฒฝ์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.
For reference, the testing environment I am using is as follows.

— CPU : Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz

— RAM : 4GB

1) ๊ธฐ๋ณธ ์ค€๋น„ / basic preparation

sudo apt update
sudo apt install -y curl

2) k3s ์„ค์น˜ (๊ธฐ๋ณธ ์˜ต์…˜) / k3s installation (default option)

curl -sfL https://get.k3s.io | sh -

3) ์ƒํƒœ ํ™•์ธ / Check status

sudo systemctl status k3s
sudo k3s kubectl get nodes

4) kubectl ํŽธํ•˜๊ฒŒ ์“ฐ๊ธฐ (์„ ํƒ) / Using kubectl comfortably (optional)

โœ”๏ธ sudo ๋ช…๋ น ์—†์ด ์ผ๋ฐ˜์‚ฌ์šฉ์ž๋กœ kubectl์„ ์‹คํ–‰๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•˜๋Š” ๋ช…๋ น์–ด
A command that allows you to run kubectl as a regular user without the sudo command

mkdir -p $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chown $USER:$USER $HOME/.kube/config

Leave a Reply