20
20
{{- $fullName := include "txdc.fullname" . }}
21
21
{{- $controlLabels := include "txdc.controlplane.labels" . }}
22
22
{{- $controlEdcEndpoints := .Values.controlplane.endpoints }}
23
- {{- $gitVersion := .Capabilities.KubeVersion.GitVersion }}
24
23
{{- $namespace := .Release.Namespace }}
25
24
26
25
{{- range .Values.controlplane.ingresses }}
27
26
{{- if and .enabled .endpoints }}
28
27
{{- $controlIngressName := printf "%s-controlplane-%s" $fullName .hostname }}
29
28
{{- $annotations := .annotations | default dict }}
30
29
---
31
- {{- if semverCompare ">=1.19-0" $gitVersion }}
32
30
apiVersion : networking.k8s.io/v1
33
- {{- else if semverCompare ">=1.14-0" $gitVersion }}
34
- apiVersion : networking.k8s.io/v1beta1
35
- {{- else }}
36
- apiVersion : extensions/v1beta1
37
- {{- end }}
38
31
kind : Ingress
39
32
metadata :
40
33
name : {{ $controlIngressName }}
41
34
namespace : {{ $namespace | default "default" | quote }}
42
35
labels :
43
36
{{- $controlLabels | nindent 4 }}
44
37
annotations :
45
- {{- if and .className (not (semverCompare ">=1.18-0" $gitVersion)) }}
46
- {{- if not (hasKey $annotations "kubernetes.io/ingress.class") }}
47
- {{- $_ := set $annotations "kubernetes.io/ingress.class" .className}}
48
- {{- end }}
49
- {{- end }}
50
38
{{- if .certManager }}
51
39
{{- if .certManager.issuer }}
52
40
{{- $_ := set $annotations "cert-manager.io/issuer" .certManager.issuer}}
@@ -59,7 +47,7 @@ metadata:
59
47
{{- toYaml . | nindent 4 }}
60
48
{{- end }}
61
49
spec :
62
- {{- if and .className (semverCompare ">=1.18-0" $gitVersion) }}
50
+ {{- if .className }}
63
51
ingressClassName : {{ .className }}
64
52
{{- end }}
65
53
{{- if .hostname }}
@@ -83,13 +71,10 @@ spec:
83
71
- path : {{ $mapping.path }}
84
72
pathType : Prefix
85
73
backend :
86
- {{- if semverCompare ">=1.19-0" $gitVersion }}
87
74
service :
88
75
name : {{ $fullName }}-controlplane
89
76
port :
90
77
number : {{ $mapping.port }}
91
- {{- else }}
92
- {{- end }}
93
78
{{- end }}
94
79
{{- end }}
95
80
{{- end }}
0 commit comments