Using Ingress URL Rewrite

Note: As of v1.8, Enterprise PKS has been renamed to VMware Tanzu Kubernetes Grid Integrated Edition. Some screenshots in this documentation do not yet reflect the change.

Page last updated:

This topic describes how to perform URL rewrite for Kubernetes ingress resources.

About Support for URL Rewrite for Ingress Resources

Tanzu Kubernetes Grid Integrated Edition with NSX-T supports ingress URL path rewrite using NSX-T v2.5.1+ and NCP v2.5.1+.

All the ingress paths will be rewritten to the provided value. If an ingress has annotation / and has path /tea, for example, the URI /tea will be rewritten to / before the request is sent to the backend service. Numbered capture groups are supported.

URL Rewrite Example

The following example shows how to implement URL rewrite.

kind: Ingress
  name: cafe-ingress
  annotations: "nsx"
    ncp/use-regex: "True"
    #/tea/cup will be rewritten to /cup before sending request to endpoint /$1
  - host:
      - path: /tea/(.*)
          serviceName: tea-svc
          servicePort: 80
      - path: /coffee/(.*)
          serviceName: coffee-svc
          servicePort: 80

Please send any feedback you have to