Traefik

From Leo's Notes
Revision as of 18:15, 26 January 2021 by Leo (talk | contribs) (Created page with "<br /> == Docker == The traefik docker backend is configured by labeling your docker containers. === Traefik v2 === You must have separate routers for each entrypoint. List...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This page was last edited on 26 January 2021, at 18:15.


Docker

The traefik docker backend is configured by labeling your docker containers.

Traefik v2

You must have separate routers for each entrypoint. Listing them as entrypoints=http,https doesn't work.

labels:
      - traefik.enable=true
      - traefik.docker.network=traefik
      # service
      - traefik.http.services.gitlab-service.loadbalancer.server.port=8888
      # https
      - traefik.http.routers.gitlab-https.entrypoints=https
      - traefik.http.routers.gitlab-https.rule=Host(`gitlab.example.com`)
      - traefik.http.routers.gitlab-https.tls=true
      - traefik.http.routers.gitlab-https.tls.certresolver=letsencrypt
      - traefik.http.routers.gitlab-https.service=gitlab-service
      # http
      - traefik.http.routers.gitlab.entrypoints=http
      - traefik.http.routers.gitlab.rule=Host(`gitlab.example.com`)
      - traefik.http.routers.gitlab.service=gitlab-service