This repo will help you setup a basic Kubernetes cluster using Raspberry Pis
- Get 2 or more Raspberry Pi 4's plus SD cards (I went with 32GB)
- Download "raspbian buster lite" image: https://www.raspberrypi.org/downloads/raspbian/
- Flash each of your cards
- Copy the contents of setup-files onto the "boot" partition of the SD card, which should be mounted on your machine. (this includes a folder of scripts and a file called ssh which enables you to ssh in without needing a monitor/keyboard etc.)
- Copy script folder from this repo to boot partition
- Put cards in Pis
- Power on first pi (we do one by one so we can figure out IPs)
- Figure out the IP - your router or some IP scanner software can help
- ssh in using username pi and password raspberry
- Note you need to think about your IP addresses, I used my router to assign IP's based on mac-address - you may wish to make them static - if so see
/boot/scripts/set-ip.sh
- Run
/boot/scripts/init-master.sh
- Copy contents of /etc/kubernetes/admin.conf to your local machine as $HOME/.kube/config
- Power on another pi (we do one by one so we can figure out IPs)
- Figure out the IP - your router or some IP scanner software can help
- ssh in using username pi and password raspberry
- Run
sudo echo "192.168.1.39 master1.kube.local" >> /etc/hosts
- substitute the IP address with your master node IP - Run
/boot/scripts/init-node.sh node1
(change node number as you do each one) - Repeat for each node
Reboot all the Pis as some changes need this