{{- if and .Values.manager.enabled .Values.manager.ingress.enabled -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: neuvector-webui-ingress
  namespace: {{ .Release.Namespace }}
{{- with .Values.manager.ingress.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
  labels:
    chart: {{ template "neuvector.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
{{- if .Values.manager.ingress.tls }}
  tls:
  - hosts:
    - {{ .Values.manager.ingress.host }}
{{- if .Values.manager.ingress.secretName }}
    secretName: {{ .Values.manager.ingress.secretName }}
{{- end }}
{{- end }}
  rules:
  - host: {{ .Values.manager.ingress.host }}
    http:
      paths:
      - path: {{ .Values.manager.ingress.path }}
        backend:
          serviceName: neuvector-service-webui
          servicePort: 8443
{{- end }}
