Bare metal: loadbalance with metalLB and network question

Hi,

I am running kubernetes on bare metal environment. Due to lack of builtin loadbalancer, I am using metalLB which runs fine in my small dev environment.

Currently my Kubernetes master and worker nodes are in network x.x.x.0/24. MetalLB is allowed to use IPs x.x.x.153-159 which works fine.
As I understand metalLB can also assign IPs in a different network y.y.y.0/24 for example.

  1. Is this understanding correct?
  2. If I talk to the admins, that I need a free network y.y.y.y/24, what else needs to be done, that external traffic (a client outside kubernetes in network a.a.a.a/24) can access any exported service with IP y.y.y.y./24?

I am just having a knot in my head. Client a.a.a.a/24 needs to be routed to y.y.y.y/24. MetalLB is listening there and forwarding it to the internal kubernetes network.

Is that correct? Do I need to install any network gateway or does metalLB just includes this gateway?
Just want to be a bit prepared before speaking with the admins :wink:

Thanks a lot, Andreas

In layer2 mode, metallb can assign IPs that the host networks have access to. Say your network is configured with 192.168.0.0/23 the hosts could belong to 192.168.0.0/24 whereas metallb has been allocated 192.168.1.0/24.

You have a bit more flexibility when working with BGP, but that requires much more specific network configuration.