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.22k stars 493 forks source link

shorten some default location labels #4678

Closed glorv closed 2 years ago

glorv commented 2 years ago

Feature Request

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

Currently, when use tidb-operator to deploy cluster in cross AZ environment, it's common to set the location-labels like ["topology.kubernetes.io/region", "topology.kubernetes.io/zone", "kubernetes.io/hostname"], but long label names may cause performance problems. See https://github.com/tikv/pd/issues/5360 for more details.

Describe the feature you'd like:

As we already support mapping host to kubernetes.io/hostname in: https://github.com/pingcap/tidb-operator/blob/00002ede5e5b2c811d8bbff4043a4cc7a2a1e2a6/pkg/manager/member/node.go#L35-L39

I think it's also useful to treat region and zone in the same way: region --> topology.kubernetes.io/region and failure-domain.beta.kubernetes.io/region(for old k8s version) zone --> topology.kubernetes.io/zone and failure-domain.beta.kubernetes.io/zone(for old k8s version)

So user can config both zone or topology.kubernetes.io/zone, and the effect is the same.

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

glorv commented 2 years ago

@DanielZhangQD @KanShiori @nolouch PTAL

nolouch commented 2 years ago

looks good to me~

glorv commented 2 years ago

@azurezyq Could you please take a look?

nolouch commented 2 years ago

I think it's more user friendly.

KanShiori commented 2 years ago

LGTM