TRaefik v2 as loadbalancer for kubernetes nodes

Hi Im trying to figure out if its posible to put a traefik instance in front of a kubernetes cluster acting as a load balancer.
I want to spwn up new nodes and add them as backend via an api call on startup

Sounds like it should be possible. If you have any particular behaviours that you cannot explain or cannot get something to work, please post your configs / logs.

One note about adding nodes via API. Someone reported on the forums before, that changing dynamic configuration via api does not persist between traefik restarts. I understand this is by design. So if this aspect is not changed by the developers, you probably are better off using File Provider to adding your nodes, because you can make that file persist. Or alternatively you'll have the same entity that adds nodes via API calls to monitor traefik and sync nodes information in real time.

1 Like

Another thing you could try is to run traefik on metalLB IPs. then the IP will float over the cluster nodes.

@titansmc, for metalLB I understand you need a pool of IP addresses. Where does on get it? :wink: (Interested in metalLB but not coming from networking background, so looking to educate myself)

Im trying this on my internal network so I have plenty of Ip's to give to metalLB !
for external acces my provider gives me 4 ip addreses with my plan (just need 1)

thank u very much for the response we have an nginx doing that fixed ips for the backends