- burn raspbian image to sdcard
- remove and insert sdcard
touch /boot/ssd
- repeat for all sdcards
- grab both (eth and wlan) mac addresses from your raspberries
- plan your network
-
Device | hostname | MAC | IP -------------------------------------------------------------- RPI 1 (ETH) | pi-node-01 | 00-00-00-00-00-01 | 192.168.15.11 RPI 1 (WLAN) | pi-node-01 | 00-00-00-00-00-02 | 192.168.15.21 -------------------------------------------------------------- RPI 2 (ETH) | pi-node-02 | 00-00-00-00-00-03 | 192.168.15.12 RPI 2 (WLAN) | pi-node-02 | 00-00-00-00-00-04 | 192.168.15.22 -------------------------------------------------------------- RPI 3 (ETH) | pi-node-03 | 00-00-00-00-00-05 | 192.168.15.13 RPI 3 (WLAN) | pi-node-03 | 00-00-00-00-00-06 | 192.168.15.23 -------------------------------------------------------------- RPI 4 (ETH) | pi-node-04 | 00-00-00-00-00-07 | 192.168.15.14 RPI 4 (WLAN) | pi-node-04 | 00-00-00-00-00-08 | 192.168.15.24 -------------------------------------------------------------- RPI 5 (ETH) | pi-node-05 | 00-00-00-00-00-09 | 192.168.15.15 RPI 5 (WLAN) | pi-node-05 | 00-00-00-00-00-0A | 192.168.15.25 -------------------------------------------------------------- RPI 6 (ETH) | pi-node-06 | 00-00-00-00-00-0B | 192.168.15.16 RPI 6 (WLAN) | pi-node-06 | 00-00-00-00-00-0C | 192.168.15.26 -------------------------------------------------------------- RPI 7 (ETH) | pi-node-07 | 00-00-00-00-00-0D | 192.168.15.17 RPI 7 (WLAN) | pi-node-07 | 00-00-00-00-00-0E | 192.168.15.27 -------------------------------------------------------------- RPI 8 (ETH) | pi-node-08 | 00-00-00-00-00-0F | 192.168.15.18 RPI 8 (WLAN) | pi-node-08 | 00-00-00-00-00-10 | 192.168.15.28 --------------------------------------------------------------
-
- for each network interface, assign the MAC with a fixed ip for both eth and wlan on your router
- login as
piwith passwordraspberry sudo apt-get updatesudo apt-get upgrade
sudo passwd- set a new password and take note
sudo raspi-config- network options
- hostname
- fill
- wireless lan
- fill
- hostname
- advanced options
- expand filesystem
- memory split -> set to 16
- localisation options
- timezone
- fill
- timezone
sudo nano /etc/ssh/sshd_config- set
PermitRootLogintoyes
- set
sudo passwd root- set the new password
sudo reboot
- login as
rootwith the new password usermod -l wolfulus pigroupmod -n wolfulus pimv /home/pi /home/wolfulususermod -d /home/wolfulus wolfulushistory -clogout
- login as
wolfuluswithpipassword mkdir -p ~/.sshchmod 700 ~/.sshcurl -L https://github.com/wolfulus.keys >> ~/.ssh/authorized_keyschmod 644 ~/.ssh/authorized_keyssudo nano /etc/ssh/sshd_config- comment
PermitRootLogin yesline - set
PubkeyAuthenticationtoyes - set
RSAAuthenticationtoyes - set
AuthorizedKeysFileto.ssh/authorized_keys - set
PasswordAuthenticationtono - set
PermitEmptyPasswordstono - set
PrintLastLogtono - set
Bannerto/var/banner
- comment
sudo apt-get install figletsudo bash -c "echo wolfulus.com | figlet >> /var/banner"sudo nano /etc/update-motd.d/10-uname- update as needed, usually
#!/bin/sh hostname | figlet uname -snrvm
- update as needed, usually
sudo service ssh restarthistory -c
- repeat for every machine
-
append
cgroup_memory=1 cgroup_enable=memoryto/boot/cmdline.txt -
sudo iptables -F -
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy -
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy -
sudo reboot
- login into master
curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644 --flannel-iface tailscale0- append
--disable traefik --disable servicelbto be able to use nginx and/or any hostport ingress controller instead - append
--disable local-storageto be able to change the location local-storage will create PVs- use
helmto install local-path-provisioner
- use
- append
sudo chown wolfulus:wolfulus /etc/rancher/k3s/k3s.yamlsudo cat /var/lib/rancher/k3s/server/node-token- take note
- login into the worker machine
curl -sfL https://get.k3s.io | K3S_URL=https://<SERVER-IP>:6443 K3S_TOKEN=<TOKEN> sh -s - --flannel-iface tailscale0- repeat for every worker machine
- login into master
kubectl get nodes
- just install tailscale on each node and have an agent (or server) running it too on a cloud provider instead.