Skip to content

Commit 722f661

Browse files
Raul Marreropleshakov
Raul Marrero
authored andcommitted
Use Controller name value for app selectors
1 parent 7901546 commit 722f661

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

deployments/helm-chart/templates/_helpers.tpl

+7
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,10 @@ Expand wildcard TLS name.
6262
{{- define "nginx-ingress.wildcardTLSName" -}}
6363
{{- printf "%s-%s" (include "nginx-ingress.name" .) "wildcard-tls-secret" -}}
6464
{{- end -}}
65+
66+
{{/*
67+
Expand app name.
68+
*/}}
69+
{{- define "nginx-ingress.appName" -}}
70+
{{- default (include "nginx-ingress.name" .) .Values.controller.name -}}
71+
{{- end -}}

deployments/helm-chart/templates/controller-daemonset.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ metadata:
99
spec:
1010
selector:
1111
matchLabels:
12-
app: {{ include "nginx-ingress.name" . }}
12+
app: {{ include "nginx-ingress.appName" . }}
1313
template:
1414
metadata:
1515
labels:
16-
app: {{ include "nginx-ingress.name" . }}
16+
app: {{ include "nginx-ingress.appName" . }}
1717
{{- if or (.Values.prometheus.create) (.Values.controller.pod.annotations) }}
1818
annotations:
1919
{{- if .Values.prometheus.create }}

deployments/helm-chart/templates/controller-deployment.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ spec:
1010
replicas: {{ .Values.controller.replicaCount }}
1111
selector:
1212
matchLabels:
13-
app: {{ include "nginx-ingress.name" . }}
13+
app: {{ include "nginx-ingress.appName" . }}
1414
template:
1515
metadata:
1616
labels:
17-
app: {{ include "nginx-ingress.name" . }}
17+
app: {{ include "nginx-ingress.appName" . }}
1818
{{- if or (.Values.prometheus.create) (.Values.controller.pod.annotations) }}
1919
annotations:
2020
{{- if .Values.prometheus.create }}

deployments/helm-chart/templates/controller-service.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ spec:
4646
{{- end }}
4747
{{- end }}
4848
selector:
49-
app: {{ include "nginx-ingress.name" . }}
49+
app: {{ include "nginx-ingress.appName" . }}
5050
{{- if .Values.controller.service.externalIPs }}
5151
externalIPs:
5252
{{ toYaml .Values.controller.service.externalIPs | indent 4 }}

0 commit comments

Comments
 (0)