Build a small MicroK8s cluster on Raspberry Pi
Prepare 64-bit Pi nodes, join them deliberately and verify cluster health. Worker count, control-plane availability and durable storage are separate decisions.
Three Raspberry Pi 4 boards with 8 GB RAM and wired Ethernet make a useful Kubernetes learning cluster. Use reliable power supplies, cooling and separate system disks. Fast USB SSDs are more suitable for repeated container and datastore writes than cheap flash drives. See USB boot if the boards need it.
Start each board with a supported 64-bit Ubuntu Server image for that Pi model. Give the nodes unique hostnames, stable LAN addresses and working time synchronization. Confirm that they can reach one another before installing Kubernetes. A home lab still needs a predictable network.
Check the operating system first
On each node:
uname -m
cat /etc/os-release
cat /proc/cmdline
stat -fc %T /sys/fs/cgroup
The architecture should be aarch64. Follow Canonical’s Pi instructions for your Ubuntu image and kernel. Older images may need memory-cgroup boot parameters or extra Raspberry Pi kernel modules; do not copy a 2023 boot configuration onto a newer image without checking it.
If memory-cgroup parameters are required, append cgroup_enable=memory cgroup_memory=1 to the existing single line in /boot/firmware/cmdline.txt, then reboot. Do not put those parameters on a second line. Keep the original root-device and console arguments intact.
Install the same release track everywhere
Inspect the available channels rather than copying an old 1.26/stable command:
snap info microk8s
Choose a currently supported numbered stable track for a controlled cluster. Set it in the shell, then install on each node. This prompt avoids pretending a fixed release number will remain suitable indefinitely:
read -r -p 'MicroK8s stable channel (for example, a supported X.Y/stable): ' channel
sudo snap install microk8s --classic --channel="$channel"
sudo microk8s status --wait-ready
Use the same selected track on every board. sudo microk8s works without changing account groups; granting membership of the microk8s group is a separate privilege decision.
Join nodes with a fresh token
On the first node:
sudo microk8s add-node
Run the generated join command on the next node. Generate a fresh command for each additional node rather than copying the historical token from a guide. Keep tokens private and use the advertised address reachable over your LAN.
Joining normally adds a control-plane node. Use the generated command’s --worker option only when you deliberately want a worker-only node. One control-plane node plus two workers does not provide three-node control-plane availability.
Then check from the first node:
sudo microk8s kubectl get nodes -o wide
sudo microk8s status
sudo microk8s kubectl get pods -A
Wait for all expected nodes to become Ready and investigate system Pods that are repeatedly restarting or pending.
Add services only when needed
Inspect microk8s status for the addons available in your chosen track. DNS provides in-cluster service discovery. Hostpath storage is tied to a node and is not replicated durable storage. MetalLB needs a reserved LAN address pool that does not overlap DHCP assignments. Ingress implementations also vary by release; do not assume an old addon name still installs the same controller.
Enable one addon at a time and check its resources before adding the next. This keeps network, storage and workload failures distinguishable.
Canonical documents Pi installation, release channels and cluster joining. For what service name resolution builds on, continue with DNS.