MetalLB
Purpose: Load balancer for bare-metal Kubernetes clusters
Version: v0.14.8 (Helm chart: metallb 1.0.0)
Namespace: metallb-system
Description
Provides network load balancing for clusters that don't run on a cloud provider with built-in load balancers. Uses Layer 2 (ARP) mode for IP address announcement.
Installation
Installed via ArgoCD from Helm chart: metallb/metallb
Configuration
Configuration file: config/dev/applications/metallb-values.yaml
controller:
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
speaker:
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
IP Address Pool
Defined in config/dev/resources/metallb.yaml:
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: default-pool
namespace: metallb-system
spec:
addresses:
- 10.0.0.210-10.0.0.250
autoAssign: true
Pool Range: 10.0.0.210 - 10.0.0.250
L2 Advertisement
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: default
namespace: metallb-system
spec:
ipAddressPools:
- default-pool
Usage
Services of type LoadBalancer automatically get an IP from the pool:
kubectl get svc -n ingress-nginx
# NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
# ingress-nginx-controller LoadBalancer 10.96.89.123 10.0.0.211 80:30081/TCP,443:30080/TCP
Components
| Component | Purpose |
|---|---|
| metallb-controller | IP address allocation |
| metallb-speaker | ARP announcer |