Commit 36cef41c authored by Christian Kotzbauer's avatar Christian Kotzbauer
Browse files

split matchLabels template



Signed-off-by: default avatarChristian Kotzbauer <christian.kotzbauer@gmail.com>
parent eb617adc
...@@ -62,3 +62,11 @@ chart: {{ template "kured.chart" . }} ...@@ -62,3 +62,11 @@ chart: {{ template "kured.chart" . }}
release: {{ .Release.Name }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
{{- end -}} {{- end -}}
{{/*
Returns a set of matchLabels applied.
*/}}
{{- define "kured.matchLabels" -}}
app: {{ template "kured.name" . }}
release: {{ .Release.Name }}
{{- end -}}
...@@ -10,7 +10,7 @@ spec: ...@@ -10,7 +10,7 @@ spec:
type: {{ .Values.updateStrategy }} type: {{ .Values.updateStrategy }}
selector: selector:
matchLabels: matchLabels:
{{- include "kured.labels" . | nindent 6 }} {{- include "kured.matchLabels" . | nindent 6 }}
template: template:
metadata: metadata:
labels: labels:
......
...@@ -18,5 +18,5 @@ spec: ...@@ -18,5 +18,5 @@ spec:
port: {{ .Values.service.port }} port: {{ .Values.service.port }}
targetPort: 8080 targetPort: 8080
selector: selector:
{{- include "kured.labels" . | nindent 4 }} {{- include "kured.matchLabels" . | nindent 4 }}
{{- end }} {{- end }}
\ No newline at end of file
...@@ -24,7 +24,7 @@ spec: ...@@ -24,7 +24,7 @@ spec:
jobLabel: "{{ .Release.Name }}" jobLabel: "{{ .Release.Name }}"
selector: selector:
matchLabels: matchLabels:
{{- include "kured.labels" . | nindent 6 }} {{- include "kured.matchLabels" . | nindent 6 }}
namespaceSelector: namespaceSelector:
matchNames: matchNames:
- {{ .Release.Namespace }} - {{ .Release.Namespace }}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment