@@ -10,17 +10,15 @@ kind: StatefulSet
1010metadata :
1111 name : {{ printf "%s-worker" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
1212 namespace : {{ include "common.names.namespace" . | quote }}
13- labels : {{- include "common.labels.standard" . | nindent 4 }}
13+ labels : {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1414 app.kubernetes.io/component : worker
15- {{- if .Values.commonLabels }}
16- {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
17- {{- end }}
1815spec :
1916 replicas : 1
2017 podManagementPolicy : {{ .Values.podManagementPolicy | quote }}
2118 serviceName : {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
19+ {{- $podLabels := merge .Values.podLabels .Values.commonLabels }}
2220 selector :
23- matchLabels : {{- include "common.labels.matchLabels" . | nindent 6 }}
21+ matchLabels : {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
2422 app.kubernetes.io/component : worker
2523 {{- if .Values.updateStrategy }}
2624 updateStrategy : {{- toYaml .Values.updateStrategy | nindent 4 }}
3028 {{- if .Values.podAnnotations }}
3129 annotations : {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
3230 {{- end }}
33- labels : {{- include "common.labels.standard" . | nindent 8 }}
31+ labels : {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
3432 app.kubernetes.io/component : worker
35- {{- if .Values.podLabels }}
36- {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
37- {{- end }}
3833 spec :
3934 {{- include "pytorch.imagePullSecrets" . | nindent 6 }}
4035 {{- if .Values.hostAliases }}
4439 affinity : {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }}
4540 {{- else }}
4641 affinity :
47- podAffinity : {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "worker" "context" $) | nindent 10 }}
48- podAntiAffinity : {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "worker" "context" $) | nindent 10 }}
42+ podAffinity : {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "worker" "customLabels" $podLabels "context" $) | nindent 10 }}
43+ podAntiAffinity : {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "worker" "customLabels" $podLabels "context" $) | nindent 10 }}
4944 nodeAffinity : {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
5045 {{- end }}
5146 {{- if .Values.nodeSelector }}
@@ -234,13 +229,10 @@ spec:
234229 volumeClaimTemplates :
235230 - metadata :
236231 name : data
237- annotations :
238- {{- if .Values.persistence.annotations }}
239- {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
240- {{- end }}
241- {{- if .Values.commonAnnotations }}
242- {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 10 }}
243- {{- end }}
232+ {{- if or .Values.commonAnnotations .Values.persistence.annotations }}
233+ {{- $annotations := merge .Values.persistence.annotations .Values.commonAnnotations }}
234+ annotations : {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 10 }}
235+ {{- end }}
244236 {{- if .Values.commonLabels }}
245237 labels : {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 10 }}
246238 {{- end }}
0 commit comments