11{{- if .Values.ingress.http.enabled -}}
22{{- $fullName := include "app.fullname" . -}}
3+ {{- $svcName := $fullName -}}
34{{- $svcPort := .Values.service.port.http -}}
4- {{- if and .Values.ingress.http.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
5- {{- if not (hasKey .Values.ingress.http.annotations "kubernetes.io/ingress.class") }}
6- {{- $_ := set .Values.ingress.http.annotations "kubernetes.io/ingress.class" .Values.ingress.http.className}}
7- {{- end }}
8- {{- end }}
5+ {{- $ingressPath := .Values.ingress.http.path -}}
6+ {{- $ingressPathType := .Values.ingress.http.pathType -}}
97apiVersion : networking.k8s.io/v1
108kind : Ingress
119metadata :
@@ -20,31 +18,22 @@ spec:
2018 {{- if .Values.ingress.http.className }}
2119 ingressClassName : {{ .Values.ingress.http.className }}
2220 {{- end }}
23- {{- if .Values.ingress.http.tls }}
24- tls :
25- {{- range .Values.ingress.http.tls }}
26- - hosts :
27- {{- range .hosts }}
28- - {{ . | quote }}
29- {{- end }}
30- secretName : {{ .secretName }}
31- {{- end }}
32- {{- end }}
3321 rules :
34- {{- range .Values.ingress.http.hosts }}
35- - host : {{ . host | quote }}
22+ {{- range $host := .Values.ingress.http.hosts }}
23+ - host : {{ $ host | quote }}
3624 http :
3725 paths :
38- {{- range .paths }}
39- - path : {{ .path }}
40- {{- if .pathType }}
41- pathType : {{ .pathType }}
42- {{- end }}
26+ - path : {{ $ingressPath }}
27+ pathType : {{ $ingressPathType }}
4328 backend :
4429 service :
45- name : {{ $fullName }}
30+ name : {{ $svcName }}
4631 port :
4732 number : {{ $svcPort }}
48- {{- end }}
4933 {{- end }}
34+
35+ {{- if .Values.ingress.http.tls }}
36+ tls :
37+ {{ toYaml .Values.ingress.http.tls | indent 4 }}
38+ {{- end }}
5039{{- end }}
0 commit comments