Cluster node

Steps to add a node to the cluster from scratch

  1. Flash the lastest 64bit Ubuntu server to the sd-card using RPI Imager

Use the following standard settings:

  • lemoen#.local
  • Set SSH to on:
  • username: evertjanstamhuis
  • password: generate one and store in keyvault
  • Wifi: switch on and set wifi ssid and password

Place the sd-card and boot the divice. check the router for IP-adress

SSH setup:

ssh into the new rpi:

ssh evertjanstamhuis@{ip-address}

login with the password to check if it works.

exit again

create a new ssh id with the following command:

$ ssh-keygen

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/evertjanstamhuis/.ssh/id_rsa): /Users/evertjanstamhuis/.ssh/id_lemoen#

replace the # with the node number

Copy the ssh-key to the node

ssh-copy-id -i ~/.ssh/lemoen# evertjanstamhuis@lemoen#.local

add an entry to the ssh config

nano ~/.ssh/config

add an entry with the following info:

Host lemoen#
    Hostname 192.168.86.#
    User evertjanstamhuis
    IdentityFile ~/.ssh/id_lemoen#

now SSH into the node with $ ssh lemoen3

Update ubuntu

evertjanstamhuis@lemoen3:~$ apt-get update
evertjanstamhuis@lemoen3:~$ apt-get upgrade

NOTE: Ubuntu It is recommended to turn off ufw (uncomplicated firewall):

ufw disable If you wish to keep ufw enabled, by default, the following rules are required:

ufw allow 6443/tcp #apiserver ufw allow from 10.42.0.0/16 to any #pods ufw allow from 10.43.0.0/16 to any #services

evertjanstamhuis@lemoen3:~$ sudo apt install linux-modules-extra-raspi

INSTALL K3S

Label the worker

kubectl label nodes lemoen# kubernetes.io/role=worker

Check if everything works well

kubectl get nodes