---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: service
  namespace: service-namespace
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  rules:
    - http:
        paths:
          - path: /service-namespace/service(/|$)(.*)
            pathType: Prefix
            backend:
              service:
                name: service
                port:
                  number: 9000
...
