Title here
Summary here
You’ll need IPs to hand out
Verify requirements
kubectl edit configmap -n kube-system kube-proxy
# add blah blah, it's in the documentation
kubectl create namespace metallb
or use a manifest file:
cat << EOF > metallb_ns.yaml
kind: Namespace
apiVersion: v1
metadata:
name: metallb
labels:
pod-security.kubernetes.io/enforce: privileged
pod-security.kubernetes.io/audit: privileged
pod-security.kubernetes.io/warn: privileged
EOF
kubectl apply -f metallb_ns.yaml
If you didn’t add labels to the metallb namespace at creation:
Test:
kubectl label --dry-run=server --overwrite ns metallb \
pod-security.kubernetes.io/enforce=privileged \
pod-security.kubernetes.io/audit=privileged \
pod-security.kubernetes.io/warn=privileged
Run for real:
kubectl label --overwrite ns metallb \
pod-security.kubernetes.io/enforce=privileged \
pod-security.kubernetes.io/audit=privileged \
pod-security.kubernetes.io/warn=privileged
See also: https://kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-namespace-labels
helm repo add metallb https://metallb.github.io/metallb
helm -n metallb install metallb metallb/metallb
cat << EOF > metallb_config.yml
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: example
namespace: metallb
spec:
addresses:
- 192.168.13.85-192.168.13.90
EOF
Append to the metallb_config.yml file
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: example
namespace: metallb
Full file:
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: example
namespace: metallb
spec:
addresses:
- 192.168.13.85-192.168.13.90
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: example
namespace: metallb
cat << EOF > metallb.yml
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: example
namespace: metallb
spec:
addresses:
- 192.168.13.85-192.168.13.90
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: example
namespace: metallb
EOF