Traefik v2 admin UI not loading

I am trying a simple setup of Traefik v2 on fresh cluster (EKS).

I have following configuration

apiVersion: v1
kind: ConfigMap
metadata:
  name: traefik-conf
  namespace: kube-system
data:
  traefik.toml: |
    # traefik.toml
    ## static configuration
    [entryPoints]
      [entryPoints.web]
        address = ":80"
      [entryPoints.admin]
        address = ":8080"
    [providers]
      [providers.file]
        directory = "/etc/traefik/providers/"
        watch = true

  dynamic.toml: |
    # dynamic.toml
    ## dynamic configuration
    defaultEntryPoints = ["http","https"]
    logLevel = "INFO"

    [metrics]
      [metrics.prometheus]
        buckets = [0.1,0.3,1.2,5.0]
    [kubernetes]
    [api]
    [ping]
    [accessLog]
    [acme]
      email = "abc@domain.com"
      storage = "traefik-external-certificates/acme/account"
      acmeLogging = true
      entryPoint = "https"
      OnHostRule = true
      [acme.httpChallenge]
        entryPoint="http"

and deployment as :

kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: traefik
  namespace: kube-system
  labels:
    app: traefik
spec:
  selector:
    matchLabels:
      app: traefik
  minReadySeconds: 5
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
  template:
    metadata:
      labels:
        app: traefik
    spec:
      serviceAccountName: traefik-ingress-controller
      terminationGracePeriodSeconds: 60
      hostNetwork: true
      containers:
      - name: traefik
        image: traefik:v2.0
        args:
          - --api
          - --accesslog
          - --providers.kubernetescrd
          - --ping
          - --accesslog=true
          - --log=true
        ports:
          - name: web
            containerPort: 8000
          - name: websecure
            containerPort: 443
          - name: admin
            containerPort: 8080
        securityContext:
          privileged: true
        volumeMounts:
          - mountPath: /etc/traefik/traefik.toml
            name: traefik-config
            subPath: traefik.toml
          - mountPath: /etc/traefik/providers/dynamic.toml
            name: traefik-config
            subPath: dynamic.toml
      volumes:
      - name: traefik-config
        configMap:
          name: traefik-conf

---

kind: Service
apiVersion: v1
metadata:
  name: traefik-external
  namespace: kube-system
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
    service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: "Service=lc,Name=test-eks-frontend"
spec:
  type: LoadBalancer
  externalTrafficPolicy: Local
  selector:
    app: traefik
  ports:
    - name: web
      protocol: TCP
      port: 80
      targetPort: 8000
    - name: websecure
      protocol: TCP
      port: 443
      targetPort: 443

---

apiVersion: v1
kind: Service
metadata:
  name: traefik-admin
  namespace: kube-system
spec:
  type: ClusterIP
  ports:
    - protocol: TCP
      name: admin
      port: 8080
  selector:
    app: traefik

---

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: traefik-admin
  namespace: kube-system
spec:
  entryPoints:
    - admin
  routes:
  - match: Host(`traefik.test.domain.com`) && PathPrefix(`/`)
    kind: Rule
    priority: 1
    middlewares:
      - name: admin-auth
    services:
    - name: traefik-admin
      port: 8080

---

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: admin-auth
  namespace: kube-system
spec:
  basicAuth:
    users:
    - admin:$vgtyuhbgty$rtsbbcj$345r6tyggfr67ujhgt67uj

Similar setup works in Traefik 1.7.x. Here the admin UI is not loading.

When I curl localhost:8080 in traefik container I get 404 page not found

What I am missing here ?

Sorry, no experience with AWS here, but quite a bit with kubernetes and traefik. What/who is supposed to create ELB? If you don't use helm chart (I never used it so I would not know), I'm pretty sure that traefik does not do it itself. So if you say it worked in 1.7 and not in 2, may be you missed a step of creating ELB yourself?

Hello,

in the v2 you cannot mix CLI flags and file for the static configuration.

https://docs.traefik.io/v2.0/getting-started/configuration-overview/#the-static-configuration

So either you remove CLI flags (args) or you remove the file (traefik.toml)

Also you have mixed static with dynamic configuration and v1 with v2 configuration:

  • the file dynamic.toml don't contain dynamic configuration but v1 static configuration.

For the API:

--api.insecure=true

https://docs.traefik.io/v2.0/operations/api/#configuration