Allocated external-ip of LB can not be reached outside cluster

127 views
Skip to first unread message

xuchengli

unread,
Nov 1, 2021, 2:22:41 AM11/1/21
to metallb-users
I installed metallb follow by doc: https://metallb.universe.tf/installation/, after installed successfully I deployed test nginx deployment and LoadBalancer service, the service has allocated a external-ip by metallb. I can access the nginx service inside cluster(include master and worker node) by curl, like: curl http://<external-ip>, but outside the cluster, I can not curl to the nginx service, show error: curl: (7) Failed to connect to <external-ip> port 80: no route to the host. Has anyone had this problem?

My k8s version is: v1.20.11, metallb version is: v0.11.0

Oleksii Fominykh

unread,
Jul 22, 2022, 2:35:10 AM7/22/22
to metallb-users
I have the same issue.
 Metallb doesn't add this IP to the node network interface.

Elias Morais Pereira

unread,
Nov 8, 2022, 9:10:33 AM11/8/22
to metallb-users

It occurs in my config as well.

Did you solve it?

IlluminateS

unread,
Nov 8, 2022, 10:02:57 AM11/8/22
to metallb-users
This is known for the cloud deployments and the solution would be to have a secondary IP ( available for example AWS ) run traefik ( https://www.traefik.io ) as LoadBalancer and balance the traffic with ingressroutes to the services. still you can use the metallb as NFS server internal . In PfSense on a virtualisation like VMWare/ProxMox this must work with metallb..  at least it works at me like a charm

Elias Morais Pereira

unread,
Nov 8, 2022, 11:37:01 AM11/8/22
to metallb-users
Hello Christian,

I use it in baremetal; my k8s nodes are in a proxmox.

How did you make it work with public IP?

IlluminateS

unread,
Nov 9, 2022, 2:33:49 AM11/9/22
to metallb-users
Hey Elias,
You need a router/firewall like PFsense in front which has a public IP and private network where the metallb can have ips from the private network. After you can just NAT and loadbalance with HAproxy.

Willian Kévenis

unread,
Feb 12, 2023, 8:58:27 PM2/12/23
to metallb-users
I have same problem.  IP it design but not acesssible outside 


 e9a8c58a-34c4-436f-a252-e70cb5e041d6.png
d2780291-3833-47ac-8edb-c5d677ca1f26.png

b49d1fe2-30fc-4062-a2d7-b00e383eb337.png

Elias Morais Pereira

unread,
Feb 13, 2023, 4:49:57 AM2/13/23
to Willian Kévenis, metallb-users
Willian,

Does your infrastructure have an edge router? Something like a pfsense? If yes, google for "metallb+bgp". This way you leave your public address accessible externally.

--
You received this message because you are subscribed to a topic in the Google Groups "metallb-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/metallb-users/3UTxMISr9AE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to metallb-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/metallb-users/ba7dacd9-1f29-472f-9337-2d1ee9e981fbn%40googlegroups.com.

Willian Kévenis

unread,
Feb 13, 2023, 5:14:10 AM2/13/23
to Elias Morais Pereira, metallb-users
Yes, it has Mikrotik Router.

So much so that the public IP reaches the Rancher, if I raise the IP on the Rancher it is accessible to the world normally.

See my on-premise infra
IMG_20230213_071255_064.jpg

Anton Rukhlin

unread,
Jun 15, 2023, 2:09:22 PM6/15/23
to metallb-users
Willian,

Were you able to resolve the problem?

I have a similar setup. A proxmox cluster running several k3s nodes. The ARP request is received by the Mikrotik router and the traffic is then sent to the correct node. But after a packet reaches the k3s node it is never forwarded to k3s cluster. Instead it is sent back to the router, because the VM is not aware of the public IP.

I assigned the public IP to the VM, and now it is pingable. But the packet is still not forwarded to k3s cluster. I think the problem is that iptables is missing entries to do that.

Anton
Reply all
Reply to author
Forward
0 new messages