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

Docker segment labels and defining the backend name #3351

Closed
Duvel opened this issue May 19, 2018 · 5 comments
Closed

Docker segment labels and defining the backend name #3351

Duvel opened this issue May 19, 2018 · 5 comments

Comments

@Duvel
Copy link

Duvel commented May 19, 2018

Do you want to request a feature or report a bug?

Bug

What did you do?

I'm using segment labels for multiple frontends for the same backend. I'm not using it for different ports, but I think that doesn't matter.

- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.backend=service"
- "traefik.port=9000"
- "traefik.basic.frontend.rule=Host:app.my-awesome-app.org"
- "traefik.basic.protocol=http"
- "traefik.admin.frontend.rule=Host:admin-app.my-awesome-app.org"
- "traefik.admin.protocol=https"

Prior to 1.6 this used to work, as a workaround it seems I can create a backend per frontend, so it generates multiple frontends.

- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.port=9000"
- "traefik.basic.frontend.rule=Host:app.my-awesome-app.org"
- "traefik.basic.protocol=http"
- "traefik.basic.backend=basic"
- "traefik.admin.frontend.rule=Host:admin-app.my-awesome-app.org"
- "traefik.admin.protocol=https"
- "traefik.admin.backend=admin"

And then i saw something as I remembered just reading this:

If a label is defined both as a container label and a segment label (for example traefik.<segment_name>.port=PORT and traefik.port=PORT), the segment label is used to defined the <segment_name> property (port in the example).

I then removed backend totally and now I have multiple frontends and one auto-generated name for the backend.

What did you expect to see?

Multiple frontends

What did you see instead?

Single frontend, which is looping through the frontend rules.

Output of traefik version: (What version of Traefik are you using?)

1.6.1

What is your environment & configuration (arguments, toml, provider, platform, ...)?

      - "--web"
      - "--entrypoints=Name:http Address::80 Redirect.EntryPoint:https"
      - "--entrypoints=Name:https Address::443 TLS"
      - "--defaultentrypoints=http,https"
      - "--logLevel=INFO"
      - "--acme"
      - "--acme.storage=/etc/traefik/acme/acme.json"
      - "--acme.entryPoint=https"
      - "--acme.onHostRule=true"
      - "--acme.acmeLogging=true"
      - "--acme.email=xxxx"
      - "--acme.dnsChallenge.provider=manual"
      - "--acme.dnsChallenge.delayBeforeCheck=0"
      - "--docker"
      - "--docker.swarmmode"
      - "--docker.domain=xxxx"
      - "--docker.watch"
      - "--docker.exposedbydefault=false"
@ldez
Copy link
Member

ldez commented May 19, 2018

Thanks for your interest in Træfik!

In fact, the previous behavior was a bug (see #3317).

Before 1.6.1:
The label traefik.backend was partially ignored.
The traefik.<segment_name>.frontend.backend label was used to name segment backend, this suggested that it was possible to set a backend manually for a frontend but it's not.

Since 1.6.1:
The label traefik.backend is fully used.
The traefik.<segment_name>.frontend.backend label is removed for the benefit of traefik.<segment_name>.backend

@ldez ldez closed this as completed May 19, 2018
@ldez ldez added kind/question a question and removed status/0-needs-triage labels May 19, 2018
@Duvel
Copy link
Author

Duvel commented May 19, 2018

So it is no longer possible to have multiple frontends for the same named backed as well?

Because that is the issue, that I'm having.

@ldez
Copy link
Member

ldez commented May 19, 2018

Yes, it's no longer possible to have multiple frontends for one backend.

The expected behavior for segment: one frontend and one backend for each segment.

Note that multiple frontends for one backend doesn't really work because some frontend configuration are ignored when using the same backend.

@Duvel
Copy link
Author

Duvel commented May 19, 2018

Thanks for the info, I will update my configurations then for this new situation.

@ldez
Copy link
Member

ldez commented Oct 4, 2018

For memory, now it's possible to have multiple frontends for one backend, see #3511.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants