Config for the Raspberry PI cluster
- Download Raspberry Pi Imager from: https://www.raspberrypi.com/software/
- Install Raspbian OS lite (64bit)
- Take the card out and fire up the Pi
ssh-copy-id [email protected]
ssh-copy-id [email protected]
ssh-copy-id [email protected]
ssh-copy-id [email protected]
Enable containers:
Edit /boot/firmware/cmdline.txt
and add the following to the end of the line:
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
Disable Swap:
sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove
sudo apt purge dphys-swapfile
Update:
sudo apt-get update && sudo apt-get upgrade -y
sudo reboot
ssh [email protected]
/usr/local/bin/k3s-uninstall.sh
ssh [email protected]
/usr/local/bin/k3s-agent-uninstall.sh
curl -sLS https://get.k3sup.dev | sh
sudo install k3sup /usr/local/bin/
k3sup install --ip 192.168.50.12 --user pi --k3s-channel latest --k3s-extra-args '--disable traefik --disable servicelb' --context pi-new --merge --local-path .kube/config --ssh-key ~/.ssh/id_ed25519
k3sup join --ip 192.168.50.11 --server-ip 192.168.50.12 --user pi --k3s-channel latest --ssh-key ~/.ssh/id_ed25519
k3sup join --ip 192.168.50.13 --server-ip 192.168.50.12 --user pi --k3s-channel latest --ssh-key ~/.ssh/id_ed25519
k3sup join --ip 192.168.50.14 --server-ip 192.168.50.12 --user pi --k3s-channel latest --ssh-key ~/.ssh/id_ed25519
curl -s https://fluxcd.io/install.sh | sudo bash
Generate a PAT token for GitHub
export GITHUB_TOKEN=<token>
export GITHUB_USER=TheEadie
flux bootstrap github --owner=$GITHUB_USER --repository=k8s-cluster --branch=master --path=./pi-cluster/cluster/base --personal
Following the guide here: https://fluxcd.io/docs/guides/mozilla-sops/
To recover load the private key from Keeper back into the cluster.
Revert the commit to remove the decryption from the manifests that was auto-generated by the bootstrap
above.
To encrypt new secrets run:
gpg --import ./pi-cluster/.sops.pub.asc
sops --encrypt --in-place <filename>.yaml