PathPrefixStrip 在入口处被忽略

PathPrefixStrip is ignored on ingress

Traefik 版本 2.5.6

我有以下入口设置:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  kubernetes.io/ingress.class: traefik
  traefik.ingress.kubernetes.io/app-root: /users
  traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip

  name: users
spec:
  rules:
  - host: dev.[REDUCTED]
    http:
      paths:
      - backend:
          service:
            name: users-service
            port:
              number: 80
        path: /users
        pathType: Prefix

但是当我打电话时:

curl -i http://dev.[REDUCTED]/users/THIS-SHOUD-BE-ROOT

我进入 pod,提供服务:

error: GET /users/THIS-SHOUD-BE-ROOT 404

这可能是什么原因?

尝试使用 Traefik Routers,如下例所示:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: users
  namespace: default
spec:
  entryPoints:
    - web
  routes:
  - match: Host(`dev.[REDUCTED]`) && PathPrefix(`/users`)
    kind: Rule
    services:
    - name: users-service
      port: 80