Skip to content

Commit

Permalink
tidb-backup: restore respects resources, imagePullPolicy, nodeSelector (
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyguava authored Feb 18, 2020
1 parent 56daf5e commit ba135e9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/tidb-backup/templates/backup-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
7 changes: 7 additions & 0 deletions charts/tidb-backup/templates/restore-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions charts/tidb-backup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down

0 comments on commit ba135e9

Please sign in to comment.