Can you ingressroute to Kubernetes-Dashboard with Auth Middleware?

I have working traefik in front of Kuberntes-Dashboard, but when i add an Auth middleware K-dash reports "Logged In with Auth header" and in main window a 401.

Much more going on behind the scenes than my knowledge of authentication can deal with.

Lots of googling and not a lot found

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: k8s-dashboard-ingress
  namespace: kube-system
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(\`k8s.xyz.org\`) # Hostname to match
      kind: Rule
      services: 
        - name: traefik-kubernetes-dashboard
          port: 8443
          scheme: https
          passHostHeader: false
      middlewares:
        - name: auth
          namespace: kube-system
  tls:
    secretName: cert

hello @jamesarbrown

The response code 401 means that the request has not been authenticated. Would you please double-check that the Basic Auth middleware is correctly configured?

In one of my workshops I explained how to use the middleware:

Hope that helps.

Thank you,

1 Like