Help converting Nginx Ingress with regex to Traefik v2

Hi,

I have troubles converting the following nginx ingress to a Traefik V2 one.
I tried stripmiddleware and so on, but nothing works.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: frontend
  annotations:
    traefik.ingress.kubernetes.io/router.tls: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  ingressClassName: traefik
  rules:
  - host: x.x.x
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: prime-manager-frontend
            port:
              number: 80 
      - path: /idm(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: prime-manager-frontend
            port:
              number: 80 
      - path: /login(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: prime-manager-frontend
            port:
              number: 80       
      - path: /desktop(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: prime-manager-frontend
            port:
              number: 80 
      - path: /setup(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: prime-manager-frontend
            port:
              number: 80
      - path: /main(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: prime-manager-frontend
            port:
              number: 80                                     
  tls:
  - hosts:
    - x.x.x
    secretName: primemanager-x-x
1 Like

I've done a writeup of a working example on traefik 3.x here Allow configuring rule syntax with Kubernetes Ingress annotation by rtribotte · Pull Request #10985 · traefik/traefik · GitHub

Note we have had to pass in --core.defaultrulesyntax=v2 as a CLI switch to make it work.