Tips for Running a Kubernetes Cluster on Raspberry Pi

This small post is a continuation of the article on creating a Kubernetes cluster on the Raspberry Pi, which describes a fully automated build with code. It is difficult to surprise Khabravchan, but the author talks about what, he hopes, you did not know or thought about until today.


Temperature control

Like any computing device, the Raspberry Pi single board computer can overheat – the more load it is, the more actively it generates heat. The Raspberry Pi comes with only the board itself and nothing else.

I did this: I overlaid the board with radiators, and at first it helped me out. The radiators worked pretty well, but only until I decided to try slightly heavier applications on the cluster.

After a little research, I found dedicated fan SHIM Pimoroni for Raspberry Pi… This fan is perfect for my cluster structure and does not require additional spacers to increase the Pi’s board height. To control the operation of the fans, you can use code from my previous article by modifying it to suit the management goals.

The fans work great, especially in conjunction with radiators. I was so pleased with them that at first I didn’t even pay attention to their LED indication. The heat goes up, so the bottom of the Pi in the integrated design heats up the top.

After I placed the boards horizontally (I did just that, nothing else), the temperature dropped by 10 degrees (!).

Data storage and durability

Running the Raspberry Pi from a memory stick can, by definition, cause problems. Fortunately, for almost the entire year that I have Kubernetes running on my Raspberry Pi, I have not experienced any problems; but there were cases when, with certain configuration settings, the write speed on the main board dropped to 30 kbps, and on working boards – to 5 kbps.

I use NFS as storage: I have a free, perfectly working Intel NUC mini-computer, and I configured it as a network storage, so I can restrict writing to the memory cards of the boards, and using the utility log2ram you can protect yourself even more.

I work with large memory cards, so I need the whole system to work stably for quite a long time.

Note on memory cards: I am using SanDisk Extreme Pro 128GB, A2, UHS-I, U3, V30 for several reasons.

First: the more free space, the less likely the entire card will fail, and the second reason is lifetime warranty to Sandisk memory cards, which, in the event of a failure of the entire cluster, will save me two additional Raspberry Pi. To avoid unwanted delays if a failure does occur, I advise you to always have a backup memory card on hand. You never know in advance when you might need it.

Networking

Cluster nodes, as a rule, often communicate with each other, so you need to somehow prevent thermal throttling without overloading the rest of the network with unnecessary traffic. In this case, I highly recommend using an additional Gigabit switch (managed or unmanaged), especially if the Pi is in constant contact with the NFS server.

Idle Cluster Network Traffic
Idle Cluster Network Traffic

Connecting the cluster directly to a home Wi-Fi router, especially a typical router from an ISP, is not a good idea, since the characteristics of such routers leave much to be desired, because they are optimized for the average user.

Network resource usage by an active cluster
Network resource usage by an active cluster

If you are interested in networking aspects, check out my previous article in which I described in detail setting up my home network

Food

Raspberry Pi power consumption according to raspi.tv
Raspberry Pi power consumption according to raspi.tv

The Raspberry Pi uses almost no power and has high quality connectors, so I decided to use a power supply with multiple outlets. My choice fell on RAVPower Official – 60W power supply (link to Amazon). It does a great job: with six Raspberry Pi connected, I didn’t have a single power outage.

The device has one “input”. It is not only tiny, but also very convenient: connecting to a UPS has become much easier than using a standard extension cord with several outlets. Another tip: keep power cords as high quality as possible and as short as possible to avoid malfunctions. In addition, I recommend turning off Wi-Fi on the Raspberry Pi, as this function, albeit a little, but consumes energy.

Overclocking the Pi

Overclocking your Raspberry Pi may void your warranty!

After the obligatory warning, I want to touch on the topic of adjusting the Pi parameters. Yes, overclocking the Pi is easier than you might think. This can be done simply by changing the parameter values ​​of the /boot/userconfig.txt file used by rPI (and included in /boot/config.txt) during the boot process.

#uncomment to overclock the arm. 700 MHz is the default.
over_voltage=2
arm_freq=1750

More details on overclocking processors can be found in this articleas well as in official instructionsalthough your PI will most likely be grateful that you install at least a few heatsinks and fans on it first.

And with that, how to pump in DevOps or in algorithms – can be found on our website, where you can also download course programs to get an idea of ​​what you have to learn.

find outhow to level up in other specialties or master them from scratch:

Other professions and courses

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *