Skip to main content

Metallb

Install

We will install with kustomize

kustomization.yml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: metallb-system
resources:
- github.com/metallb/metallb/config/native?ref=v0.14.9
- resources.yml

IP Pool

resources.yml
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: auto-pool
namespace: metallb-system
spec:
addresses:
- 10.10.4.206-10.10.4.210 # set your ips
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: pool-advertisement
namespace: metallb-system
spec:
ipAddressPools:
- auto-pool

Apply

kubectl apply -k .

Validate

kubectl get all -n metallb-system

NAME                             READY   STATUS    RESTARTS   AGE
pod/controller-7dcb87658-hlrdt 1/1 Running 0 2m45s
pod/speaker-4jbvm 1/1 Running 0 2m45s
pod/speaker-lhjkb 1/1 Running 0 2m45s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/metallb-webhook-service ClusterIP 10.43.40.196 <none> 443/TCP 2m45s

NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
daemonset.apps/speaker 2 2 2 2 2 kubernetes.io/os=linux 2m45s

NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/controller 1/1 1 1 2m45s

NAME DESIRED CURRENT READY AGE
replicaset.apps/controller-7dcb87658 1 1 1 2m45s