{{ if or .Values.de2.enabled .Values.fusion.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: api-to-orm
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/configuration-snippet: |
      auth_request /authenticator/check-basic;
      error_page 401 =302 /authenticator/login?redirect=$request_uri;
spec:
  ingressClassName: nginx
  rules:
    - host: {{ .Values.domain }}
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: api-router
                port:
                  number: 8080

{{ end }}