Kubernetes State for my home RPI cluster
There's a cluster bootstrap layer that builds a cluster, a cluster kernel with the core bits and pieces (networking, observability, etc), and then the apps layer with the actual workloads for doing actual things.
The bootstrap.sh script installs K3S on one master node, and N worker nodes -
a minimum of two workers is strongly suggested.
Once this runs, you will technically have a live cluster, though it won't work yet.
This installer script can fetch whatever version of Kubernetes specified, but will
default to v1.21.0+k3s1.
Calico is the Container Network Interface used in this setup. It's used to handle traffic routing and serves as the transport fabric within the cluster.
Load balancing layer. Allows pods to expose arbitrary ports outside of the cluster.
From here.
HTTP proxy for simply exposing web services outside of the cluster. Runs on top of the load balancer layer.
From here.
This allows pods to mount the same persistent storage volumes from any node in the cluster.
There is some prerequisite setup, however - you must have a running NFS server, configured so that the nodes all have access to it, and the nodes all need to have the NFS client installed and configured too.
Then, just sub in the NFS server's IP/hostname and mount path in deployment.yaml and you're good to go.
This came from here.
When a service exposes a port outside the cluster via either an ingress or a loadbalancer, this service will create an externally-visible DNS entry for it.
From here.
This service will register Lets Encrypt TLS certs for services.
From cert-manager.io
This is a bunch of stuff for collecting, viewing, and using metrics and data, both from the cluster and elsewhere.
Built from this repo.
The setup bits install the Prometheus Operator, which makes it a lot simpler to set up all of the monitoring infrastructure, rules, and components.
Lives here.
Metrics collection and scraping from other services.
From here.
Exports metrics from the core K8S metrics service for Prometheus to consume.
From here.
Monitoring definition for metrics from the load balancer layer.
Basically an external exporter for the Kubernetes API server.
Export node-level metrics about the machines that are running stuff.
From here.
Exports temperature readings from the raspberry pi nodes.
Dashboards and graphs for Prometheus data.
Frrm here.
Send alerts and notifications based on metrics data.
From here.
Downloads media. D'doy.
Built from doomgerbil/mediadownloader.
A wireguard-based VPN server.
Uses docker-wireguard.
Metrics exporter for TPLink smart-home power data.
Exports power usage data from the smart plug this cluster is plugged into.
Prometheus metrics exporter for the Philips Hue smartlighting system.