diff --git a/charts/tidb-cluster/templates/discovery-deployment.yaml b/charts/tidb-cluster/templates/discovery-deployment.yaml index 38e21e41b0..df6bd7c507 100644 --- a/charts/tidb-cluster/templates/discovery-deployment.yaml +++ b/charts/tidb-cluster/templates/discovery-deployment.yaml @@ -29,6 +29,14 @@ spec: {{- if .Values.rbac.create }} serviceAccount: {{ template "cluster.name" . }}-discovery {{- end }} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 8 }} + {{- end }} {{- end }} containers: - name: discovery diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index 5b9646e0d0..2959c67ab9 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -48,6 +48,15 @@ discovery: cpu: 80m memory: 50Mi + ## affinity defines discovery 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: [] + # Whether enable ConfigMap Rollout management. # When enabling, change of ConfigMap will trigger a graceful rolling-update of the component. # This feature is only available in tidb-operator v1.0 or higher.