Topics include Supply Chain Security, Vulnerability Management, Neat Tricks, and Contributor insights.
In part 7 we deployed Netdata and explored deploying Netdata to gain valuable insights into our cloud infrastracture.
In part 8 I will discuss how I upgraded my cluster from a 3 node Kubernetes cluster to a 6 node Kubernetes cluster by incorporating 3 Pi 5s as worker nodes. My goal with this entire series and project is to emulate as close as possible what an enterprise platform would look like using various solutions and what Ortelius can do once deployed in your cloud infrastructure. My focus is always to empower, sharpen other humans and do my best to break down complexity whilst being resourceful. A monumental task in itself.
The new Raspberry Pi 5 comes with greater processing power, substantially upgraded graphics performance which should really help with MLOP’s workloads when deploying your self-hosted platform (yet to test this thou) and USB C.
For a more in depth coverage go to this URL
For storage I opted for the Samsung EVO Plus 128GB MicroSD Card which would host Ubuntu 24.04.1 LTS Noble Numbat and for consolidated centralised storage I got 3 Western Digital My Passport 2TB USB 3 disks for each worker Pi which I will cover in another blog on how to use software defined storage to present them as a single block of storage to Kubernetes.
# cordons the node preventing workloads from being scheduled on the node
microk8s kubectl drain <node name> --ignore-daemonsets --delete-emptydir-data
# You will need to change the channel version to the latest version at the time
sudo snap refresh microk8s --channel <latest version>/candidate
# sudo snap refresh microk8s --channel 1.31.1/candidate
sudo reboot
# Uncordon tells Kubernetes that this node can be used to schedule workloads
microk8s kubectl uncordon <node name>
# microk8s kubectl uncordon pi01
kubectl get nodes
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
pi04 Ready <none> 9d v1.31.1 192.168.0.149 <none> Ubuntu 24.04.1 LTS 6.8.0-1013-raspi containerd://1.6.28
pi05 Ready <none> 9d v1.31.1 192.168.0.115 <none> Ubuntu 24.04.1 LTS 6.8.0-1013-raspi containerd://1.6.28
pi06 Ready <none> 9d v1.31.1 192.168.0.23 <none> Ubuntu 24.04.1 LTS 6.8.0-1013-raspi containerd://1.6.28
# Update Current System: Ensure your current installation is fully updated and old packages are cleaned out
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
# Begin the Upgrade: do-release-upgrade will manage the upgrade smoothly and interactively.
sudo do-release-upgrade -d
Rinse and repeat for each SD Card or USB flash stick
Right lets deploy those worker nodes by preparing our Raspberry Pi 5’s using a similar process from part01.
CHOOSE DEVICE
| CHOOSE OS
| CHOOSE STORAGE
Choose Raspberry Pi5
Choose Other general-purpose OS
Choose Ubuntu
Choose Ubuntu Server 24.04.1 LTS (64-bit)
Note: This will look different on your machine
Next
Use OS Customization by clicking: EDIT SETTINGS
Fill in the required info according to your specifications.
Remember to change the HOSTNAMES
pi04
| pi05
| pi06
before each installation of Ubuntu on the SD Card
(You can use whatever hostnames make sense to you)
Allow public-key authentication only
which I would recommend you need to do some extra steps.pub
extension here /Users/<your username>/.ssh
.pub
extension here C:\Users\username\.ssh
Allow public-key authentication only
.ssh/config
Host pi04.yourdomain.com
HostName pi04.yourdomain.com
AddKeysToAgent yes
IdentityFile ~/.ssh/<private key name>
User <your user>
Host pi05.yourdomain.com
HostName pi05.yourdomain.com
AddKeysToAgent yes
IdentityFile ~/.ssh/<private key name>
User <your user>
Host pi06.yourdomain.com
HostName pi06.yourdomain.com
AddKeysToAgent yes
IdentityFile ~/.ssh/<private key name>
User <your user>
This will allow SSH without a password onto each Pi like this ssh -i ~/.ssh/<your private key name> <your pi username@<your private ip or domain name>
for example ssh -i ~/.ssh/pis ortelius@pi04.pangarabbit.com
You can also reference this document from Github for an alternative explanation
Check the boxes specific to your needs.
Click YES
to apply the OS customisation settings
Rinse and repeat for each SD Card or USB flash stick
FYI
there are commands related to Kubectl
such as kubectl get nodes
which are run from your machineFYI
there are commands related to MickroK8s
such as sudo microk8s config
which are run on the Pis where MicroK8s is installedmkdir ~/.kube
sudo vi /boot/firmware/cmdline.txt
and add the following cgroup_enable=memory cgroup_memory=1
cgroup_enable=memory cgroup_memory=1 console=serial0,115200 dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 rootwait fixrtc quiet splash
sudo apt install linux-modules-extra-raspi
# Installs Microk8s, sets permissions and ownership to the current user on the .kube directory
sudo snap install microk8s --classic --channel=1.31/stable && sudo usermod -a -G microk8s $USER && sudo chown -f -R $USER ~/.kube
pi04
pi04
and run this command on pi04
sudo microk8s add-node
3 times
on the same node and each time you will need to copy the unique join instruction with the unique key
for each node you wish to join(NOT THE NODE YOU RAN add-node FROM)
--worker
flag as these are not to be joined as master nodes# Example from Canonicals docs
Use the '--worker' flag to join a node as a worker not running the control plane, eg:
microk8s join 192.168.1.230:25000/92b2db237428470dc4fcfc4ebbd9dc81/2c0cb3284b05 --worker
Rinse and repeat for each node
# cordons the node preventing workloads from being scheduled on the node
microk8s kubectl drain <node name> --ignore-daemonsets --delete-emptydir-data
# microk8s kubectl drain pi01 --ignore-daemonsets --delete-emptydir-data
SchedulingDisabled
kubectl get nodes
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
pi01 Ready,SchedulingDisabled <none> 85d v1.31.1 192.168.0.48 <none> Ubuntu 24.04.1 LTS 6.8.0-1013-raspi containerd://1.6.28
pi02 Ready,SchedulingDisabled <none> 85d v1.31.1 192.168.0.107 <none> Ubuntu 24.04.1 LTS 6.8.0-1013-raspi containerd://1.6.28
pi03 Ready,SchedulingDisabled <none> 85d v1.31.1 192.168.0.141 <none> Ubuntu 24.04.1 LTS 6.8.0-1013-raspi containerd://1.6.28
pi04 Ready <none> 9d v1.31.1 192.168.0.149 <none> Ubuntu 24.04.1 LTS 6.8.0-1013-raspi containerd://1.6.28
pi05 Ready <none> 9d v1.31.1 192.168.0.115 <none> Ubuntu 24.04.1 LTS 6.8.0-1013-raspi containerd://1.6.28
pi06 Ready <none> 9d v1.31.1 192.168.0.23 <none> Ubuntu 24.04.1 LTS 6.8.0-1013-raspi containerd://1.6.28
FYI make sure you backup your persistent volumes on the NFS server
You now have a 6 node Microk8s Kubernetes 1.31.1 cluster with 3 master nodes, 3 worker nodes all running Ubuntu 24.04.1 LTS Noble Numbat. Your master nodes can focus on Kubernetes logic and your worker nodes can focus on your applications and infrastructure workloads.
Happy alien hunting…..