Documentation of dashboard in secure mode

In the documentation section
https://docs.traefik.io/operations/dashboard/#secure-mode
in the example of Dashboard Dynamic Configuration Examples (/ Kubernetes CRD )

I don't undertand if it's a lack or if it's normal: no middleware is declared inside the ingressroute
but you build a middleware basicAuth.

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: traefik-dashboard
spec:
  routes:
  - match: Host(`traefik.domain.com`)
    kind: Rule
    services:
    - name: api@internal
      kind: TraefikService
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: auth
spec:
  basicAuth:
    secret: secretName # Kubernetes secret named "secretName"

Hello,

there is an error in the example, the fix:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: traefik-dashboard
spec:
  routes:
  - match: Host(`traefik.domain.com`)
    kind: Rule
    services:
    - name: api@internal
      kind: TraefikService
    middlewares:
      - name: auth
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: auth
spec:
  basicAuth:
    secret: secretName # Kubernetes secret named "secretName"
1 Like