apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: project-331-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: letsencrypt-prod
    nginx.org/websocket-services: "ws"
    nginx.ingress.kubernetes.io/limit-connections: "100"
    nginx.ingress.kubernetes.io/limit-rps: "100"
    nginx.ingress.kubernetes.io/limit-rpm: "2000"
    nginx.ingress.kubernetes.io/proxy-body-size: 10m
    nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header l5d-dst-override $service_name.$namespace.svc.cluster.local:$service_port;
      grpc_set_header l5d-dst-override $service_name.$namespace.svc.cluster.local:$service_port;
    nginx.ingress.kubernetes.io/server-snippet: |
      location /oembed/1.0/proxy {
         return 301 /api/v0/cms/oembed/preview?$args;
       }
    nginx.ingress.kubernetes.io/use-regex: "true"
spec:
  rules:
    - http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: headless-lms
                port:
                  number: 3001
          - path: /example-exercise
            pathType: Prefix
            backend:
              service:
                name: example-exercise
                port:
                  number: 3002
          - path: /cms
            pathType: Prefix
            backend:
              service:
                name: cms
                port:
                  number: 3000
          - path: /org
            pathType: Prefix
            backend:
              service:
                name: course-material
                port:
                  number: 3003
          - path: /org/[^/]+/?$
            pathType: Exact
            backend:
              service:
                name: main-frontend
                port:
                  number: 3000
          - path: /
            pathType: Prefix
            backend:
              service:
                name: main-frontend
                port:
                  number: 3000
          - path: /quizzes
            pathType: Prefix
            backend:
              service:
                name: quizzes
                port:
                  number: 3004
