Starting out with Raspberry Pi experiments
This post provides some background to why I've started to experiment with Raspberry Pis, and to list the hardware components that I bought and set up with my son Joseph over the Christmas holidays.
This is a post in the "Brambleweeny Cluster Experiments" series of blog posts, which accompanies the YouTube live stream recording playlist of the same name.
Next post in this series: Preparing the OS image
I've been skirting around the edges of experimentation with Raspberry Pis, to learn about clustering and containerisation using such technologies as Docker and Kubernetes. The topic area is fascinating in and of itself, but I think it's an important collection of subjects that one should know about in the SAP tech world too, given the cloud direction we're taking and how resources, services and applications are managed there.
I haven't gone too deep yet, having paused the project over the first couple of months of 2020 - I think one of the things holding me back was that I had stumbled my way through things at the start and wanted to hold off going further before I'd understood things a little more.
Here's a photo of the cluster that we built.
I know that writing about my activities helps my understanding, and so I thought I'd set out to write some posts about what I'm doing. As a bonus, they might help you too.
I've been learning a lot from two folks in particular, both of whom I came across, independently, from recordings of talks I saw them give.
Jeff Geerling gave a talk at DrupalCon in 2019 called Everything I know about Kubernetes I learned from a cluster of Raspberry Pis, which inspired me to put together my own cluster of Raspberry Pis. Clusters of Raspberry Pis are called brambles, which I think is a nice touch. Jeff named his cluster a Dramble, owing to the use of Drupal on it, and has some great resources at pidramble.com. Moreover, I've been learning about Ansible from Jeff too, generally but also specifically for setting up the Pis. I even bought his book Ansible for Kubernetes which I can definitely recommend.
Jeff documented his hardware setup over on the PiDramble site, and in particular I went for a version of his 2019 Edition which was to use power-over-ethernet (PoE) rather than running individual power cables to each Pi.
Alex Ellis has been doing some fascinating work in this space and sharing a ton of stuff on Kubernetes, serverless and in particular on OpenFaaS which he set up and runs as an open project. He's also a prolific writer and sharer, and I recommend you bookmark a few of his articles which are rich in content and inspiration. I saw a recording of a talk he gave with Scott Hanselman at NDC London in 2018: Building a Raspberry Pi Kubernetes Cluster and running .NET Core, which is definitely worth a watch.
To set my cluster up, here's what I ended up buying:
- Raspberry Pi 4 (4GB RAM version) x 4
- Raspberry Pi PoE HAT x 4
- Samsung EVO Plus 32GB microSDHC memory card with adapter x 4
- Short (25cm) CAT6 Ethernet cables x 4
- Techson 4 Layers Clear Acrylic Rack Case
- NETGEAR 5-Port Gigabit Ethernet PoE Switch
There are plenty of cases and mounting possibilities; just make sure, if you go for something different, that there's room for the PoE HAT mounted on top of each of the Pis.
I'm pleased with the result as there's a lot less cabling to deal with - it's just a single ethernet cable from the switch to each Pi, an ethernet cable from the switch to the main network, plus the power supply and cable to the switch, and that's it.
You can see this in the photo I took yesterday, which also shows an original Raspberry Pi Model B that I used as a console for various things.
The setup is compact and I can keep it on a shelf behind my main desk. I'm somewhat averse to fan noise, which does mean that I don't run the cluster all the time, as there are fans on the PoE HATs that come on now and again. But the lights are pretty!
The next post I want to write is about how I set up the Pis ready for the cluster experiments, and what I learned. Until then, you might want to take a look at the recording of a live stream from earlier this month where I just went ahead and followed Alex's blog post Walk-through — install Kubernetes to your Raspberry Pi in 15 minutes. The key takeaway for me was that it was very easy.
The live stream was the first in what may turn out to be a series of cluster experiment live streams, so I've put the video into a playlist to help you find them.
The playlist is called Brambleweeny Cluster Experiments, where the name "Brambleweeny" is a conflation of the "Bramble" name for a Pi cluster, and the name of a computer in the Hitch Hiker's Guide To The Galaxy, the "Bambleweeny 57 Submeson Brain".
Until next time, happy clustering!
Next post in this series: Preparing the OS image