split matchLabels template

Signed-off-by: Christian Kotzbauer <christian.kotzbauer@gmail.com>
This commit is contained in:
Christian Kotzbauer
2020-06-30 19:18:47 +02:00
parent eb617adc2b
commit 36cef41c20
4 changed files with 11 additions and 3 deletions
+8
View File
@@ -62,3 +62,11 @@ chart: {{ template "kured.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- end -}}
{{/*
Returns a set of matchLabels applied.
*/}}
{{- define "kured.matchLabels" -}}
app: {{ template "kured.name" . }}
release: {{ .Release.Name }}
{{- end -}}
+1 -1
View File
@@ -10,7 +10,7 @@ spec:
type: {{ .Values.updateStrategy }}
selector:
matchLabels:
{{- include "kured.labels" . | nindent 6 }}
{{- include "kured.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
+1 -1
View File
@@ -18,5 +18,5 @@ spec:
port: {{ .Values.service.port }}
targetPort: 8080
selector:
{{- include "kured.labels" . | nindent 4 }}
{{- include "kured.matchLabels" . | nindent 4 }}
{{- end }}
+1 -1
View File
@@ -24,7 +24,7 @@ spec:
jobLabel: "{{ .Release.Name }}"
selector:
matchLabels:
{{- include "kured.labels" . | nindent 6 }}
{{- include "kured.matchLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}