Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to configure Affinity or Tolerations for Backups and Restores (#1737) #1763

Merged
merged 4 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions charts/tidb-backup/templates/backup-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ spec:
name: {{ .Values.secretName }}
key: password
restartPolicy: OnFailure
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
volumes:
- name: data
persistentVolumeClaim:
Expand Down
8 changes: 8 additions & 0 deletions charts/tidb-backup/templates/restore-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ spec:
secretKeyRef:
name: {{ .Values.secretName }}
key: password
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
volumes:
- name: data
persistentVolumeClaim:
Expand Down
9 changes: 9 additions & 0 deletions charts/tidb-backup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ extraLabels: {}
# Add annotations for backup/restore job's pod
annotations: {}

## affinity defines pd scheduling rules,it's default settings is empty.
## please read the affinity document before set your scheduling rule:
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Tolerations are applied to pods, and allow pods to schedule onto nodes with matching taints.
## refer to https://kubernetes.io/docs/concepts/configuration/taint-and-toleration
tolerations: []

# secretName is the name of the secret which stores user and password used for backup/restore
# Note: you must give the user enough privilege to do the backup and restore
# you can create the secret by:
Expand Down
8 changes: 8 additions & 0 deletions charts/tidb-cluster/templates/scheduled-backup-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ spec:
name: {{ .Values.scheduledBackup.secretName }}
key: password
restartPolicy: {{ .Values.scheduledBackup.restartPolicy | default "OnFailure" }}
{{- if .Values.scheduledBackup.affinity }}
affinity:
{{ toYaml .Values.scheduledBackup.affinity | indent 12 }}
{{- end }}
{{- if .Values.scheduledBackup.tolerations }}
tolerations:
{{ toYaml .Values.scheduledBackup.tolerations | indent 12 }}
{{- end }}
volumes:
- name: data
persistentVolumeClaim:
Expand Down
9 changes: 9 additions & 0 deletions charts/tidb-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,15 @@ scheduledBackup:
# cpu: 4000m
# memory: 4Gi

## affinity defines pd scheduling rules,it's default settings is empty.
## please read the affinity document before set your scheduling rule:
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Tolerations are applied to pods, and allow pods to schedule onto nodes with matching taints.
## refer to https://kubernetes.io/docs/concepts/configuration/taint-and-toleration
tolerations: []

importer:
create: false
image: pingcap/tidb-lightning:v3.0.8
Expand Down
Loading