traefik / traefik-library-image

Used to build Official Docker image of Traefik Proxy

Home Page:https://store.docker.com/images/traefik

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect loadbalance if count of replicas is even

man4j opened this issue · comments

Do you want to request a feature or report a bug?
Bug

What did you do?
I use docker provider with swarm mode. If i set even replicas count, f.e. 2,4,6... traefik does not use part of the replicas.
If i set odd replicas count (3,5,7...) traefik works correctly.

What did you expect to see?
Correct roundrobin

What did you see instead?
Skips part of the replicas

Output of traefik version: 2.6, 2.7

my docker swarm service config:

        "Name": "traefik-whoami-traefik-test",
        "Labels": {
            "traefik.http.middlewares.my-basic-auth.basicAuth.users": "admin:$apr1$9O6lRT2m$y46NNFXGGzw2SpjtsQw3Z1",
            "traefik.http.middlewares.my-buffering.buffering.maxRequestBodyBytes": "20971520",
            "traefik.http.middlewares.my-buffering.buffering.maxResponseBodyBytes": "20971520",
            "traefik.http.middlewares.my-buffering.buffering.memRequestBodyBytes": "20971520",
            "traefik.http.middlewares.my-buffering.buffering.memResponseBodyBytes": "20971520",
            "traefik.http.routers.my-default-http-router.entrypoints": "http",
            "traefik.http.routers.my-default-http-router.middlewares": "my-basic-auth,my-buffering",
            "traefik.http.routers.my-default-http-router.service": "my-service",
            "traefik.http.services.my-service.loadbalancer.healthcheck.interval": "10s",
            "traefik.http.services.my-service.loadbalancer.healthcheck.path": "/foo",
            "traefik.http.services.my-service.loadbalancer.healthcheck.timeout": "3s",
            "traefik.http.services.my-service.loadbalancer.server.port": "80",
            "traefik.http.services.my-service.loadbalancer.sticky.cookie": "false"
        }

my traefik config:

exec /entrypoint.sh traefik $@
--entrypoints.http.address=:${PORT}
--entrypoints.https.address=:${HTTPS_PORT}
--entrypoints.traefik.address=:${DASHBOARD_PORT}
--api.dashboard=true
--metrics.prometheus=true
--providers.docker.swarmMode=true
--providers.docker.endpoint=tcp://docker-socket-proxy-${NAMESPACE}:2375
--providers.docker.network=clustercontrol-net
--providers.docker.defaultRule="PathPrefix("/")"
--providers.docker.constraints="Label("namespace", "${NAMESPACE}")"
--providers.file.filename=conf.yml
--tracing=${ENABLE_TRACING}
--tracing.jaeger=${ENABLE_TRACING}
--tracing.jaeger.disableAttemptReconnecting=false
--tracing.jaeger.collector.endpoint=${TRACING_URL}
--certificatesresolvers.my-cert-resolver.acme.tlschallenge=true
--certificatesresolvers.my-cert-resolver.acme.storage="/etc/traefik/acme.json"
--certificatesresolvers.my-cert-resolver.acme.email=${ACME_EMAIL}

Hello I'm a bot,

For issues about Traefik, the repository is here: https://github.com/traefik/traefik
If it's a question, you ask it on the from: https://community.traefik.io/