deskpi-super6c-cluster
deskpi-super6c-cluster copied to clipboard
DEPRECATED - DeskPi Super6c 6-node Raspberry Pi CM4 Cluster
DeskPi Super6c 6-node Pi Cluster
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.
Usage
- Make sure you have Ansible installed.
- Copy the
example.hosts.iniinventory file tohosts.ini. Make sure it has thecontrol_planeandnodes configured correctly (for my examples I named my nodesdeskpi[1-6].local). - Copy the
example.config.ymlfile toconfig.yml, and modify the variables to your liking.
Raspberry Pi Setup
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 to2for node 2,3for 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.
SSH connection test
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 [email protected]
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.
Cluster configuration
Run the playbook:
ansible-playbook main.yml
TODO.
Upgrading the cluster
Run the upgrade playbook:
ansible-playbook upgrade.yml
Monitoring the cluster
TODO.
Shutting down the cluster
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.
Author
The repository was created in 2022 by Jeff Geerling, author of Ansible for DevOps, Ansible for Kubernetes, and Kubernetes 101.