Access Kubernetes dashboard via subpath

Hi,

I'm trying accessing Kubernetes Dashboard (GitHub - kubernetes/dashboard: General-purpose web UI for Kubernetes clusters) over a subpath. It works without "PathPrefix(/k)". When adding PathPrefix traffic enters the correct service but Traefik gives a 404.

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: kubernetes-dashboard
  namespace: kubernetes-dashboard
  annotations:
    traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"

spec:
  entryPoints:
    - websecure
    - web
  routes:
    - kind: Rule
      match: Host(`example.dev`) && PathPrefix(`/k`)
      services:
        - name: kubernetes-dashboard
          port: 8443
          scheme: https

I've found this issue on Stackoverflow Kubernetes Dashboard not accessible when providing path in ingress - Stack Overflow, what's Traefik's equalivant?

Thanks in advance!

Hi @svanrossem,

have you find a solution maybe?

Hello @dydomby @svanrossem

While exploring the abyss of the Internet I have found that article:

which seems to be a kind of solution to your question. Please let us know id the suggestion included in that article solved your problem.

Thank you,