Why Kubernetes Raspberry Pi 4?
I have always wanted to deploy an OpenShift cluster at home to allow me to create all my demo and tutorial contents that I always posted on braindose, and maybe at the same time hosts some personal websites. It will not be a cheap exercise for a sizeable Kubernetes cluster like this. One day, it comes to me that why not I just deploy vanilla Kubernetes on Raspberry Pi 4 (it is affordable but not as cheap as before the chip shortage begins) instead of buying costly hardwares.
In addition, where is the fun with OpenShift installation because the deployment and configuration has been simplified. I am going to learn a lot more by deploying and configuring each of the components required for a vanilla Kubernetes. This get me excited and decided to go for RPi 4 with vanilla Kubernetes.
Deciding the OS for Kubernetes
Installing OS for Raspberry Pi is an easy thing that you may have probably been doing tens of times if not hundreds. The obvious option is to use Raspberry Pi OS.
So what else can we discuss here?
The objective here is to run Kubernetes on RPi 4. I want to make it work so that I can host my blog sites and also do my development and testing on this Kubernetes platform.
From what we know, softwares run better and faster with 64-bit build. According to Patrick from this post, 64-bit OS performs 25% better than 32-bit. Generally, it is also recommended to run Kubernetes on 64-bit RPi for better performance in terms of memory allocations and utilization, as in for RPi 4 comes with more powerful processor and memory.
Raspberry Pi OS Is Not for Serious 64-bit
I had tried to run Kubernetes (K8s) on Raspberry Pi OS with 64-bit Kernel, with 3 nodes. They ran fine initially without any problem. Soon, I realised this is not a true full 64-bit OS. I ran into many problems trying to install 64-bit binaries and I could not properly run
arm64 containers without problems.
I started to look around and the only considered stable and well supported RPi 4 64-bit OS at the moment is Ubuntu. So I wiped out the entire RPi cluster and start new with Ubuntu Server 20.04 LTS.
What Have I Done for My Kubernetes So Far?
Ever since, I have been making a lot of progresses installing containers on the K8s platform. These are some of the things that I have done so far on the K8s platform:
- PXE boot the Ubuntu OS on RPi 4 from my Synology storage.
- 3 control planes with 2 worker nodes (all RPi 4)
- Using my Synology as NFS dynamic storage for the K8s
- Running Prometheus and Grafana to monitor my cluster.
- High available HAProxy accepting public traffics from internet via my home router and proxies the traffics to Nginx Ingress Controller on K8s. These HAProxy are running on RPi4 and RPi3.
- Running WordPress containers with MariaDB container. This post that you are reading now is actually hosted on these K8s containers on RPi 4.
These sounds amazing and exciting isn’t it!
More to Come
Stay tuned and subscribed to my channels at Twitter and this blog site. I will be posting more to cover the details of how I get all these done and what are the bumps that I was getting into in this journey.