Good afternoon, I ran into the problem that it is not possible to attach MetalLB to K3S I have a cluster with 3 masters and 3 workers
NAME STATUS ROLES AGE VERSION
master-node-1 Ready control-plane,etcd,master 4d2h v1.30.5+k3s1
master-node-2 Ready control-plane,etcd,master 4d1h v1.31.1+k3s1
master-node-3 Ready control-plane,etcd,master 4d1h v1.31.1+k3s1
worker-node-1 Ready <none> 4d1h v1.31.1+k3s1
worker-node-2 Ready <none> 4d v1.31.1+k3s1
worker-node-3 Ready <none> 4d v1.31.1+k3s1
initially, I tried to install MetalLB in this way
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.12.1/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.12.1/manifests/metallb.yaml
config
# config.yml
apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: default
protocol: layer2
addresses:
- 192.168.0.170-192.168.0.180
with this approach Load Balancer was working, it was not stable on the tap, with a 50% probability it was impossible to enter the site. Then I found out that this is an outdated approach. I tried a new one
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.5/config/manifests/metallb-native.yaml
config
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: k3s-lb-pool
namespace: metallb
spec:
addresses:
- 192.168.0.170-192.168.0.180
autoAssign: true
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: k3s-lb-pool
namespace: metallb
but I get an error
Error from server (InternalError): error when creating "metalLB-config.yaml": Internal error occurred: failed calling webhook "ipaddresspoolvalidationwebhook.metallb.io": failed to call webhook: Post "https://metallb-webhook-service.metallb.svc:443/validate-metallb-io-v1beta1-ipaddresspool?timeout=10s": no endpoints available for service "metallb-webhook-service"
Error from server (InternalError): error when creating "metalLB-config.yaml": Internal error occurred: failed calling webhook "l2advertisementvalidationwebhook.metallb.io": failed to call webhook: Post "https://metallb-webhook-service.metallb.svc:443/validate-metallb-io-v1beta1-l2advertisement?timeout=10s": no endpoints available for service "metallb-webhook-service"
but the namespace is still working properly
root@master-node-1:~# kubectl get pod -n=metallb-system
NAME READY STATUS RESTARTS AGE
controller-86f5578878-9ddsr 1/1 Running 2 (3m31s ago) 4m57s
speaker-5j47x 1/1 Running 0 4m56s
speaker-6drpd 1/1 Running 0 4m56s
speaker-ccpmq 1/1 Running 0 4m56s
speaker-jfpch 1/1 Running 1 (3m12s ago) 4m56s
speaker-mps8b 1/1 Running 0 4m57s
speaker-t9lx2 1/1 Running 0 4m56s
(I apologize in advance English is not my native language)