You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a service behind Traefik that I deploy in a blue/green kind of way for zero downtime deployments. Discovery is via Docker provider. I do ZDD via green/blue namespaced service/router labels:
Suppose we have our green container running, the labels are like this:
Note that they both match HostRegexp({var:.*}) and additionally they either match a host header blue or green so I can query them directly to know that they're up. They also use the router priority to make sure the traffic starts flowing to the one with the higher priority.
What did you see instead?
What I expect is that requests will only be routed to the backend with
A succeeding health check
With the highest priority.
So in my example above, I expect requests to go to my_service_green even though it has the lower priority, because my_service_blue isn't healthy yet. As soon as my_service_blue is healthy, all requests should get routed there. This is not what I'm seeing however. Even though my_service_blue is correctly marked as unhealthy
time="2021-11-10T23:35:43Z" level=warning msg="Health check failed, removing from server list. Backend: \"my_service_blue@docker\" URL: \"http://172.18.0.4:5000\" Weight: 1 Reason: HTTP request failed: Get \"http://172.18.0.4:5000/ping\": dial tcp 172.18.0.4:5000: connect: connection refused"
I can see requests already being routed to that instance
I thought about this some more and I can't see why, even though the new container's traefik.http.routers.my_service_blue.rule matches the request and its priority is higher than other matching routers' priority, Traefik would route the request to this router when it it doesn't have healthy service backends. Especially not if there is another one, traefik.http.routers.my_service_green matching the request as well, and having a healthy backend (albeit a lower priority).
Hi! I'm Træfiker 🤖 the bot in charge of communication regulation.
Thanks for your interest in Traefik!
We dedicate the issue tracker to bug reports and feature requests only. My advanced AI has spotted that your issue might be a configuration problem or relates to something that doesn't look like a bug.
Thank you @traefiker. If your advanced AI has determined that it's my configuration that's wrong, surely you can also tell me how to fix it? Right now I'm assuming it's a bug. Please don't take this the wrong way, nothing against robots, but I'd prefer if a human could have a quick look at this?
Welcome!
What did you do?
I have a service behind Traefik that I deploy in a blue/green kind of way for zero downtime deployments. Discovery is via Docker provider. I do ZDD via green/blue namespaced service/router labels:
Suppose we have our
green
container running, the labels are like this:The next time we deploy the app, the labels on the new containers will be different, the new
blue
container will have the following labels:Note that they both match
HostRegexp(
{var:.*})
and additionally they either match a host headerblue
orgreen
so I can query them directly to know that they're up. They also use the routerpriority
to make sure the traffic starts flowing to the one with the higher priority.What did you see instead?
What I expect is that requests will only be routed to the backend with
So in my example above, I expect requests to go to
my_service_green
even though it has the lower priority, becausemy_service_blue
isn't healthy yet. As soon asmy_service_blue
is healthy, all requests should get routed there. This is not what I'm seeing however. Even thoughmy_service_blue
is correctly marked as unhealthytime="2021-11-10T23:35:43Z" level=warning msg="Health check failed, removing from server list. Backend: \"my_service_blue@docker\" URL: \"http://172.18.0.4:5000\" Weight: 1 Reason: HTTP request failed: Get \"http://172.18.0.4:5000/ping\": dial tcp 172.18.0.4:5000: connect: connection refused"
I can see requests already being routed to that instance
XXX.XXX.62.57 - - [10/Nov/2021:23:35:43 +0000] "GET /ping HTTP/1.1" 503 19 "-" "python-requests/2.25.1" 28850 "my_service_blue@docker" "-" 0ms
What version of Traefik are you using?
What is your environment & configuration?
If applicable, please paste the log output in DEBUG level
The text was updated successfully, but these errors were encountered: