apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: recipebook-ingress
  namespace: default
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$1$2
spec:
  defaultBackend:
    service:
      name: recipebook-ui-service
      port:
        number: 80
  rules:
    - http:
        paths:
          - path: /(api)(.*)
            pathType: Prefix
            backend:
              service:
                name: recipebook-api-service
                port:
                  number: 9000
          - path: /(swagger)(.*)
            pathType: Prefix
            backend:
              service:
                name: recipebook-api-service
                port:
                  number: 9000
          - path: /(v2)(.*)
            pathType: Prefix
            backend:
              service:
                name: recipebook-api-service
                port:
                  number: 9000
