Deploy MetalLB Load Balancer Controller

In this section you will configure and deploy MetalLB Load Balancer Controller.

MetalLB is a load-balancer implementation for bare metal Kubernetes clusters, using standard routing protocols.

See also

What You’ll Need

Procedure

  1. Go to your GitOps repository, inside your rok-tools management environment:

    root@rok-tools:~# cd ~/ops/deployments
  2. Specify the IP pool range that you want MetalLB to use:

    root@rok-tools:~/ops/deployments# export METALLB_ADDRESS_POOL=<POOL>

    Replace <POOL> with your IP pool range. For example:

    root@rok-tools:~/ops/deployments# export METALLB_ADDRESS_POOL=10.0.0.1-10.0.0.128
  3. Configure the on-prem overlay to use your address pool:

    root@rok-tools:~/ops/deployments# j2 \ > rok/metallb/overlays/on-prem/ip-address-pool.yaml.j2 \ > -o rok/metallb/overlays/on-prem/ip-address-pool.yaml
  4. Specify the platform to use:

    root@rok-tools:~/ops/deployments# export PLATFORM=on-prem
  5. Configure the deploy overlay to use the on-prem overlay:

    root@rok-tools:~/ops/deployments# j2 \ > rok/metallb/overlays/deploy/kustomization.yaml.j2 \ > -o rok/metallb/overlays/deploy/kustomization.yaml
  6. Commit your changes:

    root@rok-tools:~/ops/deployments# git commit \ > -am "Configure MetalLB Load Balancer Controller"
  7. Apply the kustomization:

    root@rok-tools:~/ops/deployments# rok-deploy --apply rok/metallb/overlays/deploy

Verify

  1. Verify that MetalLB Pods are up and running. Check Pods status and verify field STATUS is Running and field READY is 1/1:

    root@rok-tools:~/ops/deployments# kubectl -n metallb-system get pods NAME READY STATUS RESTARTS AGE controller-6c58495cbb-ll796 1/1 Running 0 54s speaker-c4gnp 1/1 Running 0 50s speaker-fvqqn 1/1 Running 0 51s speaker-hxtpr 1/1 Running 0 19s speaker-pftp4 1/1 Running 0 52s

Summary

You have successfully deployed MetalLB Load Balancer Controller.

What’s Next

The next step is to configure and install the NGINX Ingress Controller.