Skip to main content
⎈K8sCalc

$ k8scalc compare keepalived metallb

Keepalived vs MetalLB

Keepalived and MetalLB both give you a stable IP for services on self-managed infrastructure, but at different layers. Keepalived runs on hosts (usually two HAProxy VMs) and moves a virtual IP between them with VRRP. MetalLB runs inside Kubernetes and gives Services of type LoadBalancer an external IP, announced via ARP (L2) or BGP.

Last reviewed: 2026-12-01

FeatureKeepalivedMetalLB
Lives inside Kubernetes
No (external VMs)
Yes (operator)
Hetzner Floating IP
Yes (VRRP + hcloud API script to move the IP)
No (L2 ARP does not work on Hetzner Cloud)
Survives cluster failure
Yes
No
BGP announcement
No
Yes
Config approach
Config file on host
CRDs
L2 ARP announcement
No
Yes
Paired with
HAProxy
Any ingress controller
Complexity
Low (2 VMs)—
Low (operator install)—
LoadBalancer services
No
Yes (native)

Verdict

These tools solve different problems. Keepalived (VRRP) is the right choice for the Hetzner setup: run HAProxy VMs outside the cluster with Keepalived providing a shared Floating IP between them — this survives total cluster failures. MetalLB lives inside Kubernetes and announces LoadBalancer IPs via L2 ARP or BGP — ideal for on-cluster load balancing without external VMs. On Hetzner Cloud, MetalLB's L2 mode does not work (no ARP across the provider network) and there is no customer BGP, so use Keepalived+HAProxy (with an hcloud API script to move the Floating IP) or Hetzner Load Balancers via the hcloud cloud controller manager. MetalLB is the natural choice on bare metal and on-premises networks.

Choose Keepalived if…

  • You need a highly available entry point for the Kubernetes API server, outside the cluster.
  • You run HAProxy VMs in front of the cluster and want automatic failover between them.
  • On Hetzner Cloud: combined with a notify script that moves the Floating IP via the hcloud API.

Choose MetalLB if…

  • You run on bare metal or on-premises and need LoadBalancer Services without a cloud provider.
  • Your network supports L2 ARP between nodes or you can peer with routers over BGP.
  • You want IPs managed declaratively with CRDs (IPAddressPool, L2Advertisement).

Frequently Asked Questions

Does MetalLB work on Hetzner Cloud?

Not in L2 mode: the cloud network does not pass ARP between servers the way a LAN does, and Hetzner Cloud offers no customer BGP. Use Hetzner Load Balancers through the hcloud cloud controller manager, or Keepalived+HAProxy with a Floating IP.

How does Keepalived move a Hetzner Floating IP?

VRRP decides which node is master; a notify script on the new master calls the Hetzner API to assign the Floating IP to its server. The IP is also configured on the interface of both nodes.

Do I need both?

On bare metal, a common setup is Keepalived+HAProxy for the API server and MetalLB for application LoadBalancer Services. On Hetzner Cloud, Keepalived+HAProxy or Hetzner Load Balancers replace MetalLB.

Related tool

K8s Cluster Cost

Calculate the monthly cost of running a self-managed Kubernetes cluster on Hetzner Cloud, Vultr, or DigitalOcean. Choose server types for control planes, workers, and load balancers with HA mode.

Related Generators

Related Comparisons

Related Guides