Hey guys, I have the following setup and I'm trying to accomplish haproxy-like roundrobin loadbalaincing:
Server_1: It has traefik hosted on it (in docker container) working in an bridged network (called 'ext') and exposed ports 80 and 443. I have apache service working on the same node in docker container in the same 'ext' network with no ports exposed (as it's communicating with traefik over the bridged docker network).
Server_2: It has an apache service running in a docker container with port 8080 exposed.
I want to accomplish haproxy-like roundrobin loadbalancing between the two services while keeping it as simple as possible. I'm not sure how this should work out as the apache service on Server_1 is ingress and the apache service on Server_2 is an external one. I'm trying to accomplish this with a simple docker-compose file that looks like this:
Traefik doesn't return any error, but it only serves content from my local server (Server_1) and it doesn't seem to reach Server_2. Is it possible to achieve the thing I want here, or it would be better using docker swam or k8s?
Your use case should be doable. What I see is that the second load balancers is defined with a server.
When using Traefik docker provider and labels, it is not possible to define the server pointed by the load balancer. It always uses the container as server endpoint, and defining a custom one is just ignored. I suggest you to use the file provider to implement your use case.
Here I'm trying to add an HTTPS to secure my service, but I'm getting 404, so I'm doing something wrong obviously. Can you point out the mistake to me?
In your dynamic configuration, there is a http key in the http key. It should be http.services.apache-secure.... and not http.http.services.apache-secure.....
Again, in your dynamic configuration, the service used by your router is apache, but I think you are looking for the apache-secure service configured just after.
Ok, after a little bit of tinkering here and there, I've found the solution. Firstly, the labels on the container above were not needed. And here's how the providers file looks like for me now: