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

TidbInitializer support specifying tidb endpoint #4399

Open tennix opened 2 years ago

tennix commented 2 years ago

Feature Request

For a cluster enabling SEM (Security Enhanced Mode), the tidb-server have limited permission, if we want to do some initialization that beyond SEM tidb-servers permissions, we have two choices:

The first one need to rolling restart all tidb-servers which might take a long time. While with the second one, TidbInitializer currently only support finding tidb-server endpoint via TidbCluster, so it's impossible to do the initialization via TidbInitializer.

So I'd like to allow user specifying a tidb endpoint for TidbInitializer.

mikechengwei commented 2 years ago
apiVersion: pingcap.com/v1alpha1
kind: TidbInitializer
metadata:
  name: initialize-demo
spec:
  image: tnir/mysqlclient
  imagePullPolicy: IfNotPresent
  cluster:
    name: initialize-demo
    host:
    port:

Do you me above example code?