Skip to content

Concept

Routes with same load_balance.link are grouped in the same load-balancer.

Support HTTP routes only. Will plan for TCP/UDP load-balancing in the future if needed.

Properties

PropertyDescriptionDefaultAllowed Values / Syntax
linkSubdomain of load-balancerN/Astring
modeLoad-balance moderound_robin
  • round_robin
  • least_conn
  • ip_hash
optionsMode specific optionsN/AN/A

IP Hash Mode Options

See RealIP middleware

Examples

Docker compose

yaml
services:
  whoami:
    image: traefik/whoami
    deploy:
      replicas: 10
    labels:
      proxy.*.load_balance: |
        link: whoami
        mode: round_robin
    ports:
      - 80
    restart: unless-stopped

Multi-nodes

Set the same load_balance.link across all nodes

yaml
services:
  whoami:
    image: traefik/whoami
    container_name: whoami
    labels:
      proxy.whoami.load_balance: |
        link: whoami
        mode: round_robin
    ports:
      - 80
    restart: unless-stopped

Route file

yaml
whoami-1:
  host: 10.0.2.1
  load_balance:
    link: whoami
    mode: round_robin
whoami-2:
  host: 10.0.2.2
  load_balance:
    link: whoami
whoami-3:
  host: 10.0.2.3
  load_balance:
    link: whoami

Released under the MIT License.