This project allows everyone to easily build a Kubernetes cluster using Raspberry Pi and Rancher's k3s.
I initially created it for my own personal use, to experiment with cloudnative-pg, longhorn, and to run my own cloud services using nextcloud. Now I'd like to share the knowledge I gained and the collection of bash scripts with anyone is interested in learning, practicing, and improving this project.
- x3 RPi 8GB RAM (I used v4)
- x3 SD cards
- x3 SSD disks
- x3 SATA to USB-3
- x1 network switch (4 ports)
Power adapters/cables, and network cables are omitted, but required.
Follow the procedure in the docs/
directory:
- Update RPi4 Firmware (when necessary)
- Install Debian for RPi
- Clone image on SSD and mount it as
root
- Prepare RPi nodes installing and configuring packages
- Setup cluster installing k3s on each node
install-sd.sh
- writes distro image to SD card, adds SSH key, configures hostname, downloadsrpi-clone
repo inside/root
install-kluster.sh
- install k3s and deploy required resources on the cluster following the correct procedureinit-k3s-master.sh
- install and deploy the first k3s masterjoin-k3s-master.sh
- install and deploy a new k3s master to join the clusterjoin-k3s-agent.sh
- install and deploy a new k3s agent to join the clusterdeploy-resources.sh
- install the specified resources in theresources.list
file