apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: 'true'
  labels:
    name: ingress-service
spec:
  rules:
    - host: ticketing.delwinbest.com
      http:
        paths:
          - path: '/api/payments/?(.*)'
            pathType: Prefix
            backend:
              service:
                name: payments-srv
                port:
                  number: 3000
          - path: '/api/users/?(.*)'
            pathType: Prefix
            backend:
              service:
                name: auth-srv
                port:
                  number: 3000
          - path: '/api/tickets/?(.*)'
            pathType: Prefix
            backend:
              service:
                name: tickets-srv
                port:
                  number: 3000
          - path: '/api/orders/?(.*)'
            pathType: Prefix
            backend:
              service:
                name: orders-srv
                port:
                  number: 3000
          - path: '/?(.*)'
            pathType: Prefix
            backend:
              service:
                name: client-srv
                port:
                  number: 3000
## Digital Ocean Specific Config
# ---
# apiVersion: v1
# kind: Service
# metadata:
#   annotations:
#     service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: 'true'
#     service.beta.kubernetes.io/do-loadbalancer-hostname: 'ticketing.delwinbest.com'
#   labels:
#     helm.sh/chart: ingress-nginx-2.0.3
#     app.kubernetes.io/name: ingress-nginx
#     app.kubernetes.io/instance: ingress-nginx
#     app.kubernetes.io/version: 0.32.0
#     app.kubernetes.io/managed-by: Helm
#     app.kubernetes.io/component: controller
#   name: ingress-nginx-controller
#   namespace: ingress-nginx
# spec:
#   type: LoadBalancer
#   externalTrafficPolicy: Local
#   ports:
#     - name: http
#       port: 80
#       protocol: TCP
#       targetPort: http
#     - name: https
#       port: 443
#       protocol: TCP
#       targetPort: https
#   selector:
#     app.kubernetes.io/name: ingress-nginx
#     app.kubernetes.io/instance: ingress-nginx
#     app.kubernetes.io/component: controller
