In this tutorial I will go over how to install and setuo MetalLB for on-prem implementation.


  1. Kubernetes cluster either K8S or K3S.

Installing MetalLB

kubectl apply -f
kubectl apply -f
kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)"

NOTE: Above example was used from here

Validate deployments by executing below command:

kubectl get pods -n metallb-system
NAME                          READY   STATUS    RESTARTS   AGE
controller-5854d49f77-p6q5w   1/1     Running   0          106s
speaker-tt29h                 1/1     Running   0          106s
speaker-fggsk                 1/1     Running   0          106s
speaker-wb4nl                 1/1     Running   0          106s
speaker-8gjtj                 1/1     Running   0          106s

Apply network configurations

Create a file called metallb-config.yaml and enter below values:

apiVersion: v1
kind: ConfigMap
    namespace: metallb-system
    name: config
  config: |
    - name: default
      protocol: layer2

Apply changes:

sudo kubectl apply -f metallb-config.yaml

And you are done!