For a long time I have been struggling with enabling Dashboard on Traefik V2.x.x. in swarmMode. I'm not deep into the fabrics of Traefik, so I have no clue to why.
Basically if I enable "traefik.http.routers.api.service=api@internal" in the Traefik deployment, I get the dashboard, but all other services i deploy wil be inaccessable (404). If i remove the above line from Traefik all services will be available again, but Dashboard is then inaccessible (404).
I have trawled through almoste all examples out there and tested with multible versions of Traefik V2. without any success.
Just a guess here as I'm also struggling with some aspects of setting up my traefik swarm set, but I have managed to get both deployed services and my dashboard working as expected (just not over https which is my current challenge).
What else have you configured for traefik.http.routers.api.?
I have enabled api dashboard in the config file (traefik.yml) and in the service I have the following labels set. I have followed the docs about putting these in the deploy section, but that has also caused some trubles for me. So, I actually have better experience setting the labels on their own (without the deploy tag)
BTW. I have also tried with other names instead of "api", like "dashboard" etc.
I have grown to like Traefik very much as proxy and would rather not go back to Nginx, the samme matters for Docker Swarm, where I would rather not want to go back to K8s. But, there just seems to be these small unsolved problems from time to time.
Would you please share your entire configuration with the correct YAML indentation? It is difficult to help you since the example you shared has an incorrect indentation.
However, you can also have a look at my old example (but it still should works) with Traefik Proxy and Docker Swarm. Here is the link: