+++ title = "Install Portefaix" description = "Instructions for deploying Portefaix infrastructure on Raspberry PI" weight = 10 +++
Setup operating system for Raspberry PI.
See: https://www.raspberrypi.org/software/
Or:
❯ sudo dd if=/dev/zero of=/dev/mmcblk0 conv=noerror status=progress
❯ sudo./hack/scripts/sdcard.sh <hostname> /dev/mmcblk0
Enable SSH :
❯ make -f hack/build/k3s.mk sdcard-mount ENV=homelab
❯ sudo touch /mnt/portefaix/boot/ssh
❯ echo portefaix-xxx | sudo tee /mnt/portefaix/root/etc/hostname
❯ make -f hack/build/k3s.mk sdcard-unmount ENV=homelab
Copy keys to each node:
ssh-copy-id -i ~/.ssh/id_rsa.pub pi@x.x.x.x
❯ make -f hack/build/k3s.mk ansible-deps SERVICE=ansible/k3s/machines ENV=homelab
❯ make -f hack/build/k3s.mk ansible-run SERVICE=ansible/k3s/machines ENV=homelab
Create the master :
❯ make -f hack/build/k3s.mk k3s-create ENV=homelab SERVER_IP=x.x.x.x
For each node, add it to the cluster, then add a label:
❯ make -f hack/build/k3s.mk k3s-join ENV=homelab SERVER_IP=x.x.x.x AGENT_IP=x.x.x.x
❯ kubectl label node <NODE_NAME> node-role.kubernetes.io/worker=
node/<NODE_NAME> labeled
Check Kubernetes cluster:
❯ make -f hack/build/k3s.mk k3s-kube-credentials ENV=homelab
❯ kubectl get node -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
portefaix-1 Ready control-plane,master 22m v1.24.6+k3s1 192.168.0.208 <none> Debian GNU/Linux 11 (bullseye) 5.15.61-v8+ containerd://1.6.8-k3s1
portefaix-2 Ready worker 12m v1.24.6+k3s1 192.168.0.116 <none> Debian GNU/Linux 11 (bullseye) 5.15.61-v8+ containerd://1.6.8-k3s1
portefaix-3 Ready worker 7m35s v1.24.6+k3s1 192.168.0.252 <none> Debian GNU/Linux 11 (bullseye) 5.15.61-v8+ containerd://1.6.8-k3s1
portefaix-4 Ready worker 3m11s v1.24.6+k3s1 192.168.0.234 <none> Debian GNU/Linux 11 (bullseye) 5.15.61-v8+ containerd://1.6.8-k3s1
Next: Gitops