Load Balancer (Kubernetes)

In a previous blog post (K3s Cluster) I wrote how my K3s Cluster sat and waited for an external IP address and never got one. There are solutions for this when running a K3s Cluster, or running a Kubernetes via MicroK8s.

MetalLB

MetalLB is a load balancer for use in Kubernetes, which helps those running Kubernetes outside of a cloud provider.

K3S Install (via Helm)

MetalLB advises it has some issues with K3S, in that Klipper needs disabling before MetalLB can be used:

See: https://metallb.io/configuration/k3s/

The Helm package manager can be used to install MetalLB:

helm repo add metallb https://metallb.github.io/metallb
helm install metallb metallb/metallb

Micro K8s Install

For Micro K8s it only takes a brief command to enable MetalLB:

microk8s enable metallb

Or if you want to limit what addresses MetalLB uses:

microk8s enable metallb:192.168.2.1-192.168.2.100

This command enables MetalLB and tells it to use IP addresses in the range of 192.168.2.1 to 192.168.2.100.

Address Pools

If you have public IP addresses (which can be expensive) you may want to limit when these are used. MetalLB gives examples of how to assign different IP Address pools:

https://metallb.io/usage/example/

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Welcome to GeekTechStuff

my home away from home and where I will be sharing my adventures in the world of technology and all things geek.

The technology subjects have varied over the years from Python code to handle ciphers and Pig Latin, to IoT sensors in Azure and Python handling Bluetooth, to Ansible and Terraform and material around DevOps.

Let’s connect