Been looking to find a solution and don't think it's possible but hope it is.
Can Traefik be used as central loadbalancer with multiple hosts with docker?
Meaning I don't want to run swarm/k8s, but use Traefik to balance traffic like:
abc.domain.com to container with label abc that runs on hostA
and def.domain.com to container with label def that runs on hostB
(It must be possible to stop container abc and start it on hostB and Traefik should autodiscover this and forward traffic)
Can this be done using Traefik CE?
Funny part, chatgpt keeps telling me that it's possible but can't find any info on it. Yes, Traefik can indeed work with Direct IP Routing to forward traffic between a central Traefik instance and multiple Docker hosts, without requiring Docker Swarm or Kubernetes. This setup relies on Traefik connecting to the Docker API on each host (for example, via TCP) to retrieve information about running containers, and then routing traffic based on the IP addresses and ports exposed by those containers.
The standards are k8s or Docker Swarm to work with multiple nodes. Without those, how do you want to connect the nodes among each other? Even if you would connect to different Docker sockets, how do you want to connect to the Docker container target IPs?
Maybe a project like traefik-kop can help. But be aware it has only 3 developers, if they lose interest you might get stuck with a unmaintained piece of software, with unfixed bugs and security holes.
We use good old Docker Swarm, works for a few nodes, even though development is really slow. But we get bug fixes.
I thought if it would still discover it on nodeA , then a translation could be that it knows nodeA external ip en map the port accordingly assuming the docker network is host .
But thanks for clarifying.
I’m also stuck with this as well. I use terraform to deploy all of my services on different hosts and wanted to have a centralized traefik instance to managed my home lab instead of having to add traefik to each VM.
Another approach I’m looking into is using Consul Catalog provider but this adds more overhead I think (new to consul). I believe I would need to deploy a single consul server, 1 consul client for each host and then determine how to register the services. Their seems to be a Registrator tool/image but not sure if this is still viable or not, posts that I have seen about this are 8+ years old.
Maybe the next big leap would be to go the K8S route