apiVersion: v1
kind: Service
metadata:
  name: ${OX_COMPONENT}-mw-http-api
spec:
  type: ExternalName
  externalName: main-core-mw-http-api.appsuite-stack-1494-main.svc.cluster.local
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: 80

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ${OX_COMPONENT}
spec:
  rules:
    - host: manifest-${CI_COMMIT_REF_SLUG}.k3s.os2.oxui.de
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: ${OX_COMPONENT}
                port:
                  name: http
          - path: /api/
            pathType: Prefix
            backend:
              service:
                name: ${OX_COMPONENT}-mw-http-api
                port:
                  name: http
          - path: /ajax/
            pathType: Prefix
            backend:
              service:
                name: ${OX_COMPONENT}-mw-http-api
                port:
                  name: http
          - path: /servlet/
            pathType: Prefix
            backend:
              service:
                name: ${OX_COMPONENT}-mw-http-api
                port:
                  name: http
          - path: /realtime/
            pathType: Prefix
            backend:
              service:
                name: ${OX_COMPONENT}-mw-http-api
                port:
                  name: http
          - path: /infostore/
            pathType: Prefix
            backend:
              service:
                name: ${OX_COMPONENT}-mw-http-api
                port:
                  name: http
          - path: /socket.io/
            pathType: Prefix
            backend:
              service:
                name: ${OX_COMPONENT}-mw-http-api
                port:
                  name: http
          - path: /oxguard/
            pathType: Prefix
            backend:
              service:
                name: ${OX_COMPONENT}-mw-http-api
                port:
                  name: http
          - path: /webservices/
            pathType: Prefix
            backend:
              service:
                name: ${OX_COMPONENT}-mw-http-api
                port:
                  name: http
