apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: petclinic-msa-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  rules:
  - host: "petclinic.msa.local"
    http:
      paths:
      - pathType: Prefix
        path: "/api/vet(/|$)(.*)"
        backend:
          service:
            name: vets
            port:
              number: 8080
      - pathType: Prefix
        path: "/api/customer(/|$)(.*)"
        backend:
          service:
            name: customers
            port:
              number: 8080