File tree Expand file tree Collapse file tree 6 files changed +51
-5
lines changed Expand file tree Collapse file tree 6 files changed +51
-5
lines changed Original file line number Diff line number Diff line change @@ -49,3 +49,14 @@ Generate chart secret name
49
49
{ {- define " ltb-passwd.secretName" -} }
50
50
{ { default (include " ltb-passwd.fullname" .) .Values.existingSecret } }
51
51
{ {- end -} }
52
+
53
+ { {/*
54
+ Return the appropriate apiVersion for ingress.
55
+ */} }
56
+ { {- define " ingress.apiVersion" -} }
57
+ { {- if .Capabilities.APIVersions.Has " networking.k8s.io/v1" -} }
58
+ { {- print " networking.k8s.io/v1" -} }
59
+ { {- else -} }
60
+ { {- print " extensions/v1beta1" -} }
61
+ { {- end -} }
62
+ { {- end -} }
Original file line number Diff line number Diff line change 1
1
{{- if .Values.ingress.enabled -}}
2
2
{{- $fullName := include "ltb-passwd.fullname" . -}}
3
3
{{- $ingressPath := .Values.ingress.path -}}
4
- apiVersion : extensions/v1beta1
4
+ {{- $ingressPathType := .Values.ingress.pathType -}}
5
+ apiVersion : {{ include "ingress.apiVersion" . }}
5
6
kind : Ingress
6
7
metadata :
7
8
name : {{ $fullName }}
31
32
http :
32
33
paths :
33
34
- path : {{ $ingressPath }}
35
+ {{- if eq (include "ingress.apiVersion" $) "networking.k8s.io/v1" }}
36
+ pathType : {{ $ingressPathType }}
37
+ {{- end }}
34
38
backend :
39
+ {{- if eq (include "ingress.apiVersion" $) "networking.k8s.io/v1" }}
40
+ service :
41
+ name : {{ $fullName }}
42
+ port :
43
+ name : http
44
+ {{- else }}
35
45
serviceName : {{ $fullName }}
36
46
servicePort : http
47
+ {{- end }}
37
48
{{- end }}
38
49
{{- end }}
Original file line number Diff line number Diff line change @@ -30,3 +30,14 @@ Create chart name and version as used by the chart label.
30
30
{ {- define " phpldapadmin.chart" -} }
31
31
{ {- printf " %s-%s" .Chart.Name .Chart.Version | replace " +" " _" | trunc 63 | trimSuffix " -" -} }
32
32
{ {- end -} }
33
+
34
+ { {/*
35
+ Return the appropriate apiVersion for ingress.
36
+ */} }
37
+ { {- define " ingress.apiVersion" -} }
38
+ { {- if .Capabilities.APIVersions.Has " networking.k8s.io/v1" -} }
39
+ { {- print " networking.k8s.io/v1" -} }
40
+ { {- else -} }
41
+ { {- print " extensions/v1beta1" -} }
42
+ { {- end -} }
43
+ { {- end -} }
Original file line number Diff line number Diff line change 1
1
{{- if .Values.ingress.enabled -}}
2
2
{{- $fullName := include "phpldapadmin.fullname" . -}}
3
3
{{- $ingressPath := .Values.ingress.path -}}
4
- apiVersion : extensions/v1beta1
4
+ {{- $ingressPathType := .Values.ingress.pathType -}}
5
+ apiVersion : {{ include "ingress.apiVersion" . }}
5
6
kind : Ingress
6
7
metadata :
7
8
name : {{ $fullName }}
31
32
http :
32
33
paths :
33
34
- path : {{ $ingressPath }}
35
+ {{- if eq (include "ingress.apiVersion" $) "networking.k8s.io/v1" }}
36
+ pathType : {{ $ingressPathType }}
37
+ {{- end }}
34
38
backend :
39
+ {{- if eq (include "ingress.apiVersion" $) "networking.k8s.io/v1" }}
40
+ service :
41
+ name : {{ $fullName }}
42
+ port :
43
+ name : http
44
+ {{- else }}
35
45
serviceName : {{ $fullName }}
36
46
servicePort : http
47
+ {{- end }}
37
48
{{- end }}
38
49
{{- end }}
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ Expand the name of the chart.
9
9
Return the appropriate apiVersion for statefulset.
10
10
*/} }
11
11
{ {- define " statefulset.apiVersion" -} }
12
- { {- if semverCompare " <1.14-0" .Capabilities.KubeVersion.GitVersion -} }
13
- { {- print " apps/v1beta1" -} }
14
- { {- else -} }
12
+ { {- if .Capabilities.APIVersions.Has " apps/v1" -} }
15
13
{ {- print " apps/v1" -} }
14
+ { {- else -} }
15
+ { {- print " apps/v1beta1" -} }
16
16
{ {- end -} }
17
17
{ {- end -} }
18
18
{ {/*
Original file line number Diff line number Diff line change @@ -205,6 +205,7 @@ ltb-passwd:
205
205
enabled : true
206
206
annotations : {}
207
207
path : /
208
+ pathType : Prefix
208
209
# # Ingress Host
209
210
hosts :
210
211
- " ssl-ldap2.example"
@@ -221,6 +222,7 @@ phpldapadmin:
221
222
enabled : true
222
223
annotations : {}
223
224
path : /
225
+ pathType : Prefix
224
226
# # Ingress Host
225
227
hosts :
226
228
- phpldapadmin.example
You can’t perform that action at this time.
0 commit comments