4

I just need to know the answer on this question

If it is disabled by default is there any option to enabled it on all backends without adding label "traefik.backend.loadbalancer.swarm=true" on every service?

Bauer01
  • 281
  • 1
  • 3
  • 13

1 Answers1

0

By exploiting a bug (issue 2138), I came to the conclusion that the default value is false (version v1.7.4).

I think you have to add that label for every service you use as an backend.

Take the example of enabling sticky session, in traefik.toml, you do:

[backends]
  [backends.backend1]
    # Enable sticky session
    [backends.backend1.loadbalancer.stickiness]

This is equivalent to add the following in the compose file,

  - "traefik.backend=backend1"
  - "traefik.backend.loadbalancer.stickiness=true"
Siyu
  • 11,187
  • 4
  • 43
  • 55