k3s is a CNCF-certified Kubernetes distribution that fits in 60 MB, runs on a Raspberry Pi, and is what we reach for whenever a project's brief includes "we need Kubernetes but not the operational overhead." Single binary, sane defaults, perfect for edge + small clusters.
Prerequisites
- One or more Linux hosts (Ubuntu 22.04 / Debian 12 / Rocky 9 all work).
- 1 vCPU, 1 GiB RAM minimum per node.
curl,iptables, no conflicting Docker/containerd you care about (k3s ships its own).
Step 1: Install the control-plane node
curl -sfL https://get.k3s.io | sh -
Three minutes later you have:
kubectlat/usr/local/bin/kubectl(k3s-bundled)- A running cluster with one node
- A kubeconfig at
/etc/rancher/k3s/k3s.yaml
Test:
sudo k3s kubectl get nodes
sudo k3s kubectl get pods -A
Step 2: Use the kubeconfig as a non-root user
mkdir -p ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chown $(id -u):$(id -g) ~/.kube/config
chmod 600 ~/.kube/config
kubectl get nodes
kubectl version
For remote access from your workstation, edit the server: line to point at the host's external IP instead of 127.0.0.1.
Step 3: Add worker nodes
On the control-plane node:
sudo cat /var/lib/rancher/k3s/server/node-token
Copy that token. On each worker:
curl -sfL https://get.k3s.io | K3S_URL=https://control-plane.example.sa:6443 \
K3S_TOKEN=<token> sh -
On the control-plane:
kubectl get nodes -o wide
Workers show up as worker role within ~30 seconds.
Step 4: What k3s installs out of the box
kubectl get pods -A
# kube-system:
# coredns — cluster DNS
# local-path-provisioner — PVCs from local disk (great default)
# metrics-server — kubectl top
# traefik — built-in ingress controller
# svclb-traefik-* — LoadBalancer Service support via klipper-lb
Disable any of them at install time with INSTALL_K3S_EXEC="server --disable traefik --disable servicelb" — handy if you want to run nginx-ingress instead.
Step 5: Test workload
kubectl create deployment hello --image=nginxdemos/hello:latest
kubectl expose deployment hello --port=80 --type=NodePort
kubectl get svc hello # note the NodePort, e.g. 31234
curl http://control-plane.example.sa:31234/ # static "Hello" page
Step 6: Update / uninstall
Update k3s in place:
curl -sfL https://get.k3s.io | sh -
Or pin a version on install:
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.30.2+k3s1 sh -
Uninstall cleanly (it ships its own script):
/usr/local/bin/k3s-uninstall.sh # control-plane
/usr/local/bin/k3s-agent-uninstall.sh # worker
Verify
kubectl get nodes -o wide
kubectl get pods -A
kubectl version
sudo systemctl status k3s --no-pager
Conclusion
k3s gives you a real Kubernetes cluster — same kubectl, same manifest format — in one curl. For learning, edge, IoT, and small in-house apps, it is the right choice over a full kubeadm install.
Next steps
- Run your first workload — Deploy your first pod.
- Expose a service — Kubernetes service with NodePort.
- For container basics first, see Docker + Compose on Ubuntu.
Comments
0 total · 0 threads