Raspberry Pi Computing Cluster

Some Background

There are a number of approaches to parallel cluster processing.

Setup

On a fresh RPi here are the steps

  • Install Python 3, remove Python 2
  • Install Docker
  • Install Kubernetes
  • Flannel - Virtual network that attaches IP addresses to containers
  • Kind - A tool for running local Kubernetes clusters using Docker container “nodes”

Docker

Get Started with Docker on Raspberry Pi

An automated script maintained by the Docker project will create a systemd service file and copy the relevant Docker binaries into /usr/bin/.

sudo curl -sSL https://get.docker.com | sh

Set Docker to auto-start:

sudo systemctl enable docker

Or start Docker manually:

sudo systemctl start docker

The Docker client can only be used by root or members of the docker group. Add pi or your equivalent user to the docker group:

sudo usermod -aG docker pi

Test the Docker install by downloading and running Alpine Linux:

docker run -ti arm32v6/alpine:3.5 /bin/sh

Note that Docker creates a new docker0 network interface.

Kubernetes

Setup Kubernetes on a Raspberry Pi Cluster

First, trust the kubernetes APT key and add the official APT Kubernetes repository on every node:

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg > apt-key.gpg
sudo apt-key add apt-key.gpg
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list

Install kubeadm on every node:

apt-get update
apt-get install -y kubeadm