Load Balancer

Our Managed Private Clusters uses MetalLB to provide Load Balancing and High Availability. We support all modes provided by MetalLB:

Layer 2 (ARP/NDP)

In layer 2 mode, one node in the cluster takes ownership of the service, and uses standard address discovery protocols (ARP for IPv4, NDP for IPv6) to make those IPs reachable on the local network. From the LAN’s point of view, the announcing machine simply has multiple IP addresses.

BGP

In BGP mode, multiple nodes in the cluster can establish BGP peering sessions with nearby routers, and tell those routers how to forward traffic to the service IPs. Using BGP allows for true load balancing across multiple nodes, and fine-grained traffic control thanks to BGP’s policy mechanisms.

If using NetworkPolicy: Local in BGP mode you have to add a the label taint asergo.com/loadbalancer: true to limit the resouce to the BGP nodes

Private Network Load Balancer

Public Load Balancer is the default choice if no annotation is set on the service. To use internal (Private Network) Load Balancer can the annotation metallb.universe.tf/address-pool: internal be used

apiVersion: v1
kind: Service
metadata:
  annotations:
    metallb.universe.tf/address-pool: internal
  name: nginx
  labels:
    app: nginx
spec:
  ports:
  - port: 80
    protocol: TCP
  selector:
    app: nginx
type: LoadBalancer

Same Load Balancer, Multiple Services

It is possible to share the same Load Balancer across multiple services as long as the services do not use the same ports. For services to share Load Balancer all the affected services need the same annotation version of metallb.universe.tf/allow-shared-ip: <NAME>

apiVersion: v1
kind: Service
metadata:
  annotations:
    metallb.universe.tf/allow-shared-ip: shared
  name: nginx
  labels:
    app: nginx
spec:
  ports:
  - port: 80
    protocol: TCP
  selector:
    app: nginx
  type: LoadBalancer