apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: nowchess-ingress-st
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
spec:
  ingressClassName: nginx
  rules:
    - host: st.nowchess.janis-eccarius.de
      http:
        paths:
          - path: /api/board/game/[A-Za-z0-9]{8}/ws
            pathType: ImplementationSpecific
            backend:
              service:
                name: nowchess-ws-active
                port:
                  number: 8084
          - path: /api/user/ws
            pathType: ImplementationSpecific
            backend:
              service:
                name: nowchess-ws-active
                port:
                  number: 8084
          - path: /api/account
            pathType: Prefix
            backend:
              service:
                name: nowchess-account-active
                port:
                  number: 8083
          - path: /api/challenge
            pathType: Prefix
            backend:
              service:
                name: nowchess-account-active
                port:
                  number: 8083
          - path: /api/store
            pathType: Prefix
            backend:
              service:
                name: nowchess-store-active
                port:
                  number: 8085
          - path: /api/tournament
            pathType: Prefix
            backend:
              service:
                name: nowchess-tournament-active
                port:
                  number: 8088
          - path: /api/bots
            pathType: Prefix
            backend:
              service:
                name: nowchess-official-bots-active
                port:
                  number: 8088
          - path: /api/analysis
            pathType: Prefix
            backend:
              service:
                name: nowchess-analysis-active
                port:
                  number: 8087
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: nowchess-core-active
                port:
                  number: 8080
          - path: /
            pathType: Prefix
            backend:
              service:
                name: nowchess-frontend-active
                port:
                  number: 80
  tls:
    - hosts:
        - st.nowchess.janis-eccarius.de
      secretName: nowchess-staging-ingress-cert
