allowEmptyServices, replicas: 0 = not registered

Hello

I try to set this flag allowEmptyServices, but it don't seem to be working as expected

traefik.yaml :

providers:
  providersThrottleDuration: 2s
  swarm:
    watch: true
    exposedByDefault: false
    network: front-net
    allowEmptyServices: true
  docker:
    watch: true
    exposedByDefault: false
    network: front-net
    allowEmptyServices: true

And my compose :

services:
  whoami:
    image: containous/whoami:v1.5.0
    deploy:
      replicas: 0
      labels:
        - traefik.enable=true
        - "traefik.http.routers.whoami.entrypoints=http"
        - traefik.http.routers.whoami.rule=Host(`ttt.docker.internal.lan`)
        - "traefik.http.services.whoami.loadbalancer.server.port=80"
    networks:
      - front-net
 
networks:
  front-net:
    external: true

and if I go on ttt.docker.internal.lan I get 404 not found if I put replicas: 0

The allowEmptyServices doc mentions

If the parameter is set to true , any servers load balancer defined for Docker containers is created regardless of the healthiness of the corresponding containers. It also then stays alive and responsive even at times when it becomes empty, i.e. when all its children containers become unhealthy. This results in 503 HTTP responses instead of 404 ones, in the above cases.

So it might not be about non-existing instances (replicas=0), but only about un-healthy containers.

Thank you

I miss understood the documentation :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.