Hi,
Traefik Hub looks like an awesome product so I wanted to check it out. Initial installation seemed easy enough but now I've hit a road block.
It doesn't seem like any of the networks that my containers are attached to, are being listed in the Hub.
I already had a traefik instance running in my local swarm and in the yaml, there is the following config:
...
networks:
- traefik-public
...
networks:
traefik-public:
external: true
All the containers currently exposed via traefik inside our network (including the hub agent) have the same config i.e. they're in the same network.
However, when I look at those services in the Hub, they don't have any networks listed which makes publishing them impossible.
Any pointers would be greatly appreciated!
Hey @dockernewb,
sorry for the late reply.
I actually tried to reproduce that issue, but I failed.
Are you trying that with compose or swarm? Can I have your stack files or at least a minimal reproducible case?
I'd really love to figure out the root case, I just don't get down to it.
Hey, no worries 
Here are the stacks. I changed them slightly so as to remove anything personally identifiable.
Service:
version: '3.8'
services:
myapp:
image: myimage
healthcheck:
test: ["CMD", "curl", "-X", "POST", "-H", "Content-Type: text/plain", "--data", "blabla", "http://someurl"]
interval: 60s
timeout: 5s
retries: 2
start_period: 20s
deploy:
replicas: 2
placement:
max_replicas_per_node: 1
restart_policy:
condition: any
update_config:
parallelism: 1
delay: 30s
order: stop-first
rollback_config:
parallelism: 1
delay: 30s
order: stop-first
labels:
- "traefik.enable=true"
- "traefik.http.routers.myapp.rule=Host(`myapp.myhost.at`)"
- "traefik.http.routers.myapp.entrypoints=websecure"
- "traefik.http.routers.myapp.tls=true"
- "traefik.http.services.myapp.loadbalancer.server.port=8080"
networks:
- traefik-public
networks:
traefik-public:
external: true
Traefik:
version: '3.8'
#dependency: network traefik-public
#dependency: secrets for certificates
#dependency: configs for dynamic configuration
services:
traefik:
image: traefik:v2.7
command:
# Enable Hub communication (open the port 9900 and 9901 by default)
- "--experimental.hub=true"
- "--hub.tls.insecure=true"
- "--metrics.prometheus.addrouterslabels=true"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.swarmMode=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=traefik-public"
- "--entrypoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--providers.file.directory=/etc/traefik/dynamic"
- "--api.dashboard=true"
- "--log.level=INFO"
- "--pilot.token=%a token%
"
#- "--api.debug=true"
#- "--api.insecure=true"
ports:
- 80:80
- 8080:8080
- 443:443
- 9900:9900
- 9901:9901
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- traefik-public
deploy:
restart_policy:
condition: any
placement:
constraints:
- node.role == manager
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.tls=true"
- "traefik.http.routers.dashboard.entrypoints=websecure"
- "traefik.http.routers.dashboard.rule=Host(`traefik.myhost.at`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=user:$$pwd$$notreal"
# Dummy service for Swarm port detection. The port can be any valid integer value.
- "traefik.http.services.dummy-svc.loadbalancer.server.port=9999"
secrets:
- secret1
- secret2
configs:
- source: dynamic_traefik_yaml_2022
target: /etc/traefik/dynamic/dynamic.yaml
configs:
dynamic_traefik_yaml_2022:
external: true
secrets:
secret1:
external: true
secret2:
external: true
networks:
traefik-public:
external: true
Traefik Hub:
version: "3"
services:
# Start the agent with the latest version
hub-agent:
hostname: hub-agent
image: ghcr.io/traefik/hub-agent-traefik:v0.7.2
command:
- run
- --hub.token=%a token%
- --auth-server.advertise-url=http://hub-agent
- --traefik.host=traefik.myhost.at
- --traefik.docker.swarm-mode
- --traefik.tls.insecure=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
replicas: 1
networks:
- traefik-public
networks:
traefik-public:
external: true
As you can see we're using Swarm.
Thank you for taking a look at this!
Hello @dockernewb,
Do you still face this issue?
We haven't been able to reproduce it on our side.
Yes, I do but to be honest I haven't been trying to resolve it the last few weeks. I was really just looking to test it and right now I don't really have the time to dig into it deeper.