Загрузка...

How to Install Multi-Node K3s Cluster on Ubuntu 26.04 / 24.04 Step-by-Step

If you want to run Kubernetes in a lightweight environment such as home labs, edge computing, IoT environments, or small cloud setups, then K3s is one of the best Kubernetes distributions available today.

🧰 Prerequisites
Before installing the K3s cluster, ensure the following:

✔ Two Ubuntu systems
k3s-master (Master Node) – 192.168.1.137
k3s-worker1 (Worker Node) – 192.168.1.138
✔ Supported OS: Ubuntu 24.04 / Ubuntu 26.04

✔ Minimum Requirements
2 CPU cores
2 GB RAM
20 GB Disk

✔ Sudo Access
✔ Network Connectivity (ping between nodes)

✔ Disable Swap:
sudo swapoff -a
sudo sed -i '/swap/d' /etc/fstab

⚙️ Step-by-Step K3s Multi-Node Setup

Step 1 – Set Hostnames
Master Node:
sudo hostnamectl set-hostname k3s-master

Worker Node:
sudo hostnamectl set-hostname k3s-worker1

Add entries:
192.168.1.137 k3s-master
192.168.1.138 k3s-worker1

Step 2 – Install K3s on Master
curl -sfL https://get.k3s.io | sh -

Verify:
sudo kubectl get nodes

Step 3 – Get Node Token
sudo cat /var/lib/rancher/k3s/server/node-token

Step 4 – Join Worker Nodes
curl -sfL https://get.k3s.io | K3S_URL=https://{MASTER-IP}:6443 K3S_TOKEN={NODE-TOKEN} sh -

Step 5 – Verify Cluster
kubectl get nodes

Step 6 – Deploy Test Application
kubectl create deployment nginx --image=nginx
kubectl expose deployment nginx --port=80 --type=NodePort

🎯 Why Use K3s?
👉 Perfect for low-resource environments
👉 Ideal for Dev/Test labs & edge computing
👉 Fast setup compared to kubeadm clusters
👉 Minimal operational overhead

👍 Support the Channel

If you found this helpful:

✔ Like 👍
✔ Comment 💬
✔ Subscribe 🔔 for more Linux, Kubernetes, DevOps & Cloud tutorials

Видео How to Install Multi-Node K3s Cluster on Ubuntu 26.04 / 24.04 Step-by-Step канала LinuxTechi
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять