Joey Armstrong | 0747509 | 2023-01-26 10:56:13 -0500 | [diff] [blame] | 1 | # Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors |
David K. Bainbridge | 637751d | 2021-03-25 22:18:08 +0000 | [diff] [blame] | 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | {{- if .Values.ingress.enabled -}} |
| 15 | --- |
| 16 | apiVersion: networking.k8s.io/v1 |
| 17 | kind: Ingress |
| 18 | metadata: |
| 19 | name: {{ template "fullname" . }} |
| 20 | namespace: {{ .Release.Namespace }} |
| 21 | {{- with .Values.labels }} |
| 22 | labels: |
| 23 | {{- toYaml . | nindent 4 }} |
| 24 | {{- end }} |
| 25 | {{- with .Values.ingress.annotations }} |
| 26 | annotations: |
| 27 | {{- toYaml . | nindent 4 }} |
| 28 | {{- end }} |
| 29 | spec: |
| 30 | {{- if .Values.ingress.tls }} |
| 31 | tls: |
| 32 | {{- range .Values.ingress.tls }} |
| 33 | - hosts: |
| 34 | {{- range .hosts }} |
| 35 | - {{ . | quote }} |
| 36 | {{- end }} |
| 37 | secretName: {{ .secretName }} |
| 38 | {{- end }} |
| 39 | {{- end }} |
| 40 | rules: |
| 41 | {{- range .Values.ingress.hosts }} |
| 42 | {{- if $.Values.ingress.enableVirtualHosts }} |
Matteo Scandolo | c2c917a | 2021-04-06 09:15:31 -0700 | [diff] [blame] | 43 | - host: {{ template "virtual-hostname" $ }} |
David K. Bainbridge | 637751d | 2021-03-25 22:18:08 +0000 | [diff] [blame] | 44 | http: |
| 45 | {{- else }} |
| 46 | {{- if .host }} |
| 47 | - host: {{ .host | quote }} |
| 48 | http: |
| 49 | {{- else }} |
| 50 | - http: |
| 51 | {{- end }} |
| 52 | {{- end }} |
| 53 | paths: |
| 54 | {{- range .paths }} |
| 55 | - path: {{ . }} |
| 56 | pathType: Prefix |
| 57 | backend: |
| 58 | service: |
| 59 | name: "{{ template "fullname" $ }}-api" |
| 60 | port: |
| 61 | number: 55555 |
| 62 | {{- end }} |
| 63 | {{- end }} |
| 64 | {{- end }} |