By following the below steps, you can update MetalLB to the latest version:

Step 1: Check the Current MetalLB Version

Run the following command to check the version of installed MetalLB.

helm list -A | grep metallb 

Sample Output:

bootstrap

Step 2: List the IPs

To get the list of IPs currently in use, execute following command.

kubectl get cm -n kube-system metallb-config -o jsonpath="{['data']['config']}" | grep -Ev "address-pools:|protocol: layer2|addresses:|name: default" | tr --delete - | tr --delete " " 

Sample Output:

10.25.250.9/32 

10.12.24.122/32 

Step 3: Check the Services

kubectl get svc 

Sample Output:

bootstrap

Step 4: Backup IPs and Services

Take the backup of IP addresses and their corresponding services for future reference.

Step 5: Update MetalLB Helm Chart with the latest version

Run the following command to update the MetalLB Helm chart.

helm upgrade metallb oci://us-docker.pkg.dev/opsramp-registry/gateway-cluster-charts/metallb --version 6.3.6 -n kube-system 

Step 6: Verify MetalLB Pods

Wait for the MetalLB pods to restart and then check their status.

kubectl get pods -A | grep metallb 

Sample Output:

bootstrap

Step 7: Install IPAddressPool Helm Chart

Install the IPAddressPool Helm chart using the IP addresses obtained in Step 2. Replace the example IPs with your actual IPs. For multiple IPs, use a comma-separated list; for a single IP, use it directly without commas.

helm install ipaddresspool oci://us-docker.pkg.dev/opsramp-registry/gateway-cluster-charts/ipaddresspool --version 2.0.0 --set IPAddressPool={"IP Address"} -n kube-system 

Example:

helm install ipaddresspool oci://us-docker.pkg.dev/opsramp-registry/gateway-cluster-charts/ipaddresspool --version 2.0.0 --set IPAddressPool={"172.25.250.9/32,10.12.24.122/32"} -n kube-system 

Step 8: Check Services for Correct IP Assignment

kubectl get svc 

Step 9: Correct the IP Assignment for Services

If the ip’s got interchanged to services, then follow below steps to assign ip’s to their respective services.

  1. Run below command to change the service types.
    kubectl patch svc nextgen-gw-tcp -p '{"spec": {"type": "ClusterIP"}}' 
    kubectl patch svc nextgen-gw-udp -p '{"spec": {"type": "ClusterIP"}}' 
    kubectl patch svc squid-proxy -p '{"spec": {"type": "ClusterIP"}}' 
  2. After changing the cluster type:
    • If you want to assign 1st ip address to squid-proxy then run the commands below in the same order as given below.
          kubectl patch svc squid-proxy -p '{"spec": {"type": "LoadBalancer"}}' 
          kubectl patch svc nextgen-gw-tcp -p '{"spec": {"type": "LoadBalancer"}}' 
          kubectl patch svc nextgen-gw-udp -p '{"spec": {"type": "LoadBalancer"}}' 
         
    • If you want to assign the 1st ip address to gateway, then run the below commands in the same order as given below.
          kubectl patch svc nextgen-gw-tcp -p '{"spec": {"type": "LoadBalancer"}}' 
          kubectl patch svc nextgen-gw-udp -p '{"spec": {"type": "LoadBalancer"}}' 
          kubectl patch svc squid-proxy -p '{"spec": {"type": "LoadBalancer"}}' 
         

Step 10: Verify Correct IP Assignment

Check the services again to ensure the IPs are correctly assigned to their respective services.

kubectl get svc