Hiện tại phiên bản v0.13.x có 1 breakchange, but cũng rất dễ dàng setup.
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml root@k8s-master:~# kubectl get ns NAME STATUS AGE argocd Active 30m cilium Active 22h default Active 22h k0s-autopilot Active 22h kube-node-lease Active 22h kube-public Active 22h kube-system Active 22h metallb-system Active 14s root@k8s-master:~# kubectl get all -n metallb-system
Đây là các config mẫu.
Bạn cần chọn ra 1 range IP cho loadbalancer.
root@k8s-master:~/metallb# cat IPAddressPool.yaml apiVersion: metallb.io/v1beta1 kind: IPAddressPool metadata: name: first-pool namespace: metallb-system spec: addresses: - 192.168.101.220-192.168.101.240 root@k8s-master:~/metallb# kubectl -n metallb-system get ipaddresspools.metallb.io NAME AUTO ASSIGN AVOID BUGGY IPS ADDRESSES first-pool true false ["192.168.101.220-192.168.101.240"] cat L2Advertisement.yaml apiVersion: metallb.io/v1beta1 kind: L2Advertisement metadata: name: example namespace: metallb-system spec: ipAddressPools: - first-pool