Andy Bavier | 177f29f | 2020-08-12 14:42:00 -0700 | [diff] [blame] | 1 | # 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 }} |
| 8 | apiVersion: networking.k8s.io/v1beta1 |
| 9 | {{- else }} |
| 10 | apiVersion: extensions/v1beta1 |
| 11 | {{- end }} |
| 12 | kind: Ingress |
| 13 | metadata: |
| 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 }} |
| 21 | spec: |
| 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 }} |