🛠 Cluster Kubernetes : quatre CM3+ sur une Turing Pi
Objectives
The SODIMM format of the CM3+ enabled a family of cluster boards: the Turing Pi v1 hosts four Compute Module units (including the CM3+) with Ethernet, redundant power supply, and per-node power control. The reference build is Jeff Geerling's (repository geerlingguy/turing-pi-cluster, which explicitly lists "Raspberry Pi Compute Module 3+ and HypriotOS"): a four-node K3s cluster. This tutorial follows that approach: flashing HypriotOS, booting the four nodes, installing K3s, and deploying across multiple nodes.
Hardware
- Turing Pi v1 board + 4 CM3+ modules (eMMC recommended for reliability)
- Turing Pi power module + 4 Ethernet cables
- Host PC with the HypriotOS flashing toolchain (sd-card-tool or flash script)
- The reference repository: github.com/geerlingguy/turing-pi-cluster (archived in favor of Turing Pi 2/CM4, but the CM3+ method remains documented)
Complete Code
# 1. Flasher HypriotOS (images Pi 3 compatibles CM3+) sur les 4 eMMC via usbboot
# (un module à la fois en device-boot, comme pour tout CM à eMMC)
export HIPRIVE=192.168.1.0/24
flash --hostname node1 --addr 192.168.1.11 hypriotos-rpi-v1.8.0.img.zip
# 2. Installer K3s sur le serveur (node1), les agents rejoignent via token
# Sur node1 :
curl -sfL https://get.k3s.io | sh -s - server --write-kubeconfig-mode 644
cat /var/lib/rancher/k3s/server/node-token
# 3. Sur node2-4 : rejoindre le cluster
curl -sfL https://get.k3s.io | K3S_URL=https://192.168.1.11:6443 \
K3S_TOKEN=<token> sh -
# 4. Vérifier et déployer
kubectl get nodes -o wide
kubectl create deployment nginx --image=nginx --replicas=4
kubectl get pods -o wide # les 4 pods doivent se répartir sur les 4 nœuds
Expected Verification
kubectl get nodes lists 4 Ready nodes (1 server + 3 agents), each with its static HypriotOS IP address. The nginx deployment with 4 replicas is distributed across the four modules — proof that the cluster is working. The Turing Pi allows shutting down a node via its power control: the pod restarts elsewhere within seconds.
Common Errors
- Using an image older than November 2018: the CM3+ will not boot — check the date of the HypriotOS/Raspberry Pi OS image used.
- 1 GB of RAM per node without memory limits: K3s + pods must be bounded (resources.limits), otherwise the agent gets OOM-killed at the first spike.
- Fluctuating DHCP IP addresses: pin the addresses (HypriotOS cloud-init), otherwise the K3s server certificate no longer matches the IP and agents are rejected.
- Undersized power supply: 4 × CM3+ under CPU load + 4 Ethernet PHYs exceed a poor-quality power brick — use the power module designed for the board.
- Expecting the performance of a CM4/CM5 cluster: no gigabit (USB 2.0 bus per node), 1 GB of RAM, 1.2 GHz — this cluster is for learning Kubernetes, not for serving a high-traffic website.
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash