Metal LB install 0....
Clear all

Metal LB install 0.13.x and higher in Kubernetes

1 Posts
1 Users
Brandon Lee
Posts: 542
Member Admin
Topic starter

If you are struggling to install MetalLB in Kubernetes with the newest versions of MetalLB, there are some changes that you need to know. With 0.13.x and higher, there are now two requirements instead of one during the installation.

You need to create:

  • ipaddresspools
  • l2advertisements

First, let's install MetalLB. You can use the script here for the latest 0.14.3 (at the time of this post):

Previously, the L2 advertisement was not needed. What do these YAML files need to contain and what do they look like?

Below is a sample ipaddresses.yml file. Replace the IP addresses needed in your environment.

kind: IPAddressPool 
  name: first-pool 
  namespace: metallb-system 

Below is a sample layer2.yml file. The metadata name needs to match the metadata name in the ipaddresses.yml file.

kind: L2Advertisement 
  name: first-pool 
  namespace: metallb-system

Run the following commands after creating the files. You will note below, the files exist in /tmp, so replace with the path to your files:

kubectl create -f /tmp/ipaddresspool.yml
kubectl create -f /tmp/l2advertisements.yml

That should be it. After creating the ipaddresses and l2advertisement, you should be able to receive an IP address for your Kubernetes services.

Let me know if you have any questions.


Posted : 16/02/2024 12:00 pm
t3hbeowulf reacted