⎈ Kubernetes Bare Metal - Introduction ⎈#
400 words | 5 min read
I decided to try my hand at installing Kubernetes on a few small computers in my home lab. I did not want to virtualize anything, to reduce the number of layers of virtualization.
I decided to build a 3-node cluster with a Raspberry Pi 4 as the master node (or Control Plane) and a couple of Small Form Factor PCs as the worker nodes
After a lot of reading, and trials and errors, I finally decided to set up the following:
Additionally, I also decided to configure BGP on my router (OPNSense) and to use the Kubernetes Gateway API (instead of Ingress) to expose the various services.
A lot of what I learnt, came from other articles and posts, among them:
Additionally, I read a lot of the documentation for Kubernetes, Longhorn, OPNSense… and eventually came up with a set of steps to set up everything the way I wanted.
So, here are the main steps in putting everything together:
Install Almalinux on each node (The RPi4 as well as the mini PCs)
Configure BGP networking
Install K3S on the master node
Install k3s on the worker nodes
Install Cilium
Enable Hubble Observability & Gateway for external access to the UI
Install Longhorn Gateway for external access to the UI
Configure persistent storage in Longhorn for NGinx
In the next few articles, we will go through each of these steps in more detail.
Note
I also tested the cluster with k8s before going with k3s. The steps are a bit different to install k8s, but you can get a working baremetal k8s cluster too, if you wish.
I built, destroyed and re-built the cluster so many times before I got it to my satisfaction that I ended up with a number of scripts and configuration files to make my life easier.
Today, I am able to create the cluster in about 30-40 minutes, with most of the time being in waiting for the pods to finish starting. I will share these too, as we go along.
I hope to also configure ansible or salt (someday) to automate the setups - but that is a project for another day.
I hope these steps will help you set up a Kubernetes cluster for your own Journey in using Kubernetes for your own purposes.
Comments
Comments powered by giscus, use a GitHub account to comment.