blob: 52881869a97a1737165f9ade9cc947d72dc3eaf1 [file] [log] [blame]
Andy Bavier177f29f2020-08-12 14:42:00 -07001# Copyright 2020-present Open Networking Foundation
2# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
3
4{{- if .Values.ingress.enabled -}}
5{{- $fullName := include "edge-monitoring-server.fullname" . -}}
6{{- $svcPort := .Values.service.port -}}
7{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
8apiVersion: networking.k8s.io/v1beta1
9{{- else }}
10apiVersion: extensions/v1beta1
11{{- end }}
12kind: Ingress
13metadata:
14 name: {{ $fullName }}
15 labels:
16 {{- include "edge-monitoring-server.labels" . | nindent 4 }}
17 {{- with .Values.ingress.annotations }}
18 annotations:
19 {{- toYaml . | nindent 4 }}
20 {{- end }}
21spec:
22 {{- if .Values.ingress.tls }}
23 tls:
24 {{- range .Values.ingress.tls }}
25 - hosts:
26 {{- range .hosts }}
27 - {{ . | quote }}
28 {{- end }}
29 secretName: {{ .secretName }}
30 {{- end }}
31 {{- end }}
32 rules:
33 {{- range .Values.ingress.hosts }}
34 - host: {{ .host | quote }}
35 http:
36 paths:
37 {{- range .paths }}
38 - path: {{ . }}
39 backend:
40 serviceName: {{ $fullName }}
41 servicePort: {{ $svcPort }}
42 {{- end }}
43 {{- end }}
44 {{- end }}