apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: avatar
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /avatar/$2
    nginx.ingress.kubernetes.io/use-regex: "true"
spec:
  ingressClassName: wac-hospital
  rules:
  - http:
      paths:
      - path: /avatar(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: profile-ui
            port:
              name: avatar