Raspberry Pi Cluster setup considerations
February 19, 2021 | ClusterThere is a lot of tutorials out there about how to turn your Raspberry Pi's into a cluster. Before you do this yourself here are a couple of advices, depending of your goal with the project.
- If you do not have any particular reason to learn Kubernetes, use Docker Swarm! Kubernetes will just add and extra layer of complexity to something that is already complex. And a good understanding of Docker is still nessesary if you later choose to get into Kubernetes.
- Most tutorials out there uses K3s from Rancher, but even thou that will be the case, there are other great solutions. Personally i like Microk8s from Canonical (so far it has run more smooth for me than K3s) and basically most commands are still directly thru Kubectl as with K3s.
One of the big headaces with the Pi, is that it uses an ARM architecture and with the default Raspian OS it is actually only setup for an 32bit ARM architecture (even thou in Pi 4 the CPU is 64bit). You could either upgrade your existing Raspian OS to 64bit, or (nessesary for Microk8s) install another 64bit OS like Ubuntu's 64bit version.
Still after all of the above. A lot of pre-build images will cause failure, so consider building your own images with buildx (or better on your pi it self).
If you are going to play around with different databases your will have buggy ride, in particular if you are considering noSQL and HA area you may be better off trying to do this somewhere else.
Setting up a cluster on a Pi is fast and easy, but opperating it is more troublesome. So, don't be disappointed, but use it as a learning experience in Kubernetes (and it's almost free compared with the cloud providers).