DEPRECATED: Please see my pi-cluster project for active development, specifically the
ceph
directory in that project.
This repository contains examples and automation used in DeskPi Super6c-related videos on Jeff Geerling's YouTube channel.
You might also be interested in another Raspberry-Pi cluster I've maintained for years, the Raspberry Pi Dramble, which is a Kubernetes Pi cluster in my basement that hosts www.pidramble.com. I also set up a Turing Pi 2 Cluster in a similar fashion.
- Make sure you have Ansible installed.
- Copy the
example.hosts.ini
inventory file tohosts.ini
. Make sure it has thecontrol_plane
andnode
s configured correctly (for my examples I named my nodesdeskpi[1-6].local
). - Copy the
example.config.yml
file toconfig.yml
, and modify the variables to your liking.
I am running Raspberry Pi OS (64-bit, lite) on a set of six Raspberry Pi Compute Module 4s with 8GB of RAM and no built-in eMMC. I am using 32 GB SanDisk Extreme microSD cards to boot each node.
I flashed Raspberry Pi OS to the Pis using Raspberry Pi Imager.
To make network discovery and integration easier, I edited the advanced configuration in Imager (press Shift + Ctrl + X), and set the following options:
- Set hostname:
deskpi1.local
(set to2
for node 2,3
for node 3, etc.) - Enable SSH: 'Allow public-key', and paste in my public SSH key(s)
After setting all those options, making sure the hostname is unique to each node (and matches what is in hosts.ini
), I inserted the microSD cards into the respective slots on the underside of the board, and booted the cluster.
To test the SSH connection from my Ansible controller (my main workstation, where I'm running all the playbooks), I connected to each server individually, and accepted the hostkey:
ssh pi@deskpi1.local
This ensures Ansible will also be able to connect via SSH in the following steps. You can test Ansible's connection with:
ansible all -m ping
It should respond with a 'SUCCESS' message for each node.
Run the playbook:
ansible-playbook main.yml
TODO.
Run the upgrade playbook:
ansible-playbook upgrade.yml
TODO.
The safest way to shut down the cluster is to run the following command:
ansible all -B 500 -P 0 -a "shutdown now" -b
Then after you confirm the nodes are shut down, hold down the power button for about 5 seconds, and the board will power off the CM4 slots. Then you can switch off or disconnect your power supply.
The repository was created in 2022 by Jeff Geerling, author of Ansible for DevOps, Ansible for Kubernetes, and Kubernetes 101.