Home:ALL Converter>Traefik uses wrong frontend rule with Jupyterhub

Traefik uses wrong frontend rule with Jupyterhub

Ask Time:2020-02-29T08:31:16         Author:AMMJ

Json Formatter

Traefik uses a different frontend rule for Jupyterhub than the one that I specified as label. I set it to 'hub.domain.com' but traefik says rule found "Host:jupyterhub.jupyterhub.domain.com". There seems to be some overwriting going on. There is no label with "Host:jupyterhub.jupyterhub.domain.com"

This is my Docker Compose:


version: '3'

services:
  jupyterhub:
    build: jupyterhub
    container_name: jupyterhub_hub
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      DOCKER_JUPYTER_IMAGE: jupyterlab_img
      DOCKER_NETWORK_NAME: ${COMPOSE_PROJECT_NAME}_default
      OAUTH_CLIENT_ID: ${OAUTH_CLIENT_ID}
      OAUTH_CLIENT_SECRET: ${OAUTH_CLIENT_SECRET}
      OAUTH_CALLBACK_URL: ${OAUTH_CALLBACK_URL}
      HUB_IP: jupyterhub_hub
    labels:
      - "traefik.enable=true"
      - "treafik.frontend.rule=Host:${HOST}"
    volumes:
      - jupyterhub_data:/srv/jupyterhub

  traefik:
    image: traefik:1.7-alpine
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - /opt/appdata/traefik/traefik.toml:/etc/traefik/traefik.toml
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/appdata/traefik/acme.json:/etc/traefik/acme.json

  jupyterlab:
    build: jupyterlab
    image: jupyterlab_img
    command: echo

volumes:
  jupyterhub_data:

And this is my traefik.toml:

debug = false

logLevel = "ERROR"
defaultEntryPoints = ["https","http"]

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
  address = ":443"
  [entryPoints.https.tls]

[retry]

[api]
dashboard = true
insecure = true

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "domain.com"
watch = true
exposedByDefault = false

[acme]
email = "[email protected]"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"

Author:AMMJ,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60460945/traefik-uses-wrong-frontend-rule-with-jupyterhub
yy