Metal LB install 0....
 
Notifications
Clear all

Metal LB install 0.13.x and higher in Kubernetes

1 Posts
1 Users
1 Likes
263 Views
Brandon Lee
(@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): raw.githubusercontent.com/metallb/metallb/v0.14.3/config/manifests/metallb-native.yaml

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.

apiVersion: metallb.io/v1beta1 
kind: IPAddressPool 
metadata: 
  name: first-pool 
  namespace: metallb-system 
spec: 
  addresses: 
  - 10.1.149.240-10.1.149.250

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

apiVersion: metallb.io/v1beta1 
kind: L2Advertisement 
metadata: 
  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