One minute
initial setup k3s cluster
Sometimes setting up a full Kubernetes cluster (k8s) is simply overkill, this is where k3s comes into play.
The certified Kubernetes distribution built for IoT & Edge computing
Assumption
Let’s assume two Debian systems (yoda as master and luke as worker) with identical hardware/OS:
- Debian 12 (bookworm) bare minimum install
- Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (with 12 cores)
- 64GB RAM
- 500GB disk storage (NVMe SSD)
- installed packages:
- curl
- sudo
The used addresses will be 192.168.1.100 for yoda and 192.168.1.200 for luke
Install
The setup will be done (as root) on yoda in a blink of an eye with curl -sfL https://get.k3s.io | sh -
To add a new node to the cluster the init-token is needed. Get it on the master with K3S_TOKEN=$(cat /var/lib/rancher/k3s/server/node-token)
To add a node login to new node and run as root
curl -sfL https://get.k3s.io | K3S_URL=https://192.168.1.100:6443 K3S_TOKEN=$K3S_TOKEN sh -
After a short time (depending on your internet connection) the cluster is up and running. Check the status of all nodes sudo k3s kubectl get node
luke Ready <none> 1d v1.28.7+k3s1
yoda Ready control-plane,master 1d v1.28.7+k3s1