Hi,
I've been trying to poc on a docker swarm traefik on a docker swarm cluster.
traefik : 1.7.12/maroilles (miam)
docker 18.09.7-0ubuntu1~19.04.4
here are my stacks
#########
version: '3.7'
networks:
lb-common:
name: lb-common
driver: overlay
attachable: true
services:
reverse-proxy:
image: traefik # The official Traefik docker image
#command: --api --docker
ports:
- "80:80" # The HTTP port
- "443:443"
- "8081:8080" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock #
- ./traefik.toml:/etc/traefik/traefik.toml #
networks:
- lb-common
#########
#########
version: '3.7'
networks:
default:
external: true
name: lb-common
services:
httpd:
image: httpd:2.4 # A container that exposes an API to show its IP address
deploy:
replicas: 3
labels:
traefik.frontend.rule: "Host:httpd.docker.localhost"
traefik.enable: "true"
traefik.backend: "http"
traefik.port: "80"
traefik.backend.healthcheck.path: "/jyc"
traefik.backend.healthcheck.interval: "1s"
traefik.backend.healthcheck.port: "80"
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
networks:
- default
#########
as you can see, the check is on /jyc on the apache stack.
on one of the three httpd instances, i've created a simple jyc file.
so only one instance ca reply a 200/OK response to the healthcheck.
you'll see that : a curl on the traefik always respond 200.
you'll see in the logs that 2 of the instances doies not respond 200, but 404.
but, on the dashboard, on the backend list, i still got three servers.
i would have expected to have only one server in the backend list.