I created a k3s cluster and disabled the service loadbalancer & traefik. I installed metallb via a manifest file. Also, I created a ConfigMap for Metallb below named "config" with an address pool so I don’t know why the metallb-controller is saying "no available ips".
ubuntu@mark:~$ k describe svc nginx
Name: nginx
Namespace: default
Labels: app=nginx
Annotations: <none>
Selector: app=nginx
Type: LoadBalancer
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.43.29.17
IPs: 10.43.29.17
Port: <unset> 80/TCP
TargetPort: 80/TCP
NodePort: <unset> 30584/TCP
Endpoints: 10.42.4.4:80
Session Affinity: None
External Traffic Policy: Cluster
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning AllocationFailed 34s metallb-controller Failed to allocate IP for "default/nginx": no available IPs
apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: default
protocol: layer2
addresses:
- 192.168.136.206-192.168.136.209
2
Answers
Install the latest stable version:
Define an IPAddressPool
You are using the ConfigMap while in the documentation it says that in newer versions you should not use it:
I was doing the same thing, I had an old repo, where I used the ConfigMap, so I decided to reuse it, but than I read the documentation and followed the instructions from the MetalLB website.
From installation I executed the following commands:
, and then from the configuration I choose the Layer 2 Configuration setup. Add the code bellow in a file.yaml:
, and then apply it using kubectl
After that every thing works well. I hope this answer would be helpful for those who used the old approach, correct me if I have misunderstood.