Skip to content

Commit

Permalink
Add recommended affinity setting for tidb and pump in note (#1251)
Browse files Browse the repository at this point in the history
* Update values.yaml

* Update values.yaml

* Update values.yaml
  • Loading branch information
Yisaer authored and cofyc committed Dec 2, 2019
1 parent cf49dfc commit 0739d95
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions charts/tidb-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,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:
# - <release-name>
# 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
Expand Down Expand Up @@ -511,6 +534,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:
# - <release-name>
# 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: []
Expand Down

0 comments on commit 0739d95

Please sign in to comment.