What is MetalLB?
If you run Kubernetes in a cloud (AWS, GCP, Azure), creating a LoadBalancer
service gives you an external IP automatically. But what if your cluster is bare metal — your own servers, without cloud integration? That’s where MetalLB comes in.
MetalLB is a load balancer implementation for bare-metal Kubernetes clusters. It allows you to expose services of type LoadBalancer
without relying on cloud providers.
How MetalLB Works
MetalLB assigns external IPs to services in one of two modes:
- ARP/NDP mode: Nodes respond to ARP/NDP requests, making the IP reachable in your local network.
- BGP mode: MetalLB speaks BGP with your routers, announcing routes like a real load balancer.
Alternatives to MetalLB
- Kube-VIP – lightweight option for HA control plane and LoadBalancer services.
- Keepalived + HAProxy/Nginx – manual but flexible setup for exposing services.
- Cilium LoadBalancer IPAM – if you’re using Cilium CNI, it can allocate LoadBalancer IPs natively.
- Cloud providers’ LB – if running in hybrid environments, you can still use native cloud load balancers.
Usage Scenarios
- Running Kubernetes on bare metal servers in data centers.
- Exposing apps like Prometheus, Grafana, Nginx, or custom APIs to external clients.
- Home labs and self-hosted clusters (k3s, kubeadm).
- Enterprises that want full control over networking without cloud dependency.
Conclusion
MetalLB solves a simple but critical problem: how to get external IPs for services on bare metal Kubernetes.
If you need more advanced routing or HA, look at Kube-VIP, Keepalived, or Cilium.
It’s one of the most popular tools in the Kubernetes ecosystem for those outside the cloud.