A network load-balancer implementation for Kubernetes using standard routing protocols
open sourceApache-2.0self-hostablefree
MetalLB is a load-balancer implementation for bare-metal Kubernetes clusters, which otherwise leave Services of type LoadBalancer pending forever outside the big clouds. It assigns addresses from IP pools you give it and announces them to the network either in Layer 2 mode, where one node answers ARP (IPv4) or NDP (IPv6) for each service IP, or in BGP mode, where nodes peer with your routers for real load balancing across nodes. BGP sessions run through FRR-K8s by default, which adds BFD and IPv6 advertisement. It's configured with custom resources, installs with manifests, Kustomize or its own Helm chart, and is a CNCF sandbox project under Apache-2.0.
Ways to install
On Kubernetes
Problems it solves
- my LoadBalancer services stay in pending forever on my bare-metal Kubernetes cluster
- give services on my home lab cluster real IP addresses on the LAN instead of NodePorts
- announce Kubernetes service IPs to our routers over BGP
- an external IP for the ingress controller on a self-hosted cluster without a cloud load balancer
- move a service's IP to another node automatically when the node holding it goes down
- hand out IPs for Kubernetes services from a pool of addresses we own
- run Kubernetes on Proxmox or VMware and expose services the same way a cloud cluster would
- IPv6 addresses for services on an on-premises cluster
Features
- LoadBalancer services on bare-metal clusters
- IP address pools for allocation
- Layer 2 mode with ARP (IPv4) and NDP (IPv6)
- BGP mode with true load balancing across nodes
- FRR-K8s backend with BFD and IPv6 advertisement
- configuration through custom resources
- Helm chart, manifests and Kustomize installs, and an operator on OperatorHub
Limitations
- Doesn't work on most cloud providers (AWS, Azure, Google Cloud, DigitalOcean): use the provider's own load balancer there2
- No load balancing across nodes in Layer 2 mode: one elected node receives all traffic for a service IP, so bandwidth is limited to that node3
Capabilities
| Has an API | plan not known |
|---|
Alternatives
The same job
These do what MetalLB does.
