Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

traefik 3.0 does not find services on swarm with new syntax #10670

Open
2 tasks done
Twiederh opened this issue Apr 30, 2024 · 6 comments
Open
2 tasks done

traefik 3.0 does not find services on swarm with new syntax #10670

Twiederh opened this issue Apr 30, 2024 · 6 comments

Comments

@Twiederh
Copy link

Welcome!

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

What did you do?

I upgraded from 2.11.2 to 3.0.0

What did you see instead?

None of my services showed up on the dashboard anymore. I would really appreciate if you could refrain from breaking configurations through new commands. I am happy that you are developing Traefik further but it is really frustrating that after an upgrade nothing works. Like last time with 2.11.1 I spent hours trying to make traefik work again. I ended up going back to 2.11.2 to have my services running again.

What version of Traefik are you using?

3.0.0

What is your environment & configuration?

command:
  - "--log.level=ERROR"
  - "--log.filepath=logs/traefik.log"
  - "--accesslog.filepath=logs/access.log"
  - "--api.dashboard=true"
  - "--api.insecure=true"
  - "--providers.docker=true"
  - "--providers.swarm.endpoint=tcp://127.0.0.1:2377"
  - "--providers.docker.exposedbydefault=false"
  - "--providers.docker.watch"
  - "--providers.docker.network=proxy"
  - "--providers.docker.endpoint=unix:///var/run/docker.sock"
  - "--entrypoints.http.address=:80"
  - "--entrypoints.https.address=:443"
  - "--certificatesresolvers.letsencrypt.acme.dnschallenge=true"
  - "--certificatesresolvers.letsencrypt.acme.email=thomas@wiederhol.de"
  - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
  - "--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=allinkl"
  - "--certificatesresolvers.letsencrypt.acme.dnschallenge.resolvers=8.8.8.8:53"
  - "--certificatesresolvers.letsencrypt.acme.dnschallenge.resolvers=8.8.4.4:53"

If applicable, please paste the log output in DEBUG level

No response

@ldez
Copy link
Member

ldez commented Apr 30, 2024

Hello,

swarm is now a dedicated provider:

In your configuration, you are mixing the 2 providers (Docker and Swarm), if you want to use Swarm only then you should migrate your Docker provider configuration to the Swarm provider.

@Twiederh
Copy link
Author

Twiederh commented Apr 30, 2024

After another hour of going through the three documents I finally have it working:
command:
- "--log.level=ERROR"
- "--log.filepath=logs/traefik.log"
- "--accesslog.filepath=logs/access.log"
- "--api.dashboard=true"
- "--api.insecure=true"
- "--providers.swarm.network=proxy"
- "--providers.swarm.endpoint=unix:///var/run/docker.sock"
- "--providers.swarm.exposedByDefault=false"
- "--entryPoints.http.address=:80"
- "--entryPoints.https.address=:443"

It would be nice if there would be a basic configuration, step by step and not only snippets here and there. It would be a lot less trial and error and would scare of people a lot less. It took me about half a year to get everything running including TLS with letsencrypt (the letsencrypt part took me several months alone because the link between the entry points and the services is not really documented well, it took me ages to figure out that the only thing I was missing was specifying the correct network, so traefik could route the request to the service.

When you know this, it is obvious but if you don't, you just see 404s every time you try something and you do not get any hint what might be wrong.
Same for this configuration here: the guide to upgrade only specifies to connect to localhost port 2377. In my case this did not work. the docker socket connection worked.

If you do not know where the problem is, you have to try different things which usually messes up the configuration. I found that half of my traefik labels were wrong as I copied them from the examples until traefik sort of worked. At least I was able to sort that out now.

@nmengin
Copy link
Contributor

nmengin commented May 2, 2024

Hello @Twiederh,

Thanks for reaching out.

It would be nice if there would be a basic configuration, step by step and not only snippets here and there.

The idea sounds great, such documentation would help a lot of people I guess.
Do not hesitate to open a PR: Traefik is an Open Source project and any help is appreciated (and, concerning the documentation, it's more than appreciated 😅 ).

@Twiederh
Copy link
Author

Twiederh commented May 2, 2024

I would be happy to help but when trying to submit a PR, I received "must be a collaborator. This is what I entered:

What does this PR do?

For the initial configuration of Traefik there should be basic configuration examples that show completely how to configure Traefik from scratch to get new users up to speed very quickly. The configuration examples should show a complete scenario, from my own experience I see two areas that took me long to figure out the configuration:

  • Basic setup with initial configuration items for both yaml and toml files and for environment variables in Docker configuration files
  • complete TLS configuration steps end-to-end

Also they should only cover the absolute minimum configuration necessary. The additional documentation then helps the user to find the additional configuration documentation for additional features but then there would be a minimum a new user could get back to knowing that it works

Motivation

I struggled big time trying to get things like TLS working completely, the changes in 3..0 with Docker Swarm again took me hours to get back to a working configuration. There is a lot of documentation but sometimes it would be great if there would be configuration examples that can be used to compare ones own configuration to. For example for TLS and the loadbalancer piece of the configuration I never understood that there needs to be a network connection between Traefik and the container that is configured for TLS. In hindsight, it is obvious but if you do not know where to look and how to troubleshoot, you configure the steps in the documentation and they do not work - and even worse, you do not see why.

More

  • Added/updated tests
  • Added/updated documentation

Additional Notes

I would be happy to help here, I an "only" running a setup with Docker Swarm but I have at least some configurations that would help others as well - in return maybe someone can remove the unnecessary bits of the configuration to make them cleaner.

@nmengin
Copy link
Contributor

nmengin commented May 6, 2024

Hello @Twiederh,

I received "must be a collaborato

This error happens when people try to push on Traefik repo. Have you forked traefik before opening the PR?

@traefiker
Copy link
Contributor

Hi! I'm Træfiker 🤖 the bot in charge of tidying up the issues.I have to close this one because of its lack of activity 😞Feel free to re-open it or join our Community Forum.

@kevinpollet kevinpollet reopened this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants