64bit Kubernetes Cluster on Raspberry Pi

In this manual I describe how to install and configure a 64bit Kubernetes Cluster on Raspberry Pi.

Why this tutorial?

Although the Raspberry Pi 3B+ has a 64bit ARM processor, the most linux distributions for Raspberry Pi 3B+ currently only work on a 32bit basis. This hardly leads to a lower performance, but limits the usability of software a little, because 32bit software can run on 64bit systems, but not vice versa, e.g. the Kubernetes Pod Network Add-On “Calico”.

Because I wanted to know if it is possible to run a 64bit Kubernetes Cluster on Raspberry Pi I decided to simply try it out.

Image preparation

First, a 64bit operating system is required for the Raspberry Pi. Since HypriotOS is a very good base for Docker on Raspberry Pi, and I also used it for my first Raspberry Pi Kubernetes Cluster, I searched for a 64bit variant of HypriotOS. I found this Github project by Dieter Reuter, which offers a HypriotOS image with 64bit support. For flashing this image to a MicroSD card I could use the original HypriotOS Flash Tool without any problems.

After the image was flashed, my Raspberry Pis started without any problems. Next I configured basic settings on all pis like user, timezone, hostname and updated all installed packages.

Kubernetes Setup

After the basic configuration was done, I followed the Kubernetes documentation for installing kubeadm, kubectl and the kubelet service. After everything was installed successfully, I set up the cluster with kubeadm. As Pod Network Plugin, I decided to give Calico a try. After downloading the Calico Manifest, some configuration (POD Network), I fed the configuration into the cluster with kubectl apply. After ~10 minutes of waiting and a temporary system load of > 20, everything was up and running. Not it’s time to join the other nodes into the cluster. After additional 5 minutes, kubectl get nodes reported all my Raspberry Pis to be up and running ūüôā

Websockets for Synology DSM

It’s happened to me several times now that an application I run on my DS 1817+ has problems with websockets. This is because I use the reverse proxy built into DSM, which does not support websockets by default. For this reason, here’s a little tutorial on how to enable Websockets for Synology DSM reverse proxy.

Enable Websockets in DSM Reverse Proxy

Actually, it is extremely easy to enable Websockets for Synology DSM reverse proxy:

  1. Open Control Panel > Application Portal
  2. Change to the Reverse Proxy tab
  3. Select the proxy rule for which you want to enable Websockets and click on Edit
  4. Change to the Custom Headers tab
  5. Add two entries in the list:
    • Name: “Upgrade”, Value: “$http_upgrade”
    • Name: “Connection”, Value: “$connection_upgrade”

Repeat these steps for every rule where you want to enable Websockets.

In my local setup, I need this for GitLab Mattermost (running within a docker container) and DSM Virtual Machine Manager Console.

Raspberry Pi Kubernetes Cluster

In order to gain experience with a Kubernetes cluster or to be able to experiment with it, a functioning cluster is required. Since most conceptual challenges do not require a high performance test cluster, it is also sufficient to build a smaller and therefore more cost-effective one. For this reason I decided to set up a Raspberry Pi Kubernetes Cluster for testing purposes.

Shopping List

If the Raspberry Pis are not to be connected via WLAN but cable, the corresponding network components are also required:

Set up

The website of Hypriot has a very good tutorial how to set up a Kubernetes cluster with Raspberry Pi boards: https://blog.hypriot.com/post/setup-kubernetes-raspberry-pi-cluster/. If you need some configuration examples (executable on a Raspberry Pi Kubernetes Cluster) please check out my GitHub repository with configuration examples: https://github.com/MatthiasLohr/kubernetes-rpi-examples.