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
- MetalLB official documentation.
Fast Forward
If you have already deployed MetalLB Load Balancer, expand this box to fast-forward.
- Procced to the Verify section.
Overview
What You’ll Need¶
- A configured management environment.
- Your clone of the Arrikto GitOps repository.
- An existing Kubernetes cluster on your premises.
Procedure¶
Go to your GitOps repository, inside your
rok-tools
management environment:root@rok-tools:~# cd ~/ops/deploymentsSpecify 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.128Configure 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.yamlSpecify the platform to use:
root@rok-tools:~/ops/deployments# export PLATFORM=on-premConfigure the
deploy
overlay to use theon-prem
overlay:root@rok-tools:~/ops/deployments# j2 \ > rok/metallb/overlays/deploy/kustomization.yaml.j2 \ > -o rok/metallb/overlays/deploy/kustomization.yamlAir Gapped
Patch the kustomization to use the mirrored images:
root@rok-tools:~/ops/deployments# rok-image-patch \ > --kustomizations rok/metallb/overlays/deployFollow the on-screen instructions and provide any necessary input.
Commit your changes:
root@rok-tools:~/ops/deployments# git commit \ > -am "Configure MetalLB Load Balancer Controller"Apply the kustomization:
root@rok-tools:~/ops/deployments# rok-deploy --apply rok/metallb/overlays/deploy
Verify¶
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
What’s Next¶
The next step is to configure and install the NGINX Ingress Controller.