pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.23k stars 498 forks source link

Add default affinity for tidb if bin-log enabled #1234

Closed Yisaer closed 4 years ago

Yisaer commented 4 years ago

Feature Request

Is your feature request related to a problem? Please describe:

https://github.com/pingcap/docs-cn/issues/2073

tidb is recomended to deploy into the same node with pump. Currently the affinity in our helm chart values for tidb is empty. I think it's better to set affnitiy for tidb to stay in the node with pump by default if bin-log enabled.

Teachability, Documentation, Adoption, Migration Strategy:

https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity

tennix commented 4 years ago

The affinity should be set on TiDB instead of Pump. If binlog is enabled, the tidb-server should be scheduled on a node that has pump pod.

Yisaer commented 4 years ago

The affinity should be set on TiDB instead of Pump. If binlog is enabled, the tidb-server should be scheduled on a node that has pump pod.

Updated.

tennix commented 4 years ago

I don't think we should set it in values.yaml. This logic is complicated in helm. Instead we should add documentation for this.

Yisaer commented 4 years ago

Maybe we could recommend the affinity both in the document and the note in the values.yaml if the user want to enable the binlog? @tennix