diff --git a/jellyfin/templates/backup-cronjob.yaml b/jellyfin/templates/backup-cronjob.yaml index bf1e12d..e04abb7 100644 --- a/jellyfin/templates/backup-cronjob.yaml +++ b/jellyfin/templates/backup-cronjob.yaml @@ -44,6 +44,17 @@ spec: path: {{ .Values.backup.storagePath }} type: DirectoryOrCreate 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 }} nodeSelector: {{- toYaml . | nindent 10 }} @@ -56,4 +67,5 @@ spec: tolerations: {{- toYaml . | nindent 10 }} {{- end }} + {{- end }} {{- end }} diff --git a/jellyfin/values.yaml b/jellyfin/values.yaml index 6a247cd..53bc95f 100644 --- a/jellyfin/values.yaml +++ b/jellyfin/values.yaml @@ -107,6 +107,8 @@ backup: retentionDays: 10 storagePath: /storage/backups/postgres resources: {} + # Node to run backup on (hostname). If set, overrides global affinity/tolerations for the backup CronJob. + node: "" nodeSelector: {}