apiVersion: v1
kind: ConfigMap
metadata:
  name: traefik-conf
data:
  traefik.toml: |
    defaultEntryPoints = ["http","https"]
    [entryPoints]
      [entryPoints.http]
      address = ":80"
      compress = true
      [entryPoints.http.forwardedHeaders]
        trustedIPs = ["0.0.0.0/0"]
      [entryPoints.http.redirect]
        entryPoint = "https"
      [entryPoints.https]
      address = ":443"
      compress = true
      [entryPoints.https.forwardedHeaders]
        trustedIPs = ["0.0.0.0/0"]
      [entryPoints.https.tls]
      [entryPoints.traefik]
        address = ":8080"
        [entryPoints.traefik.auth]
          [entryPoints.traefik.auth.basic]
            users = [
              "admin:$$apr1$$CnwmOsD2$$B4Yzlh0SebfBCjULQCX3y0",
            ]

    [acme]
    email = "your@email.com"
    storageFile = "/acme/acme.json"
    entryPoint = "https"
    onDemand = true
    onHostRule = true

    [acme.httpChallenge]
      entryPoint = "http"

    [[acme.domains]]
    main = "mydomain.com"

    [api]
      entryPoint = "traefik"
      dashboard = true