Traefik Hub dashboard to show routers to other servers

I'm new to Traefik Hub, and though I quite like its simplicity, I'm trying to find out the limitations.

I've been using Traefik Proxy for a while now to redirect traffic to different services in different servers at my home.

I have one Traefik Proxy instance in one of the servers and run Traefik Hub agent their. Using docker and portainer for that.

When loggin to traefik hub, I can only see the services/containers that run locally in same server as the where the Traefik hub is running as a container.

What about the other routers that I have configured in Traefik proxy? e.g. other servers with different IP addresses? Is there a reason why they don't show up?
The documentation of traefik hub states that the routers of the proxy should be listed. But that is not the case.

Hey @dvpfig , could you share your Traefik static configuration + docker deployment manifest?
(dynamic configuration as well if you rely on a File provider for manual / external routing)

I want to make sure we have everything to reproduce / confirm the issue you're experiencing.

Hi,
thanks for following up @douglasdtm

The routers and services I want to see coming up in the Hub are running on a different machine in my home network. i.e. Traefik proxy and Hub are running in Docker in one server and I can see in the Hub dashboard the services running on that Docker engine in same server even though I did not connect them to Traefik Proxy. I believe Traefik hub agent gets such info from reading the volume /var/run/docker.sock.
However, other services that run elsewhere in home network and have routers/services in Traefik Proxy are not showing up in the Traefik Hub.

Here is the Traefik proxy and hub agent docker containers in Docker compose in one server e.g. http://192.168.1.5:

version: "3"

services:

  # Start the agent with the latest version
  hub-agent:
    image: ghcr.io/traefik/hub-agent-traefik
    container_name: traefik-hub-agent
    restart: always
    command:
      - run
      - "--hub.token=XXXXXXX"
      - "--auth-server.advertise-url=http://hub-agent"
      - "--traefik.host=traefik"
      - "--traefik.tls.insecure=true"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - proxy
    depends_on:
      - traefik
      
  # Start Traefik    
  traefik:
    image: traefik
    container_name: traefik
    restart: always
    command:
      # Enable Hub communication (open the port 9900 and 9901 by default)
      - "--experimental.hub=true"
      - "--hub.tls.insecure=true"
      - "--metrics.prometheus.addrouterslabels=true"
            
      # Dashboard & Debug & API
      - "--api.dashboard=true"
      - "--log.level=DEBUG"
      # Traefik will listen on port 8080 by default for API request.
      - "--api.insecure=true"
      
      # Enabling docker provider
      - "--providers.docker=true"
      - "--providers.docker.network=proxy"
      - "--providers.file.filename=/config/traefik.yml"
      
      # Do not expose containers unless explicitly told so
      - "--providers.docker.exposedbydefault=false"
      
      # Entryppoints are all https subdomains of main domain
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.http.tls.certresolver=le"
      
      # ACME certificate (Let's Encrypt)
      - "--certificatesresolvers.le.acme.email=XXX@XXXXX"
      - "--certificatesresolvers.le.acme.storage=/config/acme.json"
      
      # HTTP challenge
      - "--certificatesresolvers.le.acme.httpchallenge=true"
      - "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web"
      
    environment:
      - PGID=1000
      - PUGID=1000
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /appdata/traefik:/config

    networks:
      - proxy

#Networks
networks:
  proxy:
    external: true

And the dynamic configuration on a file provider traefik.yml to route incoming traffic to a service running on another server e.g. http://192.168.1.10:

http:
  routers:
    router-A:
      entryPoints:
        - "websecure"
      rule: "Host(`XXXXXX.duckdns.org`)"
      service: service-A
      tls:
        certResolver: le
  services:
    service-A:
      loadbalancer:
        serversTransport: mytransport
        servers:
        - url: "http://192.168.1.10:XXXX"
  serversTransports:
    mytransport:
      insecureSkipVerify: true

Hello @dvpfig,

Thank you for your interest in Traefik Hub.

The documentation of the Traefik hub states that the routers of the proxy should be listed.

I guess there is a misunderstanding: when the agent is installed on a Docker machine, it listens directly to the Docker socket to detect the containers that are running on it.
It doesn’t use the Traefik Proxy dynamic configuration.

So, when you configure some routers and services in your Traefik Proxy using another provider (such as the File provider), the Traefik Hub agent won’t be able to detect them.

Could you point me to the documentation section to allow us to improve it, please?

Here, what I understand from this phrase is that Traefik hub agent discovers and offers to secure routers.
The two first bullet points seem to indicate what the hub can control/expose from the Traefik Proxy but in fact what Traefik Hub agent is doing is to control Docker engine services and not the Traefik proxy routers/services.

Quoting from the documentation page above:


This agent can:

  • get the Traefik metrics to display them in the Traefik Hub UI
  • secure the Traefik routers
  • provide ACME certificates to Traefik
  • transfer requests from the SaaS Platform to Traefik (and then avoid the users to expose directly their infrastructure on the internet)

Hello @dvpfig,

Thank you for your feedback.

I've opened a PR on the Traefik repository to provide more information about the way the Hub agent discovers the Docker containers.

Concerning your other servers, you can install another Hub agent and Traefik on them to discover their containers.