diff --git a/charts/tidb-backup/templates/backup-job.yaml b/charts/tidb-backup/templates/backup-job.yaml index 24b7346252..61ea50de6f 100644 --- a/charts/tidb-backup/templates/backup-job.yaml +++ b/charts/tidb-backup/templates/backup-job.yaml @@ -33,6 +33,8 @@ spec: {{- if .Values.serviceAccount }} serviceAccount: {{ .Values.serviceAccount }} {{- end }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} containers: - name: backup image: {{ .Values.image.backup }} diff --git a/charts/tidb-backup/templates/restore-job.yaml b/charts/tidb-backup/templates/restore-job.yaml index 3ce3f79509..baf187f7d1 100644 --- a/charts/tidb-backup/templates/restore-job.yaml +++ b/charts/tidb-backup/templates/restore-job.yaml @@ -25,9 +25,16 @@ spec: {{- end }} spec: restartPolicy: OnFailure + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} containers: - name: tidb-restore-job image: {{ .Values.image.backup }} + imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" }} + {{- if .Values.resources }} + resources: +{{ toYaml .Values.resources | indent 10 }} + {{- end }} command: - /bin/sh - -c diff --git a/charts/tidb-backup/values.yaml b/charts/tidb-backup/values.yaml index 3768cc4890..cef6550f24 100644 --- a/charts/tidb-backup/values.yaml +++ b/charts/tidb-backup/values.yaml @@ -29,6 +29,10 @@ image: # https://github.com/pingcap/tidb-cloud-backup backup: pingcap/tidb-cloud-backup:20191217 +## nodeSelector ensure pods only assigning to nodes which have each of the indicated key-value pairs as labels +## ref:https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector +nodeSelector: {} + # Add additional labels for backup/restore job's pod # ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ extraLabels: {}