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
As far as I can tell, Treafik seems to remove all Docker containers which use the Docker healthcheck system and do not have status healthy from its dynamic configuration. This is a good default, but I would like to be able to deactivate this behavior and ignore the Docker Health. An example for when someone might want to disable this is when a Docker container reports an unhealthy status while it can still process some of requests, e.g. to a management interface, which may help solve the problem but is no longer accessible though Traefik.
This behaviour also prevents one from using the ping@internal service as a healthcheck in docker combined with labels for custom routing for ping service in the docker-compose file, as this creates a chicken-egg kind of problem.
Traefik will not deploy the routes defined in the docker-compose file because the container has "starting" as health status. Therefore the healthcheck will fail, bringing the container to an "unhealthy" status, preventing the routes to be deployed by Traefik...
Example configuration (for second exmaple)
docker-compose.yml:
version: '3'
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.3
# Enables the web UI and tells Traefik to listen to docker
ports:
# The HTTP port
- "80:80"
- "443:443"
# The Web UI (enabled by --api.insecure=true) (TODO: REMOVE LATER)
- "8090:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
- ./config/:/etc/traefik/
- ./log/:/log/traefik/
healthcheck:
test: "wget --no-check-certificate --spider localhost:443/mypingroute|| exit 1"
labels:
- "traefik.enable=true"
# dashboard
- "traefik.http.routers.traefikweb.rule=PathPrefix(`/api`) || PathPrefix(`/dashboard`)"
- "traefik.http.routers.traefikweb.service=api@internal"
- "traefik.http.routers.traefikweb.entrypoints=websecure"
# ping
- "traefik.http.routers.pingweb.rule=PathPrefix(`/mypingroute`)"
- "traefik.http.routers.pingweb.service=ping@internal"
- "traefik.http.routers.pingweb.entrypoints=websecure"
As far as I could see, there is also no information on this in the official documentation. There should be a note saying that Traefik will exclude Docker containers with a health status not equals "healthy" from its scanning for dynamic configuration.
The text was updated successfully, but these errors were encountered:
This is working as intended. Unhealthy backends will be removed from the load-balancing for good reasons. If you dont wish to have that functionality, you will need to remove the health-check.
Do you want to request a feature or report a bug?
Feature
What did you expect to see?
As far as I can tell, Treafik seems to remove all Docker containers which use the Docker healthcheck system and do not have status healthy from its dynamic configuration. This is a good default, but I would like to be able to deactivate this behavior and ignore the Docker Health. An example for when someone might want to disable this is when a Docker container reports an unhealthy status while it can still process some of requests, e.g. to a management interface, which may help solve the problem but is no longer accessible though Traefik.
This behaviour also prevents one from using the
ping@internal
service as a healthcheck in docker combined with labels for custom routing for ping service in the docker-compose file, as this creates a chicken-egg kind of problem.Traefik will not deploy the routes defined in the docker-compose file because the container has "starting" as health status. Therefore the healthcheck will fail, bringing the container to an "unhealthy" status, preventing the routes to be deployed by Traefik...
Example configuration (for second exmaple)
docker-compose.yml:
traefik.toml
Additional notes
As far as I could see, there is also no information on this in the official documentation. There should be a note saying that Traefik will exclude Docker containers with a health status not equals "healthy" from its scanning for dynamic configuration.
The text was updated successfully, but these errors were encountered: