# define Traefik configuration
kind: ConfigMap
apiVersion: v1
metadata:
  name: traefik-config
data:
  traefik.toml: |
    # traefik.toml
    logLevel = "DEBUG"
    defaultEntryPoints = ["http","https"]
    [entryPoints]
      [entryPoints.http]
      address = ":80"
      [entryPoints.http.redirect]
      entryPoint = "https"
      # [entryPoints.https.auth.basic]
      # users = ["dstroot:e33af7471e19f8c0bdae6184784f9c125d4ee73a"]
      [entryPoints.https]
      address = ":443"
      [entryPoints.https.tls]

    # Træfik can be configured using a RESTful api. To enable it:
    [web]
    address = ":8080"

    # Optional
    # ReadOnly = false
    # To enable more detailed statistics
    # [web.statistics]
    #   RecentErrors = 10
    # To enable Traefik to export internal metrics to Prometheus
    # [web.metrics.prometheus]
    #   Buckets=[0.1,0.3,1.2,5.0]
    # To enable basic auth on the webui
    # with 2 user/pass: test:test and test2:test2
    # Passwords can be encoded in MD5, SHA1 and BCrypt: you can use htpasswd to generate those ones
    #   [web.auth.basic]
    #     users = ["test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/", "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"]
    # To enable digest auth on the webui
    # with 2 user/realm/pass: test:traefik:test and test2:traefik:test2
    # You can use htdigest to generate those ones
    #   [web.auth.digest]
    #     users = ["test:traefik:a2688e031edb4be6a3797f3882655c05 ", "test2:traefik:518845800f9e2bfb1f1f740ec24f074e"]

    [kubernetes]

    [acme]
    email = "dev@d-talks.org"
    storage = "acme/acme.json"
    entryPoint = "https"
    acmeLogging = true
    # onDemand = true
    onHostRule = true

    [acme.httpChallenge]
      entryPoint = "http"

    # CA server to use
    # Uncomment the line to run on the staging let's encrypt server
    # Comment out to go to prod
    # caServer = "https://acme-staging.api.letsencrypt.org/directory"

    # Domains list
    # You can provide SANs (alternative domains) to each main domain
    # All domains must have A/AAAA records pointing to Traefik
    # WARNING, Take note that Let's Encrypt have rate limiting: https://letsencrypt.org/docs/rate-limits
    # Each domain & SANs will lead to a certificate request.
    [[acme.domains]]
       main = "d-talks.org"
       # sans = ["sans.domain.com"]
    # [[acme.domains]]
    #   main = "local3.com"
    # [[acme.domains]]
    #   main = "local4.com"
