This version is under construction, please use an official release version

Layer 4 Load balancing with BGP

In Management Cluster, KubeLB offloads the provisioning of the the actual load balancers to the load balancing appliance that is being used. This can be the CCM in case of a cloud provider or a self-managed solution like MetalLB, Cilium Load Balancer or any other solution.

KubeLB therefore works with any load balancing appliance, regardless of the route advertisement protocol it uses (BGP, OSPF, L2, etc.). This tutorial focuses on BGP and assumes that the underlying infrastructure of your Kubernetes cluster is already configured to support it.

Setup

We’ll use MetalLB with BGP for this tutorial. Update the values.yaml file for KubeLB manager to enable metallb:

kubelb-addons:
  metallb:
    enabled: true

A minimal configuration for MetalLB for demonstration purposes is as follows:

apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: extern
  namespace: metallb-system
spec:
  addresses:
  - 10.10.255.200-10.10.255.250
  autoAssign: true
  avoidBuggyIPs: true
---
apiVersion: metallb.io/v1beta1
kind: BGPAdvertisement
metadata:
  name: extern
  namespace: metallb-system
spec:
  ipAddressPools:
  - extern

This configures an address pool extern with an IP range from 10.10.255.200 to 10.10.255.250. This IP range can be used by the tenant clusters to allocate IP addresses for the LoadBalancer service type.

Afterwards you can follow the Layer 4 Load balancing tutorial to create a LoadBalancer service in the tenant cluster.

Further Reading