diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index d56d8ca406..21bcb5b150 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -293,6 +293,29 @@ tidb: ## 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: {} + ## If binlog.pump is enabled, the following affinity is recommended to make tidb and pump deploy at the same node in production + ## to avoid losing binlog in tidb if there was network partition error. + # podAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # - labelSelector: + # matchExpressions: + # - key: "app.kubernetes.io/component" + # operator: In + # values: + # - "pump" + # - key: "app.kubernetes.io/managed-by" + # operator: In + # values: + # - "tidb-operator" + # - key: "app.kubernetes.io/name" + # operator: In + # values: + # - "tidb-cluster" + # - key: "app.kubernetes.io/instance" + # operator: In + # values: + # - + # topologyKey: kubernetes.io/hostname ## 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 @@ -454,6 +477,32 @@ binlog: # affinity for pump pod assignment, default: empty # ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity affinity: {} + ## The following setting is recommended to make each pump instance be distributed deployed in each node + ## Each node is recommended at most have one pump instance deployed. + # podAntiAffinity: + # preferredDuringSchedulingIgnoredDuringExecution: + # - weight: 100 + # podAffinityTerm: + # labelSelector: + # matchExpressions: + # - key: "app.kubernetes.io/component" + # operator: In + # values: + # - "pump" + # - key: "app.kubernetes.io/managed-by" + # operator: In + # values: + # - "tidb-operator" + # - key: "app.kubernetes.io/name" + # operator: In + # values: + # - "tidb-cluster" + # - key: "app.kubernetes.io/instance" + # operator: In + # values: + # - + # topologyKey: kubernetes.io/hostname + # 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: []