Setup MetalLB Load Balancer on Kubernetes
Setup MetalLB Load Balancer on Kubernetes
MetalLB is a load-balancer implementation for bare metal Kubernetes clusters, using standard routing protocols.
Installation by Manifest
Apply the MetalLB manifest:
1
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.15.2/config/manifests/metallb-native.yaml
Check for the latest version on the MetalLB installation page.
Allocate IP Pool for Load Balancing
Create the following configuration to allocate IPs for the cluster:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# metallb.yaml
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
namespace: metallb-system
name: local-pool
spec:
addresses:
- 192.168.99.100-192.168.99.110
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: advert
namespace: metallb-system
Apply the configuration:
1
kubectl apply -f metallb.yaml
This post is licensed under CC BY 4.0 by the author.