{{- if .Values.ingress.enabled -}} {{- $fullName := include "monitoring-platform.fullname" . -}} {{- $apiPort := .Values.api.httpPort -}} {{- $frontendPort := .Values.frontend.httpPort -}} {{- $statusPagePort := .Values.statusPage.httpPort -}} {{- range .Values.ingress.hosts }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }}-{{ .host | replace "." "-" }} labels: {{- include "monitoring-platform.labels" $ | nindent 4 }} {{- with $.Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: {{- if $.Values.ingress.className }} ingressClassName: {{ $.Values.ingress.className }} {{- end }} {{- if $.Values.ingress.tls }} tls: {{- range $.Values.ingress.tls }} - hosts: {{- range .hosts }} - {{ . | quote }} {{- end }} secretName: {{ .secretName }} {{- end }} {{- end }} rules: - host: {{ .host | quote }} http: paths: {{- if $.Values.frontend.enabled }} {{- if $.Values.api.enabled }} - path: /api pathType: Prefix backend: service: name: {{ $fullName }}-api port: number: {{ $apiPort }} {{- else }} - path: /api pathType: Prefix backend: service: name: {{ $fullName }}-frontend port: number: {{ $frontendPort }} {{- end }} - path: / pathType: Prefix backend: service: name: {{ $fullName }}-frontend port: number: {{ $frontendPort }} {{- else if $.Values.api.enabled }} - path: / pathType: Prefix backend: service: name: {{ $fullName }}-api port: number: {{ $apiPort }} {{- end }} {{- range .paths }} {{- if ne .path "/" }} {{- if ne .path "/api" }} - path: {{ .path }} pathType: {{ .pathType }} backend: service: name: {{ $fullName }}-status-page port: number: {{ $statusPagePort }} {{- end }} {{- end }} {{- end }} {{- end }} {{- end }}