Skip to content

Loadbalancer

Lets install a loadbalancer (MetalLB) on a Talos Linux cluster.

MetalLB

# add repo and install
helm repo add metallb https://metallb.github.io/metallb
helm repo update
helm install metallb metallb/metallb -n metallb-system --create-namespace --wait

# fix pod security for speaker pods
kubectl label namespace metallb-system pod-security.kubernetes.io/enforce=privileged
kubectl label namespace metallb-system pod-security.kubernetes.io/audit=privileged
kubectl label namespace metallb-system pod-security.kubernetes.io/warn=privileged

# restart speaker daemonset
kubectl rollout restart daemonset/metallb-speaker -n metallb-system
# configure metallb
cat <<EOF | kubectl apply -f -
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: ingress-pool
  namespace: metallb-system
spec:
  addresses:
  - 10.8.15.175/32
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
  name: ingress-pool
  namespace: metallb-system
spec:
  ipAddressPools:
  - ingress-pool
EOF

Uninstall MetalLB

helm uninstall metallb -n metallb-system