Skip to content

Commit

Permalink
Use Controller name value for app selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Raul Marrero authored and pleshakov committed Jun 19, 2019
1 parent 7901546 commit 722f661
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions deployments/helm-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
4 changes: 2 additions & 2 deletions deployments/helm-chart/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions deployments/helm-chart/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion deployments/helm-chart/templates/controller-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 722f661

Please sign in to comment.