blob: 157af9cc57b394b831601f5de411028322a3febc [file] [log] [blame]
Joey Armstrong07475092023-01-26 10:56:13 -05001# Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
David K. Bainbridge637751d2021-03-25 22:18:08 +00002#
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---
16apiVersion: networking.k8s.io/v1
17kind: Ingress
18metadata:
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 }}
29spec:
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 Scandoloc2c917a2021-04-06 09:15:31 -070043 - host: {{ template "virtual-hostname" $ }}
David K. Bainbridge637751d2021-03-25 22:18:08 +000044 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 }}