4
4
Expand the name of the chart.
5
5
*/} }
6
6
{ {- define " nginx-ingress.name" -} }
7
- { {- printf " %s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix " -" -} }
7
+ { {- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix " -" } }
8
+ { {- end } }
9
+
10
+ { {/*
11
+ Create a default fully qualified app name.
12
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
13
+ If release name contains chart name it will be used as a full name.
14
+ */} }
15
+ { {- define " nginx-ingress.fullname" -} }
16
+ { {- if .Values.fullnameOverride } }
17
+ { {- .Values.fullnameOverride | trunc 63 | trimSuffix " -" } }
18
+ { {- else } }
19
+ { {- $name := default .Chart.Name .Values.nameOverride } }
20
+ { {- if contains $name .Release.Name } }
21
+ { {- .Release.Name | trunc 63 | trimSuffix " -" } }
22
+ { {- else } }
23
+ { {- printf " %s-%s" .Release.Name $name | trunc 63 | trimSuffix " -" } }
24
+ { {- end } }
25
+ { {- end } }
26
+ { {- end } }
27
+
28
+ { {/*
29
+ Create a default fully qualified controller name.
30
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
31
+ */} }
32
+ { {- define " nginx-ingress.controller.fullname" -} }
33
+ { {- printf " %s-%s" (include " nginx-ingress.fullname" .) .Values.controller.name | trunc 63 | trimSuffix " -" -} }
8
34
{ {- end -} }
9
35
10
36
{ {/*
11
- Create labels
37
+ Create chart name and version as used by the chart label.
38
+ */} }
39
+ { {- define " nginx-ingress.chart" -} }
40
+ { {- printf " %s-%s" .Chart.Name .Chart.Version | replace " +" " _" | trunc 63 | trimSuffix " -" } }
41
+ { {- end } }
42
+
43
+ { {/*
44
+ Common labels
12
45
*/} }
13
46
{ {- define " nginx-ingress.labels" -} }
14
- app.kubernetes.io/name: { { .Chart.Name } }
15
- helm.sh/chart: { { .Chart.Name } }-{ { .Chart.Version } }
47
+ helm.sh/chart: { { include " nginx-ingress.chart" . } }
48
+ { { include " nginx-ingress.selectorLabels" . } }
49
+ { {- if .Chart.AppVersion } }
50
+ app.kubernetes.io/version: { { .Chart.AppVersion | quote } }
51
+ { {- end } }
16
52
app.kubernetes.io/managed-by: { { .Release.Service } }
53
+ { {- end } }
54
+
55
+ { {/*
56
+ Selector labels
57
+ */} }
58
+ { {- define " nginx-ingress.selectorLabels" -} }
59
+ app.kubernetes.io/name: { { include " nginx-ingress.name" . } }
17
60
app.kubernetes.io/instance: { { .Release.Name } }
18
- { {- end - } }
61
+ { {- end } }
19
62
20
63
{ {/*
21
64
Expand the name of the configmap.
@@ -24,7 +67,7 @@ Expand the name of the configmap.
24
67
{ {- if .Values.controller.customConfigMap -} }
25
68
{ { .Values.controller.customConfigMap } }
26
69
{ {- else -} }
27
- { {- default (include " nginx-ingress.name " .) .Values.controller.config.name -} }
70
+ { {- default (include " nginx-ingress.fullname " .) .Values.controller.config.name -} }
28
71
{ {- end -} }
29
72
{ {- end -} }
30
73
@@ -35,50 +78,29 @@ Expand leader election lock name.
35
78
{ {- if .Values.controller.reportIngressStatus.leaderElectionLockName -} }
36
79
{ { .Values.controller.reportIngressStatus.leaderElectionLockName } }
37
80
{ {- else -} }
38
- { {- printf " %s-%s" (include " nginx-ingress.name " .) " leader-election" -} }
81
+ { {- printf " %s-%s" (include " nginx-ingress.fullname " .) " leader-election" -} }
39
82
{ {- end -} }
40
83
{ {- end -} }
41
84
42
85
{ {/*
43
86
Expand service account name.
44
87
*/} }
45
88
{ {- define " nginx-ingress.serviceAccountName" -} }
46
- { {- default (include " nginx-ingress.name" .) .Values.controller.serviceAccount.name -} }
47
- { {- end -} }
48
-
49
- { {/*
50
- Expand service name.
51
- */} }
52
- { {- define " nginx-ingress.serviceName" -} }
53
- { {- default (include " nginx-ingress.name" .) .Values.controller.service.name } }
54
- { {- end -} }
55
-
56
- { {/*
57
- Expand serviceMonitor name.
58
- */} }
59
- { {- define " nginx-ingress.serviceMonitorName" -} }
60
- { {- default (include " nginx-ingress.name" .) .Values.controller.serviceMonitor.name } }
89
+ { {- default (include " nginx-ingress.fullname" .) .Values.controller.serviceAccount.name -} }
61
90
{ {- end -} }
62
91
63
92
{ {/*
64
93
Expand default TLS name.
65
94
*/} }
66
95
{ {- define " nginx-ingress.defaultTLSName" -} }
67
- { {- printf " %s-%s" (include " nginx-ingress.name " .) " default-server-tls" -} }
96
+ { {- printf " %s-%s" (include " nginx-ingress.fullname " .) " default-server-tls" -} }
68
97
{ {- end -} }
69
98
70
99
{ {/*
71
100
Expand wildcard TLS name.
72
101
*/} }
73
102
{ {- define " nginx-ingress.wildcardTLSName" -} }
74
- { {- printf " %s-%s" (include " nginx-ingress.name" .) " wildcard-tls" -} }
75
- { {- end -} }
76
-
77
- { {/*
78
- Expand app name.
79
- */} }
80
- { {- define " nginx-ingress.appName" -} }
81
- { {- default (include " nginx-ingress.name" .) .Values.controller.name -} }
103
+ { {- printf " %s-%s" (include " nginx-ingress.fullname" .) " wildcard-tls" -} }
82
104
{ {- end -} }
83
105
84
106
{ {/*
0 commit comments