tidb-operator icon indicating copy to clipboard operation
tidb-operator copied to clipboard

TidbInitializer support specifying tidb endpoint

Open tennix opened this issue 3 years ago • 1 comments
trafficstars

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:

  • Disable SEM first and then run initialization SQL statement and then restart tidb to enable SEM
  • Run TidbInitializer via a SEM disabled tidb-server, after that shut down SEM disabled tidb-server

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.

tennix avatar Feb 09 '22 06:02 tennix

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?

mikechengwei avatar Apr 15 '22 07:04 mikechengwei