From 23f14712de599bcab19962cf8a5cca1a7e277174 Mon Sep 17 00:00:00 2001 From: Raul Marrero Date: Thu, 16 May 2019 17:09:12 +0100 Subject: [PATCH] Use Controller name value for app selectors --- deployments/helm-chart/templates/_helpers.tpl | 7 +++++++ deployments/helm-chart/templates/controller-daemonset.yaml | 4 ++-- .../helm-chart/templates/controller-deployment.yaml | 4 ++-- deployments/helm-chart/templates/controller-service.yaml | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/deployments/helm-chart/templates/_helpers.tpl b/deployments/helm-chart/templates/_helpers.tpl index 38c1244bdf..9c69f6446e 100644 --- a/deployments/helm-chart/templates/_helpers.tpl +++ b/deployments/helm-chart/templates/_helpers.tpl @@ -62,3 +62,10 @@ Expand wildcard TLS name. {{- define "nginx-ingress.wildcardTLSName" -}} {{- printf "%s-%s" (include "nginx-ingress.name" .) "wildcard-tls-secret" -}} {{- end -}} + +{{/* +Expand app name. +*/}} +{{- define "nginx-ingress.appName" -}} +{{- default (include "nginx-ingress.name" .) .Values.controller.name -}} +{{- end -}} \ No newline at end of file diff --git a/deployments/helm-chart/templates/controller-daemonset.yaml b/deployments/helm-chart/templates/controller-daemonset.yaml index 8b98797d95..c57be52448 100644 --- a/deployments/helm-chart/templates/controller-daemonset.yaml +++ b/deployments/helm-chart/templates/controller-daemonset.yaml @@ -9,11 +9,11 @@ metadata: spec: selector: matchLabels: - app: {{ include "nginx-ingress.name" . }} + app: {{ include "nginx-ingress.appName" . }} template: metadata: labels: - app: {{ include "nginx-ingress.name" . }} + app: {{ include "nginx-ingress.appName" . }} {{- if or (.Values.prometheus.create) (.Values.controller.pod.annotations) }} annotations: {{- if .Values.prometheus.create }} diff --git a/deployments/helm-chart/templates/controller-deployment.yaml b/deployments/helm-chart/templates/controller-deployment.yaml index cfa295ecb8..b85b1f627b 100644 --- a/deployments/helm-chart/templates/controller-deployment.yaml +++ b/deployments/helm-chart/templates/controller-deployment.yaml @@ -10,11 +10,11 @@ spec: replicas: {{ .Values.controller.replicaCount }} selector: matchLabels: - app: {{ include "nginx-ingress.name" . }} + app: {{ include "nginx-ingress.appName" . }} template: metadata: labels: - app: {{ include "nginx-ingress.name" . }} + app: {{ include "nginx-ingress.appName" . }} {{- if or (.Values.prometheus.create) (.Values.controller.pod.annotations) }} annotations: {{- if .Values.prometheus.create }} diff --git a/deployments/helm-chart/templates/controller-service.yaml b/deployments/helm-chart/templates/controller-service.yaml index c2f874ba7a..fe307fd0f2 100644 --- a/deployments/helm-chart/templates/controller-service.yaml +++ b/deployments/helm-chart/templates/controller-service.yaml @@ -46,7 +46,7 @@ spec: {{- end }} {{- end }} selector: - app: {{ include "nginx-ingress.name" . }} + app: {{ include "nginx-ingress.appName" . }} {{- if .Values.controller.service.externalIPs }} externalIPs: {{ toYaml .Values.controller.service.externalIPs | indent 4 }}