I am currently investigating traffic for some of our usecases. I found alot of setup guide describing running traefic inside the same docker host / docker swarm on which the contianer run which he is supposed to route too.
But is it also possible to install traefik to a separet docker host and connect to the docker api via network.
I've found the following description of accessing the docker api via network.
From my point of view there should be no problems. Has someone created a similar setup? Are there any pitfalls to this design?
Many thanks for your help.
Yes it is possible.
You have to connect traefik to the defined swarm network :
docker network connect <the_swarm_network_default> <traefik_container>
do you mean i should connect the traefik container to the swarm network of the host it is running on?
Or should I connect it to the swarm network of the host on which the containers are running?
I have already got the docker api connected and labeled the containers. These are also recognized by traefik but forwarding the request does not work yet because it tries to connect to the internal IP of the container. I have already tested with the option useBindPortIP but no success yet, because it still uses the wrong IP address.
I will try to connect the traefik to the local swarm network maybe this helps.