metalLB

https://metallb.universe.tf/

Install MetalLB using manifest

kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml

Create a custom manifest with the IP pool

#Filename metalLB-IPAddressPool.yaml

apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: ip-pool
  namespace: metallb-system
spec:
  addresses:
  - 192.168.1.170-192.168.1.179

Apply manifest to cluster

kubectl apply -f metalLB-IPAdressPool.yaml

Testing the MetalLB loadbalancer

kubectl create deployment nginx1 --image=nginx
kubectl expose deployment/nginx1 --type="LoadBalancer" --port 80

Check the nginx service to see what IP was assigned kubectl get service

Should output something like:

IP assigned to that service is 192.168.1.170 and port 80 is exposed externally for that IP. Test with browser with http://192.168.1.170/


Manually assign a static IP

The following manifest is will create a deployment and use a static IP

Last updated