# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ template "aether-enterprise-portal.fullname" . }}-ingress
  namespace: {{ .Release.Namespace }}
  labels:
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
spec:
  tls:
    - secretName: {{ template "aether-enterprise-portal.fullname" . }}-secret
      hosts:
        - aether-enterprise-portal.onosproject.org
  rules:
    - host: aether-enterprise-portal.onosproject.org
      http:
        paths:
          - pathType: Prefix
            path: "/"
            backend:
              service:
                name: {{ template "aether-enterprise-portal.fullname" . }}
                port:
                  number: {{ .Values.ports.web.containerPort }}
{{- end }}
