traefik icon indicating copy to clipboard operation
traefik copied to clipboard

Fix `providers.swarm` "Configuration Examples" in doc, provide real life example

Open bluepuma77 opened this issue 9 months ago • 1 comments

Welcome!

  • [X] Yes, I've searched similar issues on GitHub and didn't find any.
  • [X] Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you expect to see?

Users are following the "Configuration Examples" in doc (community post):

providers:
  swarm:
    # swarm classic (1.12-)
    # endpoint: "tcp://127.0.0.1:2375"
    # docker swarm mode (1.12+)
    endpoint: "tcp://127.0.0.1:2377"

This is of course not working. In most real life use cases, when Traefik is working with Docker Swarm, Traefik itself will be in a container and then Docker socket will not be available on localhost.

Furthermore this seems totally outdated, as "swarm classic" was retired 4 years ago.

So a better example would be:

providers:
  swarm: {}

or extended with improved security:

providers:
  swarm:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false

bluepuma77 avatar May 06 '24 16:05 bluepuma77

Hey @bluepuma77,

Thank you for reaching out. We agree that this documentation section should be fixed.

If you or another community member would like to build it, let us know, and we will work with you to make sure you have all the information needed so that it can be merged.

nmengin avatar May 13 '24 12:05 nmengin