How to build a Raspberry Pi Kubernetes Cluster with k3s
and running some cool IoT applications on it
This blog article is the result of a fun Kubernetes Meetup we had in Mai 2022 in Leipzig, Germany with a practice lab playing around with k3s and some Raspberry Pi to building some example applications.
I thought it might be also interesting for others to have a hands-on tutorial on how to setup a Kubernetes clusters with a couple of Raspberry Pi using k3s and how to use a Kubernetes Pod to run a typical Raspberry Pi app, like some home automation or IoT apps.
The difference to many other tutorials around Kubernetes on Raspberry Pi is that this one does not stop after the cluster setup but also shows several example applications that can be deployed. Like a monitoring app that runs on all devices or an LED strip app that runs only on a dedicated node and has accesses to the GPIO Pins directly from the Pod.
Content
- Setup Raspberry Pi headless
- Setup k3s cluster
- Configure kubectl on client
- Use case 0: functional test
- Use case 1: deploy a MQTT broker using Helm
- Use case 2: monitoring app on each Raspberry Pi