# Copyright 2020 Google LLC
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: scrumlaunch2-dev
  annotations:
    kubernetes.io/ingress.global-static-ip-name: scrumlaunch2-dev-ingress-ip
    networking.gke.io/managed-certificates: scrumlaunch2-dev-cert-participants,scrumlaunch2-dev-cert-studies
spec:
  rules:
    - host: "participants.scrumlaunch2-dev.providencemt.com"
      http:
        paths:
          - pathType: ImplementationSpecific
            path: "/auth-server/*"
            backend:
              service:
                name: auth-server-np
                port:
                  number: 50000
          - pathType: ImplementationSpecific     
            path: "/response-datastore/*"
            backend:
              service:
                name: response-datastore-np
                port:
                  number: 50000
          - pathType: ImplementationSpecific      
            path: "/participant-user-datastore/*"
            backend:
              service:
                name: participant-user-datastore-np
                port:
                  number: 50000
          - pathType: ImplementationSpecific
            path: "/participant-consent-datastore/*"
            backend:
              service:
                name: participant-consent-datastore-np
                port:
                  number: 50000
          - pathType: ImplementationSpecific
            path: "/participant-enroll-datastore/*"
            backend:
              service:
                name: participant-enroll-datastore-np
                port:
                  number: 50000
          - pathType: ImplementationSpecific      
            path: "/oauth2/*"
            backend:
              service:
                name: hydra-np
                port:
                  number: 50000
          - pathType: ImplementationSpecific
            path: "/participant-manager/*"
            backend:
              service:
                name: participant-manager-np
                port:
                  number: 50000
          - pathType: ImplementationSpecific       
            path: "/participant-manager-datastore/*"
            backend:
              service:
                name: participant-manager-datastore-np
                port:
                  number: 50000
    - host: "studies.scrumlaunch2-dev.providencemt.com"
      http:
        paths:
          - pathType: ImplementationSpecific
            path: "/study-datastore/*"
            backend:
              service:
                name: study-datastore-np
                port:
                  number: 50000
          - pathType: ImplementationSpecific
            path: "/studybuilder/*"
            backend:
              service:
                name: study-builder-np
                port:
                  number: 50000
          - pathType: ImplementationSpecific
            path: "/study-resources/*"
            backend:
              service:
                name: study-builder-np
                port:
                  number: 50000