feat: Add node affinity support for backup CronJob and update values.yaml

This commit is contained in:
sha
2026-03-18 11:26:25 +02:00
parent 07a3de1ffa
commit fa42f3ac8f
2 changed files with 14 additions and 0 deletions
+12
View File
@@ -44,6 +44,17 @@ spec:
path: {{ .Values.backup.storagePath }} path: {{ .Values.backup.storagePath }}
type: DirectoryOrCreate type: DirectoryOrCreate
restartPolicy: OnFailure restartPolicy: OnFailure
{{- if .Values.backup.node }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- {{ .Values.backup.node }}
{{- else }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 10 }} {{- toYaml . | nindent 10 }}
@@ -56,4 +67,5 @@ spec:
tolerations: tolerations:
{{- toYaml . | nindent 10 }} {{- toYaml . | nindent 10 }}
{{- end }} {{- end }}
{{- end }}
{{- end }} {{- end }}
+2
View File
@@ -107,6 +107,8 @@ backup:
retentionDays: 10 retentionDays: 10
storagePath: /storage/backups/postgres storagePath: /storage/backups/postgres
resources: {} resources: {}
# Node to run backup on (hostname). If set, overrides global affinity/tolerations for the backup CronJob.
node: ""
nodeSelector: {} nodeSelector: {}