apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-srv
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: "true"
spec:
  rules:
    - host: ticketing.dev # change to actual domain name
      http:
        paths:
          - path: /api/payments/?(.*)
            pathType: Prefix
            backend:
              service:
                name: payments-srv # name of the payments cluster service
                port:
                  number: 3000 # port in auth-srv (not targetPort)
          - path: /api/users/?(.*)
            pathType: Prefix
            backend:
              service:
                name: auth-srv # name of the auth cluster service
                port:
                  number: 3000 # port in auth-srv (not targetPort)
          - path: /api/tickets/?(.*)
            pathType: Prefix
            backend:
              service:
                name: tickets-srv # name of the tickets cluster service
                port:
                  number: 3000 # port in tickets-srv (not targetPort)
          - path: /api/orders/?(.*)
            pathType: Prefix
            backend:
              service:
                name: orders-srv # name of the orders cluster service
                port:
                  number: 3000 # port in orders-srv (not targetPort)
          - path: /?(.*) # This should be last since it matches anything!
            pathType: Prefix
            backend:
              service:
                name: client-srv # name of the client cluster service
                port:
                  number: 3000 # port in client-srv (not targetPort)
