apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: original-covid-app-path-ingress
  annotations:
    kubernetes.io/ingress.class: "nginx"
    kubernetes.io/tls-acme: "true"
    ingress.kubernetes.io/ssl-redirect: "false"
    cert-manager.io/cluster-issuer: "letsencrypt-issuer"
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$1$2
  labels:
    app: original-covid-app-path-ingress
spec:
  tls:
  - hosts:
      - original-covid-app.infra-structure.work
    secretName: infra-structure-work-tls
  rules:
    - host: original-covid-app.infra-structure.work
      http:
        paths:
        - path: /api/backend/japan/(.*)
          pathType: Prefix
          backend:
            service:
              name: original-covid-app-japan-backend-service
              port:
                number: 5000
        - path: /api/frontend/japan/(.*)
          pathType: Prefix
          backend:
            service:
              name: original-covid-app-japan-frontend-service
              port:
                number: 80
        - path: /api/frontend/world/(.*)
          pathType: Prefix
          backend:
            service:
              name: original-covid-app-world-service
              port:
                number: 80
        - path: /
          pathType: Prefix
          backend:
            service:
              name: original-covid-app-container-service
              port:
                number: 80
        - path: /(.*)(\/.*)
          pathType: Prefix
          backend:
            service:
              name: original-covid-app-container-service
              port:
                number: 80