---
apiVersion: v1
kind: ConfigMap
metadata:
  name: traefik-config
  namespace: admin
data:
  dynamic.yml: |
    http:
      middlewares:
        basic:
          basicAuth:
            users: ["${traefik_basic_auth_credentials_hash}"]

        localOnly:
          ipWhiteList:
            sourceRange:
              - "${network_subnet}"
              - 10.42.0.1/16

      routers:
        api:
          rule: "Host(`traefik.${domain}`)"
          entrypoints: ["websecure"]
          service: "api@internal"
          middlewares:
            - "localOnly@file"
            - "admin-forwardauth-authelia@kubernetescrd"
