Microk8s enable metallb failing on 1.27/stable

I had been running microk8s 1.24 stable and I uninstalled it all and installed microk8s 1.27/stable yesterday. Unfortunately I now get an error when trying to enable metallb. I have googled this extensively and see that other people have had the problem but not found a solution. I get the error:

Failed to create default address pool, will retry
Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "ipaddresspoolvalidationwebhook.metallb.io": failed to call webhook: Post "https://webhook-service.metallb-system.svc:443/validate-metallb-io-v1beta1-ipaddresspool?timeout=10s": context deadline exceeded
Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "l2advertisementvalidationwebhook.metallb.io": failed to call webhook: Post "https://webhook-service.metallb-system.svc:443/validate-metallb-io-v1beta1-l2advertisement?timeout=10s": context deadline exceeded
Failed to create default address pool, will retry

I did have a routing problem with ubuntu’s netplan config which I finally resolved this morning, however when I try to enable metallb the error above persists. Before I go back to 1.24/stable, I thought I would ask here if anyone might know what I am doing wrong?

I want back to 1.24 stable and when I try to enable metallb now and get the service the address pool is in a pending state and never finishes. I have tried 1.26 and I get the sam InternalError as on 1.27/stable. I have checked all routing and am able to telnet to the cluster IP from all nodes - quite aggravating now after several days. I am unsure where to start with debugging this. Also unsure why it appeared to work the first time I installed microk8s 1.24/stable and now it does not. Any advice at all on what I should start looking at to find out where my problem lies? Connectivity and DNS between all the nodes is working fine.

just a thought about ip address range for metallb in microk8s - I am assuming I allocate the address pool out of unused addresses outside of my dhcp range on my local network? i.e. my local network is and I am trying to allocate which is not in my dhcp scope… please don’t hit me if this is a stupid question :frowning:

@wddossett the cause of the error message that you see is that the API server is unable to access the MetalLB controller to validate the IPAddressPool resources. This could be due to a number of reasons:

  • the metallb pods are not coming up
  • the metallb pods are coming up but something is wrong with their configuration
  • there is some other networking related issue that prevents the apiserver from talking to the metallb pods
  • there is some DNS related issue where the API server is unable to resolve the metallb service hostname

What is the exact command that you are using to install/uninstall microk8s? I would recommend resetting your environment like this, to verify whether the error is due to previous configs:

# 1. remove microk8s and any data
sudo snap remove microk8s --purge

# 2. reboot the machine
sudo reboot

# 3. install microk8s and wait for services to start
sudo snap install microk8s --classic --channel 1.27
sudo microk8s status --wait-ready

# 4. enable metallb and specify the range as argument
sudo microk8s enable metallb

thank you, that’s pretty much what I have done… I did not do the purge after uninstalling first time though… if I uninstall now and use purge will that purge anything left from before?

DNS is enabled. The nodes can talk to each other by their DNS names using my local DNS server which is configured in ubuntu netplan and working correctly… I will try with the purge, I think that could be a problem as metallb did work when I first installed microk8s 1.24 - but I had some routing issues then so it was unreliable. Then when I uninstalled and installed 1.27 it has never worked properly since installing and uninstalling. Will report back, THANK YOU

yes, purge did the trick, thank you, its working now.