-
Download Raspbian lite, look for most recent OS image –– unzip file
-
Use balena's Etcher to write the Raspbian image to an SD card; to install it on a Mac via Homebrew:
$> brew cask install balenaetcher
-
Launch
Etcher
and,- Select the downloaded, unzipped
.img
file - Select the SD card as the
target
(you already plugged it into your Mac, right?) - Click on
Flash!
- If prompted, enter your password to override the contents of the SD card
- Etcher will automatically
eject
the SD card
- Select the downloaded, unzipped
-
Re-mount the SD card (i.e., eject + reinsert it)
-
Create
/boot/ssh
file to allow SSH on RPi$> touch /Volumes/boot/ssh
-
Append IP settings to the end of
/boot/cmdline.txt
to hard-set the static IP configip=192.168.136.XX::192.168.136.1:255.255.255.0:eth0:false
Refer to this page for an explanation + configuration string format -
Unmount + eject SD card, pop it into a Raspberry-pi and boot
-
Repeat the previous 4 steps on each SDs per RPi available
-
On first boot, login as
pi
and useraspberry
as the default password$> ssh pi@192.168.136.33
-
Rejoice + enjoy!
Below are listed my cluster's current configuration specs:
Model | IP | Proc | CPU | Mem | Disk |
---|---|---|---|---|---|
RPI 3 Model B | 192.168.136.30 | armv7l | 4 | 1GB | 32GB |
RPI 3 Model B | 192.168.136.31 | armv7l | 4 | 1GB | 32GB |
RPI 3 Model B | 192.168.136.32 | armv7l | 4 | 1GB | 32GB |
RPI 3 Model B | 192.168.136.33 | armv7l | 4 | 1GB | 32GB |
RPI Model B+ | 192.168.136.34 | armv6l | 1 | 512MB | 8GB |
See: Raspberry Pi model comparison
-
Check for correct IP settings under
hosts.yml
, note that the master is tagged ask3s_master
and the agents ask3s_agent
-
Ensure you have
passlib
installed since we'll be resetting the RPi's passwords$> pip3 install passlib
-
Reset
pi
user's password and add the Ansible ssh key (you'll be prompted for the default password and the ssh key undervars/main.yml > ansible_ssh_key
will be added)$> ansible-playbook playbooks/reset_pi_password.yml
-
Ensure you can ssh to the RPi cluster, see
~/.ssh/config
sample excerpt below:Host 192.168.136.3* User pi IdentityFile ~/.ssh/ansible_rsa IdentitiesOnly yes PasswordAuthentication no StrictHostKeyChecking no UserKnownHostsFile=/dev/null ControlMaster auto ControlPath /tmp/%r@%h:%p LogLevel FATAL
-
Configure default RPis host settings (using your ssh key from now on)
$> ansible-playbook playbooks/configure_host.yml
-
Install k3s on all RPis (1 master + 3 agents)
$> ansible-playbook playbooks/k3s_install.yml
Kubernetes is all the rage these days but it's bloated as hell!
😱. I've had a small cluster of Raspberry Pis that I've used for all sorts of shenanigans (even trying to install Kubernetes on them 🙈) and ever since I've heard that the Rancher
guys managed to slash the bejesus out of k8s
it was just a matter of time before these puppies were going to be repurposed (once again!?! 😳).
Performance is great and what better way to get k8s in every IOT device in the world!
Next stop... getting rid of the OS altogether and running bare k3os on these RPis. 😏