1. Preparing Raspberry Pis & Docker Swarm Setup - nerdily/Raspberry-Pi-Docker-Swarm GitHub Wiki
Preparation (greatly shortened - if this is too much, stop here and go learn)
- Download 64-bit Ubuntu Server for Raspberry Pi
- Flash SD cards with Etcher or other utility
- Boot up
OS Setup
- Setup certificate-based SSH
- Update each Pi with
sudo apt-get update && sudo apt-get upgrade
- Configure Pi and set up hostname, localization (time zone, language) etc.
- Ensure static IP is setup either via DHCP reservation or traditional static IP configuration.
- Reboot
- Ensure on each node that all members of the cluster have an entry in
/etc/hosts
.
Install Docker on each Pi
- Follow the Ubuntu installation instructions here using the apt repsitory
sudo usermod -aG docker (username)
Start the Docker Swarm. On the Docker Manager:
docker swarm init
Join Docker Workers to the Swarm. On each Worker node:
swarm join --token (token) (manager):2377
This command should be generated from the Docker Manager
Docker Status
docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
jyhbh7ftvquajdyf8goqjrd76 * dock-master-01 Ready Active Leader 24.0.2
md5jkf5dzilrfeimgj4c1jwsb dock-worker-01 Ready Active 24.0.2