From c8162a743bd2c9090d2dc0e943daa1001a93b771 Mon Sep 17 00:00:00 2001 From: DanielZhangQD <36026334+DanielZhangQD@users.noreply.github.com> Date: Wed, 8 Apr 2020 15:55:08 +0800 Subject: [PATCH] Automated cherry pick of #2122: crd for tiflash (#2136) * crd for tiflash * generated files * update defaulting for tiflash config * address comments * fix ci * update crd * update storage type definition * update api docs --- docs/api-references/config.json | 25 +- docs/api-references/docs.md | 3545 ++++++++++++----- manifests/crd.yaml | 1029 +++++ .../v1alpha1/defaulting/tidbcluster.go | 20 +- .../pingcap/v1alpha1/openapi_generated.go | 420 +- pkg/apis/pingcap/v1alpha1/tiflash_config.go | 359 ++ pkg/apis/pingcap/v1alpha1/types.go | 56 + .../pingcap/v1alpha1/validation/validation.go | 25 + .../pingcap/v1alpha1/zz_generated.deepcopy.go | 663 +++ pkg/controller/controller_utils.go | 10 + 10 files changed, 5052 insertions(+), 1100 deletions(-) create mode 100644 pkg/apis/pingcap/v1alpha1/tiflash_config.go diff --git a/docs/api-references/config.json b/docs/api-references/config.json index ea4aa3d942..cc214e90bd 100644 --- a/docs/api-references/config.json +++ b/docs/api-references/config.json @@ -1,6 +1,28 @@ { "hideMemberFields": [ - "TypeMeta" + "TypeMeta", + "TmpPath", + "DisplayName", + "DefaultProfile", + "Path", + "ListenHost", + "TCPPort", + "HTTPPort", + "InternalServerHTTPPort", + "Errorlog", + "ServerLog", + "TiDBStatusAddr", + "ServiceAddr", + "ProxyConfig", + "ClusterManagerPath", + "FlashStatus", + "FlashQuota", + "FlashUser", + "FlashProfile", + "FlashApplication", + "FlashProxy", + "FlashRaft", + "ClusterLog" ], "hideTypePatterns": [ "ParseError$", @@ -27,3 +49,4 @@ }, "markdownDisabled": false } + diff --git a/docs/api-references/docs.md b/docs/api-references/docs.md index da31adcd78..eac6a18527 100644 --- a/docs/api-references/docs.md +++ b/docs/api-references/docs.md @@ -717,6 +717,20 @@ TiKVSpec +tiflash
+ + +TiFlashSpec + + + + +(Optional) +

TiFlash cluster spec

+ + + + pump
@@ -2420,6 +2434,87 @@ Optional: Defaults to range

+

CommonConfig +

+

+(Appears on: +TiFlashConfig) +

+

+

CommonConfig is the configuration of TiFlash process.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+path_realtime_mode
+ +bool + +
+(Optional) +

Optional: Defaults to false

+
+mark_cache_size
+ +int64 + +
+(Optional) +

Optional: Defaults to 5368709120

+
+minmax_index_cache_size
+ +int64 + +
+(Optional) +

Optional: Defaults to 5368709120

+
+flash
+ + +Flash + + +
+(Optional) +
+loger
+ + +FlashLogger + + +
+(Optional) +

ComponentAccessor

@@ -2433,6 +2528,7 @@ and component-level overrides

PDSpec, PumpSpec, TiDBSpec, +TiFlashSpec, TiKVSpec)

@@ -3006,14 +3102,14 @@ int -

GcsStorageProvider +

Flash

(Appears on: -StorageProvider) +CommonConfig)

-

GcsStorageProvider represents the google cloud storage for storing backups.

+

Flash is the configuration of [flash] section.

@@ -3025,104 +3121,82 @@ int - - - - - - - - - - - - + +
-projectId
- -string - -
-

ProjectId represents the project that organizes all your Google Cloud Platform resources

-
-location
- -string - -
-

Location in which the gcs bucket is located.

-
-path
- -string - -
-

Path is the full path where the backup is saved. -The format of the path must be: “/

-
-bucket
+overlap_threshold
-string +float64
-

Bucket in which to store the backup data.

+(Optional) +

Optional: Defaults to 0.6

-storageClass
+compact_log_min_period
-string +int32
-

StorageClass represents the storage class

+(Optional) +

Optional: Defaults to 200

-objectAcl
+flash_cluster
-string + +FlashCluster +
-

ObjectAcl represents the access control list for new objects

+(Optional)
+

FlashApplication +

+

+(Appears on: +CommonConfig) +

+

+

FlashApplication is the configuration of [application] section.

+

+ + - - + + + +
-bucketAcl
- -string - -
-

BucketAcl represents the access control list for new buckets

-
FieldDescription
-secretName
+runAsDaemon
-string +bool
-

SecretName is the name of secret which stores the -gcs service account credentials JSON .

+(Optional) +

Optional: Defaults to true

-

GrafanaSpec +

FlashCluster

(Appears on: -TidbMonitorSpec) +Flash)

-

GrafanaSpec is the desired state of grafana

+

FlashCluster is the configuration of [flash.flash_cluster] section.

@@ -3134,82 +3208,105 @@ gcs service account credentials JSON .

+ +
-MonitorContainer
+refresh_interval
- -MonitorContainer - +int32
-

-(Members of MonitorContainer are embedded into this type.) -

+(Optional) +

Optional: Defaults to 20

-logLevel
+update_rule_interval
-string +int32
+(Optional) +

Optional: Defaults to 10

-service
+master_ttl
- -ServiceSpec - +int32
+(Optional) +

Optional: Defaults to 60

+

FlashLogger +

+

+(Appears on: +CommonConfig) +

+

+

FlashLogger is the configuration of [logger] section.

+

+ + + + + + + +
FieldDescription
-username
+size
string
+(Optional) +

Optional: Defaults to 100M

-password
+level
string
+(Optional) +

Optional: Defaults to information

-envs
+count
-map[string]string +int32
(Optional) +

Optional: Defaults to 10

-

HelperSpec +

FlashProfile

(Appears on: -TidbClusterSpec) +CommonConfig)

-

HelperSpec contains details of helper component

+

FlashProfile is the configuration of [profiles] section.

@@ -3221,50 +3318,40 @@ map[string]string
-image
+readonly
-string + +Profile +
(Optional) -

Image used to tail slow log and set kernel parameters if necessary, must have tail and sysctl installed -Optional: Defaults to busybox:1.26.2

-imagePullPolicy
+default
- -Kubernetes core/v1.PullPolicy + +Profile
(Optional) -

ImagePullPolicy of the component. Override the cluster-level imagePullPolicy if present -Optional: Defaults to the cluster-level setting

-

InitializePhase -(string alias)

-

-(Appears on: -TidbInitializerStatus) -

-

-

-

InitializerSpec +

FlashProxy

(Appears on: -TidbMonitorSpec) +Flash)

-

InitializerSpec is the desired state of initializer

+

FlashProxy is the configuration of [flash.proxy] section.

@@ -3276,72 +3363,73 @@ Optional: Defaults to the cluster-level setting

- -
-MonitorContainer
+addr
- -MonitorContainer - +string
-

-(Members of MonitorContainer are embedded into this type.) -

+(Optional) +

Optional: Defaults to 0.0.0.0:20170

-envs
+advertise-addr
-map[string]string +string
(Optional)
-

IsolationRead -

-

-(Appears on: -TiDBConfig) -

-

-

IsolationRead is the config for isolation read.

-

- - - - - - - + + + + + + +
FieldDescription
+data-dir
+ +string + +
+(Optional) +

Optional: Defaults to /data/proxy

+
-engines
+config
-[]string +string
(Optional) -

Engines filters tidb-server access paths by engine type. -imported from v3.1.0

+

Optional: Defaults to /data/proxy.toml

+
+log-file
+ +string + +
+(Optional) +

Optional: Defaults to /data/logs/proxy.log

-

Log +

FlashQuota

(Appears on: -TiDBConfig) +CommonConfig)

-

Log is the log section of config.

+

FlashQuota is the configuration of [quotas] section.

@@ -3353,97 +3441,173 @@ imported from v3.1.0

+ +
-level
+default
-string + +Quota +
(Optional) -

Log level. -Optional: Defaults to info

+

FlashRaft +

+

+(Appears on: +CommonConfig) +

+

+

FlashRaft is the configuration of [raft] section.

+

+ + + + + + + + + +
FieldDescription
-format
+pd_addr
string
(Optional) -

Log format. one of json, text, or console. -Optional: Defaults to text

-disable-timestamp
+kvstore_path
-bool +string
(Optional) -

Disable automatic timestamps in output.

+

Optional: Defaults to /data/kvstore

-enable-timestamp
+storage_engine
-bool +string
(Optional) -

EnableTimestamp enables automatic timestamps in log output.

+

Optional: Defaults to dt

+

FlashServerConfig +

+

+(Appears on: +ProxyConfig) +

+

+

FlashServerConfig is the configuration of Proxy server.

+

+ + + + + + + + + +
FieldDescription
-enable-error-stack
+engine-addr
-bool +string
(Optional) -

EnableErrorStack enables annotating logs with the full stack error -message.

-file
+TiKVServerConfig
- -FileLogConfig + +TiKVServerConfig
-(Optional) -

File log config.

+

+(Members of TiKVServerConfig are embedded into this type.) +

+

FlashStatus +

+

+(Appears on: +CommonConfig) +

+

+

FlashStatus is the configuration of [status] section.

+

+ + + + + + + + + +
FieldDescription
-enable-slow-log
+metrics_port
-bool +int32
(Optional) +

Optional: Defaults to 8234

+

FlashUser +

+

+(Appears on: +CommonConfig) +

+

+

FlashUser is the configuration of [users] section.

+

+ + + + + + + + + +
FieldDescription
-slow-query-file
+readonly
-string + +User +
@@ -3452,153 +3616,123 @@ string
-slow-threshold
+default
-uint64 + +User +
-(Optional) -

Optional: Defaults to 300

+

GcsStorageProvider +

+

+(Appears on: +StorageProvider) +

+

+

GcsStorageProvider represents the google cloud storage for storing backups.

+

+ + + + + + + + - -
FieldDescription
-expensive-threshold
+projectId
-uint +string
-(Optional) -

Optional: Defaults to 10000

+

ProjectId represents the project that organizes all your Google Cloud Platform resources

-query-log-max-len
+location
-uint64 +string
-(Optional) -

Optional: Defaults to 2048

+

Location in which the gcs bucket is located.

-record-plan-in-slow-log
+bucket
-uint32 +string
-(Optional) -

Optional: Defaults to 1

+

Bucket in which to store the backup data.

-

MemberPhase -(string alias)

-

-(Appears on: -PDStatus, -PumpStatus, -TiDBStatus, -TiKVStatus) -

-

-

MemberPhase is the current state of member

-

-

MemberType -(string alias)

-

-

MemberType represents member type

-

-

MonitorComponentAccessor -

-

-

-

MonitorContainer -

-

-(Appears on: -GrafanaSpec, -InitializerSpec, -PrometheusSpec, -ReloaderSpec) -

-

-

MonitorContainer is the common attributes of the container of monitoring

-

- - - - - - - -
FieldDescription
-Resources
+storageClass
- -Kubernetes core/v1.ResourceRequirements - +string
-

-(Members of Resources are embedded into this type.) -

+

StorageClass represents the storage class

-baseImage
+objectAcl
string
+

ObjectAcl represents the access control list for new objects

-version
+bucketAcl
string
+

BucketAcl represents the access control list for new buckets

-imagePullPolicy
+secretName
- -Kubernetes core/v1.PullPolicy - +string
-(Optional) +

SecretName is the name of secret which stores the +gcs service account credentials JSON .

-

OpenTracing +

GrafanaSpec

(Appears on: -TiDBConfig) +TidbMonitorSpec)

-

OpenTracing is the opentracing section of the config.

+

GrafanaSpec is the desired state of grafana

@@ -3610,47 +3744,66 @@ Kubernetes core/v1.PullPolicy + + + + + + + +
-enable
+MonitorContainer
-bool + +MonitorContainer +
-(Optional) -

Optional: Defaults to false

+

+(Members of MonitorContainer are embedded into this type.) +

-sampler
+logLevel
- -OpenTracingSampler - +string
-(Optional)
-reporter
+service
- -OpenTracingReporter + +ServiceSpec
-(Optional)
-rpc-metrics
+username
-bool +string + +
+
+password
+ +string + +
+
+envs
+ +map[string]string
@@ -3659,15 +3812,14 @@ bool
-

OpenTracingReporter +

HelperSpec

(Appears on: -OpenTracing) +TidbClusterSpec)

-

OpenTracingReporter is the config for opentracing reporter. -See https://godoc.org/github.com/uber/jaeger-client-go/config#ReporterConfig

+

HelperSpec contains details of helper component

@@ -3679,42 +3831,79 @@ See +Kubernetes core/v1.PullPolicy + + +
(Optional) +

ImagePullPolicy of the component. Override the cluster-level imagePullPolicy if present +Optional: Defaults to the cluster-level setting

+

InitializePhase +(string alias)

+

+(Appears on: +TidbInitializerStatus) +

+

+

+

InitializerSpec +

+

+(Appears on: +TidbMonitorSpec) +

+

+

InitializerSpec is the desired state of initializer

+

+ + + + + + + +
FieldDescription
-log-spans
+MonitorContainer
-bool + +MonitorContainer +
-(Optional) +

+(Members of MonitorContainer are embedded into this type.) +

-local-agent-host-port
+envs
-string +map[string]string
@@ -3723,15 +3912,14 @@ string
-

OpenTracingSampler +

Interval

(Appears on: -OpenTracing) +Quota)

-

OpenTracingSampler is the config for opentracing sampler. -See https://godoc.org/github.com/uber/jaeger-client-go/config#SamplerConfig

+

Interval is the configuration of [quotas.default.interval] section.

@@ -3743,69 +3931,86 @@ See PDConfig +

IsolationRead

(Appears on: -PDSpec) +TiDBConfig)

-

PDConfig is the configuration of pd-server

+

IsolationRead is the config for isolation read.

@@ -3817,100 +4022,118 @@ time.Duration + +
-force-new-cluster
+engines
-bool +[]string
(Optional) +

Engines filters tidb-server access paths by engine type. +imported from v3.1.0

+

Log +

+

+(Appears on: +TiDBConfig) +

+

+

Log is the log section of config.

+

+ + + + + + + + + +
FieldDescription
-enable-grpc-gateway
+level
-bool +string
(Optional) -

Optional: Defaults to true

+

Log level. +Optional: Defaults to info

-lease
+format
-int64 +string
(Optional) -

LeaderLease time, if leader doesn’t update its TTL -in etcd after lease time, etcd will expire the leader key -and other servers can campaign the leader again. -Etcd only supports seconds TTL, so here is second too. -Optional: Defaults to 3

+

Log format. one of json, text, or console. +Optional: Defaults to text

-log
+disable-timestamp
- -PDLogConfig - +bool
(Optional) -

Log related config.

+

Disable automatic timestamps in output.

-log-file
+enable-timestamp
-string +bool
(Optional) -

Backward compatibility.

+

EnableTimestamp enables automatic timestamps in log output.

-log-level
+enable-error-stack
-string +bool
(Optional) +

EnableErrorStack enables annotating logs with the full stack error +message.

-tso-save-interval
+file
-string + +FileLogConfig +
(Optional) -

TsoSaveInterval is the interval to save timestamp. -Optional: Defaults to 3s

+

File log config.

-metric
+enable-slow-log
- -PDMetricConfig - +bool
@@ -3919,157 +4142,221 @@ PDMetricConfig
-schedule
+slow-query-file
- -PDScheduleConfig - +string
(Optional) -

Immutable, change should be made through pd-ctl after cluster creation

-replication
+slow-threshold
- -PDReplicationConfig - +uint64
(Optional) -

Immutable, change should be made through pd-ctl after cluster creation

+

Optional: Defaults to 300

-namespace
+expensive-threshold
- -map[string]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDNamespaceConfig - +uint
(Optional) +

Optional: Defaults to 10000

-pd-server
+query-log-max-len
- -PDServerConfig - +uint64
(Optional) +

Optional: Defaults to 2048

-cluster-version
+record-plan-in-slow-log
-string +uint32
(Optional) +

Optional: Defaults to 1

+

MemberPhase +(string alias)

+

+(Appears on: +PDStatus, +PumpStatus, +TiDBStatus, +TiKVStatus) +

+

+

MemberPhase is the current state of member

+

+

MemberType +(string alias)

+

+

MemberType represents member type

+

+

MonitorComponentAccessor +

+

+

+

MonitorContainer +

+

+(Appears on: +GrafanaSpec, +InitializerSpec, +PrometheusSpec, +ReloaderSpec) +

+

+

MonitorContainer is the common attributes of the container of monitoring

+

+ + + + + + + + + +
FieldDescription
-quota-backend-bytes
+Resources
-string + +Kubernetes core/v1.ResourceRequirements +
-(Optional) -

QuotaBackendBytes Raise alarms when backend size exceeds the given quota. 0 means use the default quota. -the default size is 2GB, the maximum is 8GB.

+

+(Members of Resources are embedded into this type.) +

-auto-compaction-mode
+baseImage
string
-(Optional) -

AutoCompactionMode is either ‘periodic’ or ‘revision’. The default value is ‘periodic’.

-auto-compaction-retention-v2
+version
string
-(Optional) -

AutoCompactionRetention is either duration string with time unit -(e.g. ‘5m’ for 5-minute), or revision unit (e.g. ‘5000’). -If no time unit is provided and compaction mode is ‘periodic’, -the unit defaults to hour. For example, ‘5’ translates into 5-hour. -The default retention is 1 hour. -Before etcd v3.3.x, the type of retention is int. We add ‘v2’ suffix to make it backward compatible.

-tikv-interval
+imagePullPolicy
-string + +Kubernetes core/v1.PullPolicy +
(Optional) -

TickInterval is the interval for etcd Raft tick.

+

Networks +

+

+(Appears on: +User) +

+

+

Networks is the configuration of [users.readonly.networks] section.

+

+ + + + + + + + + +
FieldDescription
-election-interval
+ip
string
(Optional) -

ElectionInterval is the interval for etcd Raft election.

+

OpenTracing +

+

+(Appears on: +TiDBConfig) +

+

+

OpenTracing is the opentracing section of the config.

+

+ + + + + + + + @@ -4079,10 +4366,10 @@ PDSecurityConfig @@ -4092,28 +4379,26 @@ PDLabelPropertyConfig
FieldDescription
-enable-prevote
+enable
bool
(Optional) -

Prevote is true to enable Raft Pre-Vote. -If enabled, Raft runs an additional election phase -to check whether it would get enough votes to win -an election, thus minimizing disruptions. -Optional: Defaults to true

+

Optional: Defaults to false

-security
+sampler
- -PDSecurityConfig + +OpenTracingSampler
-label-property
+reporter
- -PDLabelPropertyConfig + +OpenTracingReporter
-namespace-classifier
+rpc-metrics
-string +bool
(Optional) -

NamespaceClassifier is for classifying stores/regions into different -namespaces. -Optional: Defaults to true

-

PDFailureMember +

OpenTracingReporter

(Appears on: -PDStatus) +OpenTracing)

-

PDFailureMember is the pd failure member information

+

OpenTracingReporter is the config for opentracing reporter. +See https://godoc.org/github.com/uber/jaeger-client-go/config#ReporterConfig

@@ -4125,74 +4410,59 @@ Optional: Defaults to true

- - - -
-podName
- -string - -
-
-memberID
+queue-size
-string +int
+(Optional)
-pvcUID
+buffer-flush-interval
-k8s.io/apimachinery/pkg/types.UID +time.Duration
+(Optional)
-memberDeleted
+log-spans
bool
+(Optional)
-createdAt
+local-agent-host-port
- -Kubernetes meta/v1.Time - +string
+(Optional)
-

PDLabelPropertyConfig -(map[string]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDStoreLabels alias)

-

-(Appears on: -PDConfig) -

-

-

-

PDLogConfig +

OpenTracingSampler

(Appears on: -PDConfig) +OpenTracing)

-

PDLogConfig serializes log related config in toml/json.

+

OpenTracingSampler is the config for opentracing sampler. +See https://godoc.org/github.com/uber/jaeger-client-go/config#SamplerConfig

@@ -4204,216 +4474,215 @@ Kubernetes meta/v1.Time + +
-level
+type
string
(Optional) -

Log level. -Optional: Defaults to info

-format
+param
-string +float64
(Optional) -

Log format. one of json, text, or console.

-disable-timestamp
+sampling-server-url
-bool +string
(Optional) -

Disable automatic timestamps in output.

-file
+max-operations
- -FileLogConfig - +int
(Optional) -

File log config.

-development
+sampling-refresh-interval
-bool +time.Duration
(Optional) -

Development puts the logger in development mode, which changes the -behavior of DPanicLevel and takes stacktraces more liberally.

+

PDConfig +

+

+(Appears on: +PDSpec) +

+

+

PDConfig is the configuration of pd-server

+

+ + + + + + + + +

LeaderLease time, if leader doesn’t update its TTL +in etcd after lease time, etcd will expire the leader key +and other servers can campaign the leader again. +Etcd only supports seconds TTL, so here is second too. +Optional: Defaults to 3

+ - -
FieldDescription
-disable-caller
+force-new-cluster
bool
(Optional) -

DisableCaller stops annotating logs with the calling function’s file -name and line number. By default, all logs are annotated.

-disable-stacktrace
+enable-grpc-gateway
bool
(Optional) -

DisableStacktrace completely disables automatic stacktrace capturing. By -default, stacktraces are captured for WarnLevel and above logs in -development and ErrorLevel and above in production.

+

Optional: Defaults to true

-disable-error-verbose
+lease
-bool +int64
(Optional) -

DisableErrorVerbose stops annotating logs with the full verbose error -message.

-
-

PDMember -

-

-(Appears on: -PDStatus) -

-

-

PDMember is PD member

-

- - - - + + - - - -
FieldDescription +log
+ + +PDLogConfig + + +
+(Optional) +

Log related config.

+
-name
+log-file
string
+(Optional) +

Backward compatibility.

-id
+log-level
string
-

member id is actually a uint64, but apimachinery’s json only treats numbers as int64/float64 -so uint64 may overflow int64 and thus convert to float64

+(Optional)
-clientURL
+tso-save-interval
string
+(Optional) +

TsoSaveInterval is the interval to save timestamp. +Optional: Defaults to 3s

-health
+metric
-bool + +PDMetricConfig +
+(Optional)
-lastTransitionTime
+schedule
- -Kubernetes meta/v1.Time + +PDScheduleConfig
-

Last time the health transitioned from one to another.

+(Optional) +

Immutable, change should be made through pd-ctl after cluster creation

-

PDMetricConfig -

-

-(Appears on: -PDConfig) -

-

-

- - - - - - - - - -
FieldDescription
-job
+replication
-string + +PDReplicationConfig +
(Optional) +

Immutable, change should be made through pd-ctl after cluster creation

-address
+namespace
-string + +map[string]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDNamespaceConfig +
@@ -4422,191 +4691,160 @@ string
-interval
+pd-server
-string + +PDServerConfig +
(Optional)
-

PDNamespaceConfig -

-

-(Appears on: -PDConfig) -

-

-

PDNamespaceConfig is to overwrite the global setting for specific namespace

-

- - - - - - - - - -
FieldDescription
-leader-schedule-limit
+cluster-version
-uint64 +string
(Optional) -

LeaderScheduleLimit is the max coexist leader schedules.

-region-schedule-limit
+quota-backend-bytes
-uint64 +string
(Optional) -

RegionScheduleLimit is the max coexist region schedules.

+

QuotaBackendBytes Raise alarms when backend size exceeds the given quota. 0 means use the default quota. +the default size is 2GB, the maximum is 8GB.

-replica-schedule-limit
+auto-compaction-mode
-uint64 +string
(Optional) -

ReplicaScheduleLimit is the max coexist replica schedules.

+

AutoCompactionMode is either ‘periodic’ or ‘revision’. The default value is ‘periodic’.

-merge-schedule-limit
+auto-compaction-retention-v2
-uint64 +string
(Optional) -

MergeScheduleLimit is the max coexist merge schedules.

+

AutoCompactionRetention is either duration string with time unit +(e.g. ‘5m’ for 5-minute), or revision unit (e.g. ‘5000’). +If no time unit is provided and compaction mode is ‘periodic’, +the unit defaults to hour. For example, ‘5’ translates into 5-hour. +The default retention is 1 hour. +Before etcd v3.3.x, the type of retention is int. We add ‘v2’ suffix to make it backward compatible.

-hot-region-schedule-limit
+tikv-interval
-uint64 +string
(Optional) -

HotRegionScheduleLimit is the max coexist hot region schedules.

+

TickInterval is the interval for etcd Raft tick.

-max-replicas
+election-interval
-uint64 +string
(Optional) -

MaxReplicas is the number of replicas for each region.

+

ElectionInterval is the interval for etcd Raft election.

-

PDReplicationConfig -

-

-(Appears on: -PDConfig) -

-

-

PDReplicationConfig is the replication configuration.

-

- - - - - - - -
FieldDescription
-max-replicas
+enable-prevote
-uint64 +bool
(Optional) -

MaxReplicas is the number of replicas for each region. -Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 3

+

Prevote is true to enable Raft Pre-Vote. +If enabled, Raft runs an additional election phase +to check whether it would get enough votes to win +an election, thus minimizing disruptions. +Optional: Defaults to true

-location-labels
+security
-[]string + +PDSecurityConfig +
(Optional) -

The label keys specified the location of a store. -The placement priorities is implied by the order of label keys. -For example, [“zone”, “rack”] means that we should place replicas to -different zones first, then to different racks if we don’t have enough zones. -Immutable, change should be made through pd-ctl after cluster creation

-strictly-match-label,string
+label-property
-bool + +PDLabelPropertyConfig +
(Optional) -

StrictlyMatchLabel strictly checks if the label of TiKV is matched with LocaltionLabels. -Immutable, change should be made through pd-ctl after cluster creation. -Imported from v3.1.0

-enable-placement-rules,string
+namespace-classifier
-bool +string
(Optional) -

When PlacementRules feature is enabled. MaxReplicas and LocationLabels are not used anymore.

+

NamespaceClassifier is for classifying stores/regions into different +namespaces. +Optional: Defaults to true

-

PDScheduleConfig +

PDFailureMember

(Appears on: -PDConfig) +PDStatus)

-

ScheduleConfig is the schedule configuration.

+

PDFailureMember is the pd failure member information

@@ -4618,393 +4856,1283 @@ bool + + + + + + + +
-max-snapshot-count
+podName
-uint64 +string
-(Optional) -

If the snapshot count of one store is greater than this value, -it will never be used as a source or target store. -Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 3

-max-pending-peer-count
+memberID
-uint64 +string
-(Optional) -

Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 16

-max-merge-region-size
+pvcUID
-uint64 +k8s.io/apimachinery/pkg/types.UID
-(Optional) -

If both the size of region is smaller than MaxMergeRegionSize -and the number of rows in region is smaller than MaxMergeRegionKeys, -it will try to merge with adjacent regions. -Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 20

-max-merge-region-keys
+memberDeleted
-uint64 +bool + +
+
+createdAt
+ + +Kubernetes meta/v1.Time + + +
+
+

PDLabelPropertyConfig +(map[string]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDStoreLabels alias)

+

+(Appears on: +PDConfig) +

+

+

+

PDLogConfig +

+

+(Appears on: +PDConfig) +

+

+

PDLogConfig serializes log related config in toml/json.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+level
+ +string + +
+(Optional) +

Log level. +Optional: Defaults to info

+
+format
+ +string + +
+(Optional) +

Log format. one of json, text, or console.

+
+disable-timestamp
+ +bool + +
+(Optional) +

Disable automatic timestamps in output.

+
+file
+ + +FileLogConfig + + +
+(Optional) +

File log config.

+
+development
+ +bool + +
+(Optional) +

Development puts the logger in development mode, which changes the +behavior of DPanicLevel and takes stacktraces more liberally.

+
+disable-caller
+ +bool + +
+(Optional) +

DisableCaller stops annotating logs with the calling function’s file +name and line number. By default, all logs are annotated.

+
+disable-stacktrace
+ +bool + +
+(Optional) +

DisableStacktrace completely disables automatic stacktrace capturing. By +default, stacktraces are captured for WarnLevel and above logs in +development and ErrorLevel and above in production.

+
+disable-error-verbose
+ +bool + +
+(Optional) +

DisableErrorVerbose stops annotating logs with the full verbose error +message.

+
+

PDMember +

+

+(Appears on: +PDStatus) +

+

+

PDMember is PD member

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+
+id
+ +string + +
+

member id is actually a uint64, but apimachinery’s json only treats numbers as int64/float64 +so uint64 may overflow int64 and thus convert to float64

+
+clientURL
+ +string + +
+
+health
+ +bool + +
+
+lastTransitionTime
+ + +Kubernetes meta/v1.Time + + +
+

Last time the health transitioned from one to another.

+
+

PDMetricConfig +

+

+(Appears on: +PDConfig) +

+

+

+ + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+job
+ +string + +
+(Optional) +
+address
+ +string + +
+(Optional) +
+interval
+ +string + +
+(Optional) +
+

PDNamespaceConfig +

+

+(Appears on: +PDConfig) +

+

+

PDNamespaceConfig is to overwrite the global setting for specific namespace

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+leader-schedule-limit
+ +uint64 + +
+(Optional) +

LeaderScheduleLimit is the max coexist leader schedules.

+
+region-schedule-limit
+ +uint64 + +
+(Optional) +

RegionScheduleLimit is the max coexist region schedules.

+
+replica-schedule-limit
+ +uint64 + +
+(Optional) +

ReplicaScheduleLimit is the max coexist replica schedules.

+
+merge-schedule-limit
+ +uint64 + +
+(Optional) +

MergeScheduleLimit is the max coexist merge schedules.

+
+hot-region-schedule-limit
+ +uint64 + +
+(Optional) +

HotRegionScheduleLimit is the max coexist hot region schedules.

+
+max-replicas
+ +uint64 + +
+(Optional) +

MaxReplicas is the number of replicas for each region.

+
+

PDReplicationConfig +

+

+(Appears on: +PDConfig) +

+

+

PDReplicationConfig is the replication configuration.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+max-replicas
+ +uint64 + +
+(Optional) +

MaxReplicas is the number of replicas for each region. +Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 3

+
+location-labels
+ +[]string + +
+(Optional) +

The label keys specified the location of a store. +The placement priorities is implied by the order of label keys. +For example, [“zone”, “rack”] means that we should place replicas to +different zones first, then to different racks if we don’t have enough zones. +Immutable, change should be made through pd-ctl after cluster creation

+
+strictly-match-label,string
+ +bool + +
+(Optional) +

StrictlyMatchLabel strictly checks if the label of TiKV is matched with LocaltionLabels. +Immutable, change should be made through pd-ctl after cluster creation. +Imported from v3.1.0

+
+enable-placement-rules,string
+ +bool + +
+(Optional) +

When PlacementRules feature is enabled. MaxReplicas and LocationLabels are not used anymore.

+
+

PDScheduleConfig +

+

+(Appears on: +PDConfig) +

+

+

ScheduleConfig is the schedule configuration.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+max-snapshot-count
+ +uint64 + +
+(Optional) +

If the snapshot count of one store is greater than this value, +it will never be used as a source or target store. +Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 3

+
+max-pending-peer-count
+ +uint64 + +
+(Optional) +

Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 16

+
+max-merge-region-size
+ +uint64 + +
+(Optional) +

If both the size of region is smaller than MaxMergeRegionSize +and the number of rows in region is smaller than MaxMergeRegionKeys, +it will try to merge with adjacent regions. +Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 20

+
+max-merge-region-keys
+ +uint64 + +
+(Optional) +

Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 200000

+
+split-merge-interval
+ +string + +
+(Optional) +

SplitMergeInterval is the minimum interval time to permit merge after split. +Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 1h

+
+patrol-region-interval
+ +string + +
+(Optional) +

PatrolRegionInterval is the interval for scanning region during patrol. +Immutable, change should be made through pd-ctl after cluster creation

+
+max-store-down-time
+ +string + +
+(Optional) +

MaxStoreDownTime is the max duration after which +a store will be considered to be down if it hasn’t reported heartbeats. +Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 30m

+
+leader-schedule-limit
+ +uint64 + +
+(Optional) +

LeaderScheduleLimit is the max coexist leader schedules. +Immutable, change should be made through pd-ctl after cluster creation. +Optional: Defaults to 4. +Imported from v3.1.0

+
+region-schedule-limit
+ +uint64 + +
+(Optional) +

RegionScheduleLimit is the max coexist region schedules. +Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 2048

+
+replica-schedule-limit
+ +uint64 + +
+(Optional) +

ReplicaScheduleLimit is the max coexist replica schedules. +Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 64

+
+merge-schedule-limit
+ +uint64 + +
+(Optional) +

MergeScheduleLimit is the max coexist merge schedules. +Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 8

+
+hot-region-schedule-limit
+ +uint64 + +
+(Optional) +

HotRegionScheduleLimit is the max coexist hot region schedules. +Immutable, change should be made through pd-ctl after cluster creation +Optional: Defaults to 4

+
+hot-region-cache-hits-threshold
+ +uint64 + +
+(Optional) +

HotRegionCacheHitThreshold is the cache hits threshold of the hot region. +If the number of times a region hits the hot cache is greater than this +threshold, it is considered a hot region. +Immutable, change should be made through pd-ctl after cluster creation

+
+tolerant-size-ratio
+ +float64 + +
+(Optional) +

TolerantSizeRatio is the ratio of buffer size for balance scheduler. +Immutable, change should be made through pd-ctl after cluster creation. +Imported from v3.1.0

+
+low-space-ratio
+ +float64 + +
+(Optional) +
 high space stage         transition stage           low space stage
+
+

|——————–|—————————–|————————-| +^ ^ ^ ^ +0 HighSpaceRatio * capacity LowSpaceRatio * capacity capacity

+

LowSpaceRatio is the lowest usage ratio of store which regraded as low space. +When in low space, store region score increases to very large and varies inversely with available size. +Immutable, change should be made through pd-ctl after cluster creation

+
+high-space-ratio
+ +float64 + +
+(Optional) +

HighSpaceRatio is the highest usage ratio of store which regraded as high space. +High space means there is a lot of spare capacity, and store region score varies directly with used size. +Immutable, change should be made through pd-ctl after cluster creation

+
+disable-raft-learner,string
+ +bool + +
+(Optional) +

DisableLearner is the option to disable using AddLearnerNode instead of AddNode +Immutable, change should be made through pd-ctl after cluster creation

+
+disable-remove-down-replica,string
+ +bool + +
+(Optional) +

DisableRemoveDownReplica is the option to prevent replica checker from +removing down replicas. +Immutable, change should be made through pd-ctl after cluster creation

+
+disable-replace-offline-replica,string
+ +bool + +
+(Optional) +

DisableReplaceOfflineReplica is the option to prevent replica checker from +repalcing offline replicas. +Immutable, change should be made through pd-ctl after cluster creation

+
+disable-make-up-replica,string
+ +bool + +
+(Optional) +

DisableMakeUpReplica is the option to prevent replica checker from making up +replicas when replica count is less than expected. +Immutable, change should be made through pd-ctl after cluster creation

+
+disable-remove-extra-replica,string
+ +bool + +
+(Optional) +

DisableRemoveExtraReplica is the option to prevent replica checker from +removing extra replicas. +Immutable, change should be made through pd-ctl after cluster creation

+
+disable-location-replacement,string
+ +bool + +
+(Optional) +

DisableLocationReplacement is the option to prevent replica checker from +moving replica to a better location. +Immutable, change should be made through pd-ctl after cluster creation

+
+disable-namespace-relocation,string
+ +bool + +
+(Optional) +

DisableNamespaceRelocation is the option to prevent namespace checker +from moving replica to the target namespace. +Immutable, change should be made through pd-ctl after cluster creation

+
+schedulers-v2
+ + +PDSchedulerConfigs + + +
+(Optional) +

Schedulers support for loding customized schedulers +Immutable, change should be made through pd-ctl after cluster creation

+
+schedulers-payload
+ +map[string]string
(Optional) -

Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 200000

+

Only used to display

-split-merge-interval
+enable-one-way-merge,string
-string +bool
(Optional) -

SplitMergeInterval is the minimum interval time to permit merge after split. -Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 1h

+

EnableOneWayMerge is the option to enable one way merge. This means a Region can only be merged into the next region of it. +Imported from v3.1.0

-patrol-region-interval
+enable-cross-table-merge,string
-string +bool
(Optional) -

PatrolRegionInterval is the interval for scanning region during patrol. -Immutable, change should be made through pd-ctl after cluster creation

+

EnableCrossTableMerge is the option to enable cross table merge. This means two Regions can be merged with different table IDs. +This option only works when key type is “table”. +Imported from v3.1.0

+

PDSchedulerConfig +

+

+

PDSchedulerConfig is customized scheduler configuration

+

+ + + + + + + + + +
FieldDescription
-max-store-down-time
+type
string
(Optional) -

MaxStoreDownTime is the max duration after which -a store will be considered to be down if it hasn’t reported heartbeats. -Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 30m

+

Immutable, change should be made through pd-ctl after cluster creation

-leader-schedule-limit
+args
-uint64 +[]string
(Optional) -

LeaderScheduleLimit is the max coexist leader schedules. -Immutable, change should be made through pd-ctl after cluster creation. -Optional: Defaults to 4. -Imported from v3.1.0

+

Immutable, change should be made through pd-ctl after cluster creation

-region-schedule-limit
+disable
-uint64 +bool
(Optional) -

RegionScheduleLimit is the max coexist region schedules. -Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 2048

+

Immutable, change should be made through pd-ctl after cluster creation

+

PDSchedulerConfigs +([]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDSchedulerConfig alias)

+

+(Appears on: +PDScheduleConfig) +

+

+

+

PDSecurityConfig +

+

+(Appears on: +PDConfig) +

+

+

PDSecurityConfig is the configuration for supporting tls.

+

+ + + + + + + + + +
FieldDescription
-replica-schedule-limit
+cacert-path
-uint64 +string
(Optional) -

ReplicaScheduleLimit is the max coexist replica schedules. -Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 64

+

CAPath is the path of file that contains list of trusted SSL CAs. if set, following four settings shouldn’t be empty

-merge-schedule-limit
+cert-path
-uint64 +string
(Optional) -

MergeScheduleLimit is the max coexist merge schedules. -Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 8

+

CertPath is the path of file that contains X509 certificate in PEM format.

-hot-region-schedule-limit
+key-path
-uint64 +string
(Optional) -

HotRegionScheduleLimit is the max coexist hot region schedules. -Immutable, change should be made through pd-ctl after cluster creation -Optional: Defaults to 4

+

KeyPath is the path of file that contains X509 key in PEM format.

-hot-region-cache-hits-threshold
+cert-allowed-cn
-uint64 +[]string
(Optional) -

HotRegionCacheHitThreshold is the cache hits threshold of the hot region. -If the number of times a region hits the hot cache is greater than this -threshold, it is considered a hot region. -Immutable, change should be made through pd-ctl after cluster creation

+

CertAllowedCN is the Common Name that allowed

+

PDServerConfig +

+

+(Appears on: +PDConfig) +

+

+

PDServerConfig is the configuration for pd server.

+

+ + + + + + + + + + +
FieldDescription
-tolerant-size-ratio
+use-region-storage,string
-float64 +bool
(Optional) -

TolerantSizeRatio is the ratio of buffer size for balance scheduler. -Immutable, change should be made through pd-ctl after cluster creation. -Imported from v3.1.0

+

UseRegionStorage enables the independent region storage.

-low-space-ratio
+metric-storage
-float64 +string
(Optional) -
 high space stage         transition stage           low space stage
-
-

|——————–|—————————–|————————-| -^ ^ ^ ^ -0 HighSpaceRatio * capacity LowSpaceRatio * capacity capacity

-

LowSpaceRatio is the lowest usage ratio of store which regraded as low space. -When in low space, store region score increases to very large and varies inversely with available size. -Immutable, change should be made through pd-ctl after cluster creation

+

MetricStorage is the cluster metric storage. +Currently we use prometheus as metric storage, we may use PD/TiKV as metric storage later. +Imported from v3.1.0

+
+

PDSpec +

+

+(Appears on: +TidbClusterSpec) +

+

+

PDSpec contains details of PD members

+

+ + + + + + + + + + + + + + + + + + + + +
FieldDescription
+ComponentSpec
+ + +ComponentSpec + + +
+

+(Members of ComponentSpec are embedded into this type.) +

-high-space-ratio
+ResourceRequirements
-float64 + +Kubernetes core/v1.ResourceRequirements + + +
+

+(Members of ResourceRequirements are embedded into this type.) +

+
+replicas
+ +int32 + +
+

The desired ready replicas

+
+baseImage
+ +string
(Optional) -

HighSpaceRatio is the highest usage ratio of store which regraded as high space. -High space means there is a lot of spare capacity, and store region score varies directly with used size. -Immutable, change should be made through pd-ctl after cluster creation

+

TODO: remove optional after defaulting introduced +Base image of the component, image tag is now allowed during validation

-disable-raft-learner,string
+service
-bool + +ServiceSpec +
(Optional) -

DisableLearner is the option to disable using AddLearnerNode instead of AddNode -Immutable, change should be made through pd-ctl after cluster creation

+

Service defines a Kubernetes service of PD cluster. +Optional: Defaults to .spec.services in favor of backward compatibility

-disable-remove-down-replica,string
+storageClassName
-bool +string
(Optional) -

DisableRemoveDownReplica is the option to prevent replica checker from -removing down replicas. -Immutable, change should be made through pd-ctl after cluster creation

+

The storageClassName of the persistent volume for PD data storage. +Defaults to Kubernetes default storage class.

-disable-replace-offline-replica,string
+config
-bool + +PDConfig +
(Optional) -

DisableReplaceOfflineReplica is the option to prevent replica checker from -repalcing offline replicas. -Immutable, change should be made through pd-ctl after cluster creation

+

Config is the Configuration of pd-servers

+

PDStatus +

+

+(Appears on: +TidbClusterStatus) +

+

+

PDStatus is PD status

+

+ + + + + + + +
FieldDescription
-disable-make-up-replica,string
+synced
bool
-(Optional) -

DisableMakeUpReplica is the option to prevent replica checker from making up -replicas when replica count is less than expected. -Immutable, change should be made through pd-ctl after cluster creation

-disable-remove-extra-replica,string
+phase
-bool + +MemberPhase +
-(Optional) -

DisableRemoveExtraReplica is the option to prevent replica checker from -removing extra replicas. -Immutable, change should be made through pd-ctl after cluster creation

-disable-location-replacement,string
+statefulSet
-bool + +Kubernetes apps/v1.StatefulSetStatus +
-(Optional) -

DisableLocationReplacement is the option to prevent replica checker from -moving replica to a better location. -Immutable, change should be made through pd-ctl after cluster creation

-disable-namespace-relocation,string
+members
-bool + +map[string]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDMember +
-(Optional) -

DisableNamespaceRelocation is the option to prevent namespace checker -from moving replica to the target namespace. -Immutable, change should be made through pd-ctl after cluster creation

-schedulers-v2
+leader
- -PDSchedulerConfigs + +PDMember
-(Optional) -

Schedulers support for loding customized schedulers -Immutable, change should be made through pd-ctl after cluster creation

-schedulers-payload
+failureMembers
-map[string]string + +map[string]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDFailureMember +
-(Optional) -

Only used to display

-enable-one-way-merge,string
+unjoinedMembers
-bool + +map[string]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.UnjoinedMember +
-(Optional) -

EnableOneWayMerge is the option to enable one way merge. This means a Region can only be merged into the next region of it. -Imported from v3.1.0

-enable-cross-table-merge,string
+image
-bool +string
-(Optional) -

EnableCrossTableMerge is the option to enable cross table merge. This means two Regions can be merged with different table IDs. -This option only works when key type is “table”. -Imported from v3.1.0

-

PDSchedulerConfig +

PDStoreLabel

-

PDSchedulerConfig is customized scheduler configuration

+

PDStoreLabel is the config item of LabelPropertyConfig.

@@ -5016,58 +6144,40 @@ Imported from v3.1.0

- - - -
-type
+key
string
(Optional) -

Immutable, change should be made through pd-ctl after cluster creation

-
-args
- -[]string - -
-(Optional) -

Immutable, change should be made through pd-ctl after cluster creation

-disable
+value
-bool +string
(Optional) -

Immutable, change should be made through pd-ctl after cluster creation

-

PDSchedulerConfigs -([]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDSchedulerConfig alias)

-

-(Appears on: -PDScheduleConfig) -

+

PDStoreLabels +([]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDStoreLabel alias)

-

PDSecurityConfig +

Performance

(Appears on: -PDConfig) +TiDBConfig)

-

PDSecurityConfig is the configuration for supporting tls.

+

Performance is the performance section of the config.

@@ -5079,222 +6189,181 @@ bool - -
-cacert-path
+max-procs
-string +uint
(Optional) -

CAPath is the path of file that contains list of trusted SSL CAs. if set, following four settings shouldn’t be empty

-cert-path
+max-memory
-string +uint64
(Optional) -

CertPath is the path of file that contains X509 certificate in PEM format.

+

Optional: Defaults to 0

-key-path
+stats-lease
string
(Optional) -

KeyPath is the path of file that contains X509 key in PEM format.

+

Optional: Defaults to 3s

-cert-allowed-cn
+stmt-count-limit
-[]string +uint
(Optional) -

CertAllowedCN is the Common Name that allowed

+

Optional: Defaults to 5000

-

PDServerConfig -

-

-(Appears on: -PDConfig) -

-

-

PDServerConfig is the configuration for pd server.

-

- - - - - - - - - -
FieldDescription
-use-region-storage,string
+feedback-probability
-bool +float64
(Optional) -

UseRegionStorage enables the independent region storage.

+

Optional: Defaults to 0.05

-metric-storage
+query-feedback-limit
-string +uint
(Optional) -

MetricStorage is the cluster metric storage. -Currently we use prometheus as metric storage, we may use PD/TiKV as metric storage later. -Imported from v3.1.0

+

Optional: Defaults to 1024

-

PDSpec -

-

-(Appears on: -TidbClusterSpec) -

-

-

PDSpec contains details of PD members

-

- - - - + + - -
FieldDescription +pseudo-estimate-ratio
+ +float64 + +
+(Optional) +

Optional: Defaults to 0.8

+
-ComponentSpec
+force-priority
- -ComponentSpec - +string
-

-(Members of ComponentSpec are embedded into this type.) -

+(Optional) +

Optional: Defaults to NO_PRIORITY

-ResourceRequirements
+bind-info-lease
- -Kubernetes core/v1.ResourceRequirements - +string
-

-(Members of ResourceRequirements are embedded into this type.) -

+(Optional) +

Optional: Defaults to 3s

-replicas
+txn-total-size-limit
-int32 +uint64
-

The desired ready replicas

+(Optional) +

Optional: Defaults to 104857600

-baseImage
+tcp-keep-alive
-string +bool
(Optional) -

TODO: remove optional after defaulting introduced -Base image of the component, image tag is now allowed during validation

+

Optional: Defaults to true

-service
+cross-join
- -ServiceSpec - +bool
(Optional) -

Service defines a Kubernetes service of PD cluster. -Optional: Defaults to .spec.services in favor of backward compatibility

+

Optional: Defaults to true

-storageClassName
+run-auto-analyze
-string +bool
(Optional) -

The storageClassName of the persistent volume for PD data storage. -Defaults to Kubernetes default storage class.

+

Optional: Defaults to true

-config
+txn-entry-count-limit
- -PDConfig - +uint64
(Optional) -

Config is the Configuration of pd-servers

+

Optional: Defaults to 300000

-

PDStatus +

PessimisticTxn

(Appears on: -TidbClusterStatus) +TiDBConfig)

-

PDStatus is PD status

+

PessimisticTxn is the config for pessimistic transaction.

@@ -5306,102 +6375,88 @@ PDConfig - - - - - - - - + +
-synced
+enable
bool
+(Optional) +

Enable must be true for ‘begin lock’ or session variable to start a pessimistic transaction. +Optional: Defaults to true

-phase
- - -MemberPhase - - -
-
-statefulSet
- - -Kubernetes apps/v1.StatefulSetStatus - - -
-
-members
+max-retry-count
- -map[string]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDMember - +uint
+(Optional) +

The max count of retry for a single statement in a pessimistic transaction. +Optional: Defaults to 256

+

PlanCache +

+

+

PlanCache is the PlanCache section of the config.

+

+ + - - + + + +
-leader
- - -PDMember - - -
-FieldDescription
-failureMembers
+enabled
- -map[string]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDFailureMember - +bool
+(Optional)
-unjoinedMembers
+capacity
- -map[string]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.UnjoinedMember - +uint
+(Optional)
-image
+shards
-string +uint
+(Optional)
-

PDStoreLabel +

Plugin

-

PDStoreLabel is the config item of LabelPropertyConfig.

+(Appears on: +TiDBConfig) +

+

+

Plugin is the config for plugin

@@ -5413,7 +6468,7 @@ string
-key
+dir
string @@ -5424,7 +6479,7 @@ string
-value
+load
string @@ -5435,18 +6490,14 @@ string
-

PDStoreLabels -([]github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDStoreLabel alias)

-

-

-

Performance +

PreparedPlanCache

(Appears on: TiDBConfig)

-

Performance is the performance section of the config.

+

PreparedPlanCache is the PreparedPlanCache section of the config.

@@ -5458,181 +6509,181 @@ string - - - - - - - - + +
-max-procs
- -uint - -
-(Optional) -
-max-memory
- -uint64 - -
-(Optional) -

Optional: Defaults to 0

-
-stats-lease
+enabled
-string +bool
(Optional) -

Optional: Defaults to 3s

+

Optional: Defaults to false

-stmt-count-limit
+capacity
uint
(Optional) -

Optional: Defaults to 5000

+

Optional: Defaults to 100

-feedback-probability
+memory-guard-ratio
float64
(Optional) -

Optional: Defaults to 0.05

+

Optional: Defaults to 0.1

+

Profile +

+

+(Appears on: +FlashProfile) +

+

+

Profile is the configuration profiles.

+

+ + + + + + + + + +
FieldDescription
-query-feedback-limit
+readonly
-uint +int32
(Optional) -

Optional: Defaults to 1024

-pseudo-estimate-ratio
+max_memory_usage
-float64 +int64
(Optional) -

Optional: Defaults to 0.8

-force-priority
+use_uncompressed_cache
-string +int32
(Optional) -

Optional: Defaults to NO_PRIORITY

-bind-info-lease
+load_balancing
string
(Optional) -

Optional: Defaults to 3s

+

PrometheusSpec +

+

+(Appears on: +TidbMonitorSpec) +

+

+

PrometheusSpec is the desired state of prometheus

+

+ + - - + + + +
-txn-total-size-limit
- -uint64 - -
-(Optional) -

Optional: Defaults to 104857600

-
FieldDescription
-tcp-keep-alive
+MonitorContainer
-bool + +MonitorContainer +
-(Optional) -

Optional: Defaults to true

+

+(Members of MonitorContainer are embedded into this type.) +

-cross-join
+logLevel
-bool +string
-(Optional) -

Optional: Defaults to true

-run-auto-analyze
+service
-bool + +ServiceSpec +
-(Optional) -

Optional: Defaults to true

-txn-entry-count-limit
+reserveDays
-uint64 +int
(Optional) -

Optional: Defaults to 300000

-

PessimisticTxn +

ProxyConfig

(Appears on: -TiDBConfig) +TiFlashConfig)

-

PessimisticTxn is the config for pessimistic transaction.

+

ProxyConfig is the configuration of TiFlash proxy process. +All the configurations are same with those of TiKV except adding engine-addr in the TiKVServerConfig

@@ -5644,48 +6695,42 @@ uint64 - -
-enable
+log-level
-bool +string
(Optional) -

Enable must be true for ‘begin lock’ or session variable to start a pessimistic transaction. -Optional: Defaults to true

+

Optional: Defaults to info

-max-retry-count
+log-file
-uint +string
(Optional) -

The max count of retry for a single statement in a pessimistic transaction. -Optional: Defaults to 256

-

PlanCache -

-

-

PlanCache is the PlanCache section of the config.

-

- - - - + + - - - -
FieldDescription +log-rotation-timespan
+ +string + +
+(Optional) +

Optional: Defaults to 24h

+
-enabled
+panic-when-unexpected-key-or-data
bool @@ -5696,9 +6741,11 @@ bool
-capacity
+server
-uint + +FlashServerConfig +
@@ -5707,39 +6754,24 @@ uint
-shards
+storage
-uint + +TiKVStorageConfig +
(Optional)
-

Plugin -

-

-(Appears on: -TiDBConfig) -

-

-

Plugin is the config for plugin

-

- - - - - - - - - -
FieldDescription
-dir
+raftstore
-string + +TiKVRaftstoreConfig +
@@ -5748,131 +6780,102 @@ string
-load
+rocksdb
-string + +TiKVDbConfig +
(Optional)
-

PreparedPlanCache -

-

-(Appears on: -TiDBConfig) -

-

-

PreparedPlanCache is the PreparedPlanCache section of the config.

-

- - - - - - - - - -
FieldDescription
-enabled
+coprocessor
-bool + +TiKVCoprocessorConfig +
(Optional) -

Optional: Defaults to false

-capacity
+readpool
-uint + +TiKVReadPoolConfig +
(Optional) -

Optional: Defaults to 100

-memory-guard-ratio
+raftdb
-float64 + +TiKVRaftDBConfig +
(Optional) -

Optional: Defaults to 0.1

-

PrometheusSpec -

-

-(Appears on: -TidbMonitorSpec) -

-

-

PrometheusSpec is the desired state of prometheus

-

- - - - - - - -
FieldDescription
-MonitorContainer
+import
- -MonitorContainer + +TiKVImportConfig
-

-(Members of MonitorContainer are embedded into this type.) -

+(Optional)
-logLevel
+gc
-string + +TiKVGCConfig +
+(Optional)
-service
+pd
- -ServiceSpec + +TiKVPDConfig
+(Optional)
-reserveDays
+security
-int + +TiKVSecurityConfig +
@@ -5926,6 +6929,32 @@ uint
+

ProxyServer +

+

+

ProxyServer is the configuration of TiFlash proxy server.

+

+ + + + + + + + + + + + + +
FieldDescription
+engine-addr
+ +string + +
+(Optional) +

PumpSpec

@@ -6082,6 +7111,38 @@ Kubernetes apps/v1.StatefulSetStatus +

Quota +

+

+(Appears on: +FlashQuota) +

+

+

Quota is the configuration of [quotas.default] section.

+

+ + + + + + + + + + + + + +
FieldDescription
+interval
+ + +Interval + + +
+(Optional) +

ReloaderSpec

@@ -6473,18 +7534,6 @@ string -path
- -string - - - -

Path is the full path where the backup is saved. -The format of the path must be: “/

- - - - bucket
string @@ -6914,39 +7963,86 @@ Optional: Defaults to 100

-max-sql-length
+max-sql-length
+ +uint + + + +(Optional) +

The maximum length of displayed normalized SQL and sample SQL. +Optional: Defaults to 4096

+ + + + +refresh-interval
+ +int + + + +(Optional) +

The refresh interval of statement summary.

+ + + + +history-size
-uint +int (Optional) -

The maximum length of displayed normalized SQL and sample SQL. -Optional: Defaults to 4096

+

The maximum history size of statement summary.

+ + +

StorageClaim +

+

+(Appears on: +TiFlashSpec) +

+

+

StorageClaim contains details of TiFlash storages

+

+ + + + + + + + @@ -8161,6 +9257,177 @@ this field only work in backup/restore process

FieldDescription
-refresh-interval
+resources
-int + +Kubernetes core/v1.ResourceRequirements +
(Optional) -

The refresh interval of statement summary.

+

Resources represents the minimum resources the volume should have. +More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources

-history-size
+storageClassName
-int +string
(Optional) -

The maximum history size of statement summary.

+

Name of the StorageClass required by the claim. +More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1

+

TiFlashConfig +

+

+(Appears on: +TiFlashSpec) +

+

+

TiFlashConfig is the configuration of TiFlash.

+

+ + + + + + + + + + + + + +
FieldDescription
+config
+ + +CommonConfig + + +
+(Optional) +

commonConfig is the Configuration of TiFlash process

+
+

TiFlashSpec +

+

+(Appears on: +TidbClusterSpec) +

+

+

TiFlashSpec contains details of TiFlash members

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+ComponentSpec
+ + +ComponentSpec + + +
+

+(Members of ComponentSpec are embedded into this type.) +

+
+ResourceRequirements
+ + +Kubernetes core/v1.ResourceRequirements + + +
+

+(Members of ResourceRequirements are embedded into this type.) +

+
+serviceAccount
+ +string + +
+

Specify a Service Account for TiFlash

+
+replicas
+ +int32 + +
+

The desired ready replicas

+
+baseImage
+ +string + +
+(Optional) +

Base image of the component, image tag is now allowed during validation

+
+privileged
+ +bool + +
+(Optional) +

Whether create the TiFlash container in privileged mode, it is highly discouraged to enable this in +critical environment. +Optional: defaults to false

+
+maxFailoverCount
+ +int32 + +
+(Optional) +

MaxFailoverCount limit the max replicas could be added in failover, 0 means no failover +Optional: Defaults to 3

+
+storageClaims
+ + +[]StorageClaim + + +
+

The persistent volume claims of the TiFlash data storages. +TiFlash supports multiple disks.

+
+config
+ + +TiFlashConfig + + +
+(Optional) +

Config is the Configuration of TiFlash

+

TiKVBlockCacheConfig

@@ -9035,6 +10302,7 @@ TiKVSecurityConfig

(Appears on: +ProxyConfig, TiKVConfig)

@@ -9244,6 +10512,7 @@ string

(Appears on: +ProxyConfig, TiKVConfig)

@@ -9653,6 +10922,7 @@ Kubernetes meta/v1.Time

(Appears on: +ProxyConfig, TiKVConfig)

@@ -9694,6 +10964,7 @@ string

(Appears on: +ProxyConfig, TiKVConfig)

@@ -9811,6 +11082,7 @@ string

(Appears on: +ProxyConfig, TiKVConfig)

@@ -9885,6 +11157,7 @@ Optional: Defaults to 10

(Appears on: +ProxyConfig, TiKVConfig)

@@ -10169,6 +11442,7 @@ TiKVCfConfig

(Appears on: +ProxyConfig, TiKVConfig)

@@ -10759,6 +12033,7 @@ bool

(Appears on: +ProxyConfig, TiKVConfig)

@@ -10803,6 +12078,7 @@ TiKVStorageReadPoolConfig

(Appears on: +ProxyConfig, TiKVConfig)

@@ -10888,6 +12164,7 @@ string

(Appears on: +FlashServerConfig, TiKVConfig)

@@ -11411,6 +12688,7 @@ string

(Appears on: +ProxyConfig, TiKVConfig)

@@ -12121,6 +13399,20 @@ TiKVSpec +tiflash
+ + +TiFlashSpec + + + + +(Optional) +

TiFlash cluster spec

+ + + + pump
@@ -12975,6 +14267,71 @@ Kubernetes meta/v1.Time +

User +

+

+(Appears on: +FlashUser) +

+

+

User is the configuration of users.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+password
+ +string + +
+(Optional) +
+profile
+ +string + +
+(Optional) +
+quota
+ +string + +
+(Optional) +
+networks
+ + +Networks + + +
+(Optional) +

Generated with gen-crd-api-reference-docs diff --git a/manifests/crd.yaml b/manifests/crd.yaml index 3fc5ece117..e10827ddf4 100644 --- a/manifests/crd.yaml +++ b/manifests/crd.yaml @@ -4414,6 +4414,1035 @@ spec: required: - replicas type: object + tiflash: + description: TiFlashSpec contains details of TiFlash members + properties: + affinity: + description: Affinity is a group of affinity scheduling rules. + properties: + nodeAffinity: + description: Node affinity is a group of node affinity scheduling + rules. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods + to nodes that satisfy the affinity expressions specified + by this field, but it may choose a node that violates + one or more of the expressions. The node that is most + preferred is the one with the greatest sum of weights, + i.e. for each node that meets all of the scheduling requirements + (resource request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements + of this field and adding "weight" to the sum if the node + matches the corresponding matchExpressions; the node(s) + with the highest sum are the most preferred. + items: + description: An empty preferred scheduling term matches + all objects with implicit weight 0 (i.e. it's a no-op). + A null preferred scheduling term matches no objects + (i.e. is also a no-op). + properties: + preference: + description: A null or empty node selector term matches + no objects. The requirements of them are ANDed. + The TopologySelectorTerm type implements a subset + of the NodeSelectorTerm. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement is + a selector that contains values, a key, and + an operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values + array must be empty. If the operator is + Gt or Lt, the values array must have a + single element, which will be interpreted + as an integer. This array is replaced + during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement is + a selector that contains values, a key, and + an operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values + array must be empty. If the operator is + Gt or Lt, the values array must have a + single element, which will be interpreted + as an integer. This array is replaced + during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + weight: + description: Weight associated with matching the corresponding + nodeSelectorTerm, in the range 1-100. + format: int32 + type: integer + required: + - weight + - preference + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: A node selector represents the union of the + results of one or more label queries over a set of nodes; + that is, it represents the OR of the selectors represented + by the node selector terms. + properties: + nodeSelectorTerms: + description: Required. A list of node selector terms. + The terms are ORed. + items: + description: A null or empty node selector term matches + no objects. The requirements of them are ANDed. + The TopologySelectorTerm type implements a subset + of the NodeSelectorTerm. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement is + a selector that contains values, a key, and + an operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values + array must be empty. If the operator is + Gt or Lt, the values array must have a + single element, which will be interpreted + as an integer. This array is replaced + during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement is + a selector that contains values, a key, and + an operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. + If the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values + array must be empty. If the operator is + Gt or Lt, the values array must have a + single element, which will be interpreted + as an integer. This array is replaced + during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + type: array + required: + - nodeSelectorTerms + type: object + type: object + podAffinity: + description: Pod affinity is a group of inter pod affinity scheduling + rules. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods + to nodes that satisfy the affinity expressions specified + by this field, but it may choose a node that violates + one or more of the expressions. The node that is most + preferred is the one with the greatest sum of weights, + i.e. for each node that meets all of the scheduling requirements + (resource request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements + of this field and adding "weight" to the sum if the node + has pods which matches the corresponding podAffinityTerm; + the node(s) with the highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred + node(s) + properties: + podAffinityTerm: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or + not co-located (anti-affinity) with, where co-located + is defined as running on a node whose value of the + label with key matches that of any + node on which a pod of the set of pods is running + properties: + labelSelector: + description: A label selector is a label query + over a set of resources. The result of matchLabels + and matchExpressions are ANDed. An empty label + selector matches all objects. A null label selector + matches no objects. + properties: + matchExpressions: + description: matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies which namespaces + the labelSelector applies to (matches against); + null or empty list means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified + namespaces, where co-located is defined as running + on a node whose value of the label with key + topologyKey matches that of any node on which + any of the selected pods is running. Empty topologyKey + is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - weight + - podAffinityTerm + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this + field are not met at scheduling time, the pod will not + be scheduled onto the node. If the affinity requirements + specified by this field cease to be met at some point + during pod execution (e.g. due to a pod label update), + the system may or may not try to eventually evict the + pod from its node. When there are multiple elements, the + lists of nodes corresponding to each podAffinityTerm are + intersected, i.e. all terms must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not + co-located (anti-affinity) with, where co-located is + defined as running on a node whose value of the label + with key matches that of any node on which + a pod of the set of pods is running + properties: + labelSelector: + description: A label selector is a label query over + a set of resources. The result of matchLabels and + matchExpressions are ANDed. An empty label selector + matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement is + a selector that contains values, a key, and + an operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. This array + is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". + The requirements are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies which namespaces + the labelSelector applies to (matches against); + null or empty list means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey matches + that of any node on which any of the selected pods + is running. Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + description: Pod anti affinity is a group of inter pod anti + affinity scheduling rules. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods + to nodes that satisfy the anti-affinity expressions specified + by this field, but it may choose a node that violates + one or more of the expressions. The node that is most + preferred is the one with the greatest sum of weights, + i.e. for each node that meets all of the scheduling requirements + (resource request, requiredDuringScheduling anti-affinity + expressions, etc.), compute a sum by iterating through + the elements of this field and adding "weight" to the + sum if the node has pods which matches the corresponding + podAffinityTerm; the node(s) with the highest sum are + the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred + node(s) + properties: + podAffinityTerm: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or + not co-located (anti-affinity) with, where co-located + is defined as running on a node whose value of the + label with key matches that of any + node on which a pod of the set of pods is running + properties: + labelSelector: + description: A label selector is a label query + over a set of resources. The result of matchLabels + and matchExpressions are ANDed. An empty label + selector matches all objects. A null label selector + matches no objects. + properties: + matchExpressions: + description: matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies which namespaces + the labelSelector applies to (matches against); + null or empty list means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified + namespaces, where co-located is defined as running + on a node whose value of the label with key + topologyKey matches that of any node on which + any of the selected pods is running. Empty topologyKey + is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - weight + - podAffinityTerm + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the anti-affinity requirements specified + by this field are not met at scheduling time, the pod + will not be scheduled onto the node. If the anti-affinity + requirements specified by this field cease to be met at + some point during pod execution (e.g. due to a pod label + update), the system may or may not try to eventually evict + the pod from its node. When there are multiple elements, + the lists of nodes corresponding to each podAffinityTerm + are intersected, i.e. all terms must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not + co-located (anti-affinity) with, where co-located is + defined as running on a node whose value of the label + with key matches that of any node on which + a pod of the set of pods is running + properties: + labelSelector: + description: A label selector is a label query over + a set of resources. The result of matchLabels and + matchExpressions are ANDed. An empty label selector + matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement is + a selector that contains values, a key, and + an operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. This array + is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". + The requirements are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies which namespaces + the labelSelector applies to (matches against); + null or empty list means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey matches + that of any node on which any of the selected pods + is running. Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + type: object + annotations: + description: 'Annotations of the component. Merged into the cluster-level + annotations if non-empty Optional: Defaults to cluster-level setting' + type: object + baseImage: + description: Base image of the component, image tag is now allowed + during validation + type: string + config: + description: TiFlashConfig is the configuration of TiFlash. + properties: + config: + description: CommonConfig is the configuration of TiFlash process. + properties: + flash: + description: Flash is the configuration of [flash] section. + properties: + compact_log_min_period: + description: 'Optional: Defaults to 200' + format: int32 + type: integer + flash_cluster: + description: FlashCluster is the configuration of [flash.flash_cluster] + section. + properties: + master_ttl: + description: 'Optional: Defaults to 60' + format: int32 + type: integer + refresh_interval: + description: 'Optional: Defaults to 20' + format: int32 + type: integer + update_rule_interval: + description: 'Optional: Defaults to 10' + format: int32 + type: integer + type: object + overlap_threshold: + description: 'Optional: Defaults to 0.6' + format: double + type: number + type: object + loger: + description: FlashLogger is the configuration of [logger] + section. + properties: + count: + description: 'Optional: Defaults to 10' + format: int32 + type: integer + level: + description: 'Optional: Defaults to information' + type: string + size: + description: 'Optional: Defaults to 100M' + type: string + type: object + mark_cache_size: + description: 'Optional: Defaults to 5368709120' + format: int64 + type: integer + minmax_index_cache_size: + description: 'Optional: Defaults to 5368709120' + format: int64 + type: integer + path_realtime_mode: + description: 'Optional: Defaults to false' + type: boolean + type: object + type: object + configUpdateStrategy: + description: 'ConfigUpdateStrategy of the component. Override the + cluster-level updateStrategy if present Optional: Defaults to + cluster-level setting' + type: string + env: + description: List of environment variables to set in the container, + like v1.Container.Env. Note that following env names cannot be + used and may be overrided by tidb-operator built envs. - NAMESPACE + - TZ - SERVICE_NAME - PEER_SERVICE_NAME - HEADLESS_SERVICE_NAME + - SET_NAME - HOSTNAME - CLUSTER_NAME - POD_NAME - BINLOG_ENABLED + - SLOW_LOG_FILE + items: + description: EnvVar represents an environment variable present + in a Container. + properties: + name: + description: Name of the environment variable. Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded + using the previous defined environment variables in the + container and any service environment variables. If a variable + cannot be resolved, the reference in the input string will + be unchanged. The $(VAR_NAME) syntax can be escaped with + a double $$, ie: $$(VAR_NAME). Escaped references will never + be expanded, regardless of whether the variable exists or + not. Defaults to "".' + type: string + valueFrom: + description: EnvVarSource represents a source for the value + of an EnvVar. + properties: + configMapKeyRef: + description: Selects a key from a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + optional: + description: Specify whether the ConfigMap or its + key must be defined + type: boolean + required: + - key + type: object + fieldRef: + description: ObjectFieldSelector selects an APIVersioned + field of an object. + properties: + apiVersion: + description: Version of the schema the FieldPath is + written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified + API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: ResourceFieldSelector represents container + resources (cpu, memory) and their output format + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: {} + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + secretKeyRef: + description: SecretKeySelector selects a key of a Secret. + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + type: object + required: + - name + type: object + type: array + hostNetwork: + description: 'Whether Hostnetwork of the component is enabled. Override + the cluster-level setting if present Optional: Defaults to cluster-level + setting' + type: boolean + imagePullPolicy: + description: 'ImagePullPolicy of the component. Override the cluster-level + imagePullPolicy if present Optional: Defaults to cluster-level + setting' + type: string + limits: + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + maxFailoverCount: + description: 'MaxFailoverCount limit the max replicas could be added + in failover, 0 means no failover Optional: Defaults to 3' + format: int32 + type: integer + nodeSelector: + description: 'NodeSelector of the component. Merged into the cluster-level + nodeSelector if non-empty Optional: Defaults to cluster-level + setting' + type: object + podSecurityContext: + description: PodSecurityContext holds pod-level security attributes + and common container settings. Some fields are also present in + container.securityContext. Field values of container.securityContext + take precedence over field values of PodSecurityContext. + properties: + fsGroup: + description: |- + A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: + + 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- + + If unset, the Kubelet will not modify the ownership and permissions of any volume. + format: int64 + type: integer + runAsGroup: + description: The GID to run the entrypoint of the container + process. Uses runtime default if unset. May also be set in + SecurityContext. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence for + that container. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail to + start the container if it does. If unset or false, no such + validation will be performed. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of the container + process. Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. + format: int64 + type: integer + seLinuxOptions: + description: SELinuxOptions are the labels to be applied to + the container + properties: + level: + description: Level is SELinux level label that applies to + the container. + type: string + role: + description: Role is a SELinux role label that applies to + the container. + type: string + type: + description: Type is a SELinux type label that applies to + the container. + type: string + user: + description: User is a SELinux user label that applies to + the container. + type: string + type: object + supplementalGroups: + description: A list of groups applied to the first process run + in each container, in addition to the container's primary + GID. If unspecified, no groups will be added to any container. + items: + format: int64 + type: integer + type: array + sysctls: + description: Sysctls hold a list of namespaced sysctls used + for the pod. Pods with unsupported sysctls (by the container + runtime) might fail to launch. + items: + description: Sysctl defines a kernel parameter to be set + properties: + name: + description: Name of a property to set + type: string + value: + description: Value of a property to set + type: string + required: + - name + - value + type: object + type: array + windowsOptions: + description: WindowsSecurityContextOptions contain Windows-specific + options and credentials. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where the GMSA admission + webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential spec named + by the GMSACredentialSpecName field. This field is alpha-level + and is only honored by servers that enable the WindowsGMSA + feature flag. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the name of the GMSA + credential spec to use. This field is alpha-level and + is only honored by servers that enable the WindowsGMSA + feature flag. + type: string + runAsUserName: + description: The UserName in Windows to run the entrypoint + of the container process. Defaults to the user specified + in image metadata if unspecified. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. + This field is alpha-level and it is only honored by servers + that enable the WindowsRunAsUserName feature flag. + type: string + type: object + type: object + priorityClassName: + description: 'PriorityClassName of the component. Override the cluster-level + one if present Optional: Defaults to cluster-level setting' + type: string + privileged: + description: 'Whether create the TiFlash container in privileged + mode, it is highly discouraged to enable this in critical environment. + Optional: defaults to false' + type: boolean + replicas: + description: The desired ready replicas + format: int32 + type: integer + requests: + description: 'Requests describes the minimum amount of compute resources + required. If Requests is omitted for a container, it defaults + to Limits if that is explicitly specified, otherwise to an implementation-defined + value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + schedulerName: + description: 'SchedulerName of the component. Override the cluster-level + one if present Optional: Defaults to cluster-level setting' + type: string + serviceAccount: + description: Specify a Service Account for TiFlash + type: string + storageClaims: + description: The persistent volume claims of the TiFlash data storages. + TiFlash supports multiple disks. + items: + description: StorageClaim contains details of TiFlash storages + properties: + resources: + description: ResourceRequirements describes the compute resource + requirements. + properties: + limits: + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + description: 'Requests describes the minimum amount of + compute resources required. If Requests is omitted for + a container, it defaults to Limits if that is explicitly + specified, otherwise to an implementation-defined value. + More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + storageClassName: + description: 'Name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + type: string + type: object + type: array + tolerations: + description: 'Tolerations of the component. Override the cluster-level + tolerations if non-empty Optional: Defaults to cluster-level setting' + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + version: + description: 'Version of the component. Override the cluster-level + version if non-empty Optional: Defaults to cluster-level setting' + type: string + required: + - replicas + - storageClaims + type: object tikv: description: TiKVSpec contains details of TiKV members properties: diff --git a/pkg/apis/pingcap/v1alpha1/defaulting/tidbcluster.go b/pkg/apis/pingcap/v1alpha1/defaulting/tidbcluster.go index b7e6ace341..772de9d63e 100644 --- a/pkg/apis/pingcap/v1alpha1/defaulting/tidbcluster.go +++ b/pkg/apis/pingcap/v1alpha1/defaulting/tidbcluster.go @@ -20,10 +20,11 @@ import ( ) const ( - defaultTiDBImage = "pingcap/tidb" - defaultTiKVImage = "pingcap/tikv" - defaultPDImage = "pingcap/pd" - defaultBinlogImage = "pingcap/tidb-binlog" + defaultTiDBImage = "pingcap/tidb" + defaultTiKVImage = "pingcap/tikv" + defaultPDImage = "pingcap/pd" + defaultBinlogImage = "pingcap/tidb-binlog" + defaultTiFlashImage = "pingcap/tiflash" ) var ( @@ -38,6 +39,9 @@ func SetTidbClusterDefault(tc *v1alpha1.TidbCluster) { if tc.Spec.Pump != nil { setPumpSpecDefault(tc) } + if tc.Spec.TiFlash != nil { + setTiFlashSpecDefault(tc) + } } // setTidbClusterSpecDefault is only managed the property under Spec @@ -112,3 +116,11 @@ func setPumpSpecDefault(tc *v1alpha1.TidbCluster) { } } } + +func setTiFlashSpecDefault(tc *v1alpha1.TidbCluster) { + if len(tc.Spec.Version) > 0 || tc.Spec.TiFlash.Version != nil { + if tc.Spec.TiFlash.BaseImage == "" { + tc.Spec.TiFlash.BaseImage = defaultTiFlashImage + } + } +} diff --git a/pkg/apis/pingcap/v1alpha1/openapi_generated.go b/pkg/apis/pingcap/v1alpha1/openapi_generated.go index b73f574aeb..8036a7a9c8 100644 --- a/pkg/apis/pingcap/v1alpha1/openapi_generated.go +++ b/pkg/apis/pingcap/v1alpha1/openapi_generated.go @@ -36,9 +36,13 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.BackupSpec": schema_pkg_apis_pingcap_v1alpha1_BackupSpec(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.BasicAutoScalerSpec": schema_pkg_apis_pingcap_v1alpha1_BasicAutoScalerSpec(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.Binlog": schema_pkg_apis_pingcap_v1alpha1_Binlog(ref), + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.CommonConfig": schema_pkg_apis_pingcap_v1alpha1_CommonConfig(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.ComponentSpec": schema_pkg_apis_pingcap_v1alpha1_ComponentSpec(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.Experimental": schema_pkg_apis_pingcap_v1alpha1_Experimental(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.FileLogConfig": schema_pkg_apis_pingcap_v1alpha1_FileLogConfig(ref), + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.Flash": schema_pkg_apis_pingcap_v1alpha1_Flash(ref), + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.FlashCluster": schema_pkg_apis_pingcap_v1alpha1_FlashCluster(ref), + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.FlashLogger": schema_pkg_apis_pingcap_v1alpha1_FlashLogger(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.GcsStorageProvider": schema_pkg_apis_pingcap_v1alpha1_GcsStorageProvider(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.HelperSpec": schema_pkg_apis_pingcap_v1alpha1_HelperSpec(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.IsolationRead": schema_pkg_apis_pingcap_v1alpha1_IsolationRead(ref), @@ -73,12 +77,15 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.ServiceSpec": schema_pkg_apis_pingcap_v1alpha1_ServiceSpec(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.Status": schema_pkg_apis_pingcap_v1alpha1_Status(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.StmtSummary": schema_pkg_apis_pingcap_v1alpha1_StmtSummary(ref), + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.StorageClaim": schema_pkg_apis_pingcap_v1alpha1_StorageClaim(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.StorageProvider": schema_pkg_apis_pingcap_v1alpha1_StorageProvider(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiDBAccessConfig": schema_pkg_apis_pingcap_v1alpha1_TiDBAccessConfig(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiDBConfig": schema_pkg_apis_pingcap_v1alpha1_TiDBConfig(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiDBServiceSpec": schema_pkg_apis_pingcap_v1alpha1_TiDBServiceSpec(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiDBSlowLogTailerSpec": schema_pkg_apis_pingcap_v1alpha1_TiDBSlowLogTailerSpec(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiDBSpec": schema_pkg_apis_pingcap_v1alpha1_TiDBSpec(ref), + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiFlashConfig": schema_pkg_apis_pingcap_v1alpha1_TiFlashConfig(ref), + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiFlashSpec": schema_pkg_apis_pingcap_v1alpha1_TiFlashSpec(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiKVBlockCacheConfig": schema_pkg_apis_pingcap_v1alpha1_TiKVBlockCacheConfig(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiKVCfConfig": schema_pkg_apis_pingcap_v1alpha1_TiKVCfConfig(ref), "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiKVClient": schema_pkg_apis_pingcap_v1alpha1_TiKVClient(ref), @@ -915,6 +922,52 @@ func schema_pkg_apis_pingcap_v1alpha1_Binlog(ref common.ReferenceCallback) commo } } +func schema_pkg_apis_pingcap_v1alpha1_CommonConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CommonConfig is the configuration of TiFlash process.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "path_realtime_mode": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to false", + Type: []string{"boolean"}, + Format: "", + }, + }, + "mark_cache_size": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to 5368709120", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "minmax_index_cache_size": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to 5368709120", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "flash": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.Flash"), + }, + }, + "loger": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.FlashLogger"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.Flash", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.FlashLogger"}, + } +} + func schema_pkg_apis_pingcap_v1alpha1_ComponentSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -1107,6 +1160,108 @@ func schema_pkg_apis_pingcap_v1alpha1_FileLogConfig(ref common.ReferenceCallback } } +func schema_pkg_apis_pingcap_v1alpha1_Flash(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Flash is the configuration of [flash] section.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "overlap_threshold": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to 0.6", + Type: []string{"number"}, + Format: "double", + }, + }, + "compact_log_min_period": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to 200", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "flash_cluster": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.FlashCluster"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.FlashCluster"}, + } +} + +func schema_pkg_apis_pingcap_v1alpha1_FlashCluster(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FlashCluster is the configuration of [flash.flash_cluster] section.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "refresh_interval": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to 20", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "update_rule_interval": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to 10", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "master_ttl": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to 60", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_pingcap_v1alpha1_FlashLogger(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FlashLogger is the configuration of [logger] section.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "size": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to 100M", + Type: []string{"string"}, + Format: "", + }, + }, + "level": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to information", + Type: []string{"string"}, + Format: "", + }, + }, + "count": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Defaults to 10", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + func schema_pkg_apis_pingcap_v1alpha1_GcsStorageProvider(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -3303,6 +3458,34 @@ func schema_pkg_apis_pingcap_v1alpha1_StmtSummary(ref common.ReferenceCallback) } } +func schema_pkg_apis_pingcap_v1alpha1_StorageClaim(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StorageClaim contains details of TiFlash storages", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "resources": { + SchemaProps: spec.SchemaProps{ + Description: "Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources", + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + "storageClassName": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ResourceRequirements"}, + } +} + func schema_pkg_apis_pingcap_v1alpha1_StorageProvider(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -3929,6 +4112,235 @@ func schema_pkg_apis_pingcap_v1alpha1_TiDBSpec(ref common.ReferenceCallback) com } } +func schema_pkg_apis_pingcap_v1alpha1_TiFlashConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TiFlashConfig is the configuration of TiFlash.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "config": { + SchemaProps: spec.SchemaProps{ + Description: "commonConfig is the Configuration of TiFlash process", + Ref: ref("github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.CommonConfig"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.CommonConfig"}, + } +} + +func schema_pkg_apis_pingcap_v1alpha1_TiFlashSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TiFlashSpec contains details of TiFlash members", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version of the component. Override the cluster-level version if non-empty Optional: Defaults to cluster-level setting", + Type: []string{"string"}, + Format: "", + }, + }, + "imagePullPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "ImagePullPolicy of the component. Override the cluster-level imagePullPolicy if present Optional: Defaults to cluster-level setting", + Type: []string{"string"}, + Format: "", + }, + }, + "hostNetwork": { + SchemaProps: spec.SchemaProps{ + Description: "Whether Hostnetwork of the component is enabled. Override the cluster-level setting if present Optional: Defaults to cluster-level setting", + Type: []string{"boolean"}, + Format: "", + }, + }, + "affinity": { + SchemaProps: spec.SchemaProps{ + Description: "Affinity of the component. Override the cluster-level one if present Optional: Defaults to cluster-level setting", + Ref: ref("k8s.io/api/core/v1.Affinity"), + }, + }, + "priorityClassName": { + SchemaProps: spec.SchemaProps{ + Description: "PriorityClassName of the component. Override the cluster-level one if present Optional: Defaults to cluster-level setting", + Type: []string{"string"}, + Format: "", + }, + }, + "schedulerName": { + SchemaProps: spec.SchemaProps{ + Description: "SchedulerName of the component. Override the cluster-level one if present Optional: Defaults to cluster-level setting", + Type: []string{"string"}, + Format: "", + }, + }, + "nodeSelector": { + SchemaProps: spec.SchemaProps{ + Description: "NodeSelector of the component. Merged into the cluster-level nodeSelector if non-empty Optional: Defaults to cluster-level setting", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "annotations": { + SchemaProps: spec.SchemaProps{ + Description: "Annotations of the component. Merged into the cluster-level annotations if non-empty Optional: Defaults to cluster-level setting", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "tolerations": { + SchemaProps: spec.SchemaProps{ + Description: "Tolerations of the component. Override the cluster-level tolerations if non-empty Optional: Defaults to cluster-level setting", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.Toleration"), + }, + }, + }, + }, + }, + "podSecurityContext": { + SchemaProps: spec.SchemaProps{ + Description: "PodSecurityContext of the component", + Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), + }, + }, + "configUpdateStrategy": { + SchemaProps: spec.SchemaProps{ + Description: "ConfigUpdateStrategy of the component. Override the cluster-level updateStrategy if present Optional: Defaults to cluster-level setting", + Type: []string{"string"}, + Format: "", + }, + }, + "env": { + SchemaProps: spec.SchemaProps{ + Description: "List of environment variables to set in the container, like v1.Container.Env. Note that following env names cannot be used and may be overrided by tidb-operator built envs. - NAMESPACE - TZ - SERVICE_NAME - PEER_SERVICE_NAME - HEADLESS_SERVICE_NAME - SET_NAME - HOSTNAME - CLUSTER_NAME - POD_NAME - BINLOG_ENABLED - SLOW_LOG_FILE", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.EnvVar"), + }, + }, + }, + }, + }, + "limits": { + SchemaProps: spec.SchemaProps{ + Description: "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + }, + }, + "requests": { + SchemaProps: spec.SchemaProps{ + Description: "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + }, + }, + "serviceAccount": { + SchemaProps: spec.SchemaProps{ + Description: "Specify a Service Account for TiFlash", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "The desired ready replicas", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "baseImage": { + SchemaProps: spec.SchemaProps{ + Description: "Base image of the component, image tag is now allowed during validation", + Type: []string{"string"}, + Format: "", + }, + }, + "privileged": { + SchemaProps: spec.SchemaProps{ + Description: "Whether create the TiFlash container in privileged mode, it is highly discouraged to enable this in critical environment. Optional: defaults to false", + Type: []string{"boolean"}, + Format: "", + }, + }, + "maxFailoverCount": { + SchemaProps: spec.SchemaProps{ + Description: "MaxFailoverCount limit the max replicas could be added in failover, 0 means no failover Optional: Defaults to 3", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "storageClaims": { + SchemaProps: spec.SchemaProps{ + Description: "The persistent volume claims of the TiFlash data storages. TiFlash supports multiple disks.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.StorageClaim"), + }, + }, + }, + }, + }, + "config": { + SchemaProps: spec.SchemaProps{ + Description: "Config is the Configuration of TiFlash", + Ref: ref("github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiFlashConfig"), + }, + }, + }, + Required: []string{"replicas", "storageClaims"}, + }, + }, + Dependencies: []string{ + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.StorageClaim", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiFlashConfig", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + } +} + func schema_pkg_apis_pingcap_v1alpha1_TiKVBlockCacheConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -6335,6 +6747,12 @@ func schema_pkg_apis_pingcap_v1alpha1_TidbClusterSpec(ref common.ReferenceCallba Ref: ref("github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiKVSpec"), }, }, + "tiflash": { + SchemaProps: spec.SchemaProps{ + Description: "TiFlash cluster spec", + Ref: ref("github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiFlashSpec"), + }, + }, "pump": { SchemaProps: spec.SchemaProps{ Description: "Pump cluster spec", @@ -6477,7 +6895,7 @@ func schema_pkg_apis_pingcap_v1alpha1_TidbClusterSpec(ref common.ReferenceCallba }, }, Dependencies: []string{ - "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.HelperSpec", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDSpec", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PumpSpec", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TLSCluster", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiDBSpec", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiKVSpec", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.Toleration"}, + "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.HelperSpec", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PDSpec", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.PumpSpec", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TLSCluster", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiDBSpec", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiFlashSpec", "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1.TiKVSpec", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.Toleration"}, } } diff --git a/pkg/apis/pingcap/v1alpha1/tiflash_config.go b/pkg/apis/pingcap/v1alpha1/tiflash_config.go new file mode 100644 index 0000000000..8aa70999dc --- /dev/null +++ b/pkg/apis/pingcap/v1alpha1/tiflash_config.go @@ -0,0 +1,359 @@ +// Copyright 2019 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1alpha1 + +// Port from TiFlash configurations till 2020/04/02 + +// TiFlashConfig is the configuration of TiFlash. +// +k8s:openapi-gen=true +type TiFlashConfig struct { + // commonConfig is the Configuration of TiFlash process + // +optional + CommonConfig *CommonConfig `json:"config,omitempty"` + + // proxyConfig is the Configuration of proxy process + // +optional + // +k8s:openapi-gen=false + ProxyConfig *ProxyConfig `json:"proxy,omitempty"` +} + +// FlashServerConfig is the configuration of Proxy server. +// +k8s:openapi-gen=false +type FlashServerConfig struct { + // +optional + EngineAddr string `json:"engine-addr,omitempty" toml:"engine-addr,omitempty"` + TiKVServerConfig `json:",inline"` +} + +// ProxyConfig is the configuration of TiFlash proxy process. +// All the configurations are same with those of TiKV except adding `engine-addr` in the TiKVServerConfig +// +k8s:openapi-gen=false +type ProxyConfig struct { + // Optional: Defaults to info + // +optional + LogLevel string `json:"log-level,omitempty" toml:"log-level,omitempty"` + // +optional + LogFile string `json:"log-file,omitempty" toml:"log-file,omitempty"` + // Optional: Defaults to 24h + // +optional + LogRotationTimespan string `json:"log-rotation-timespan,omitempty" toml:"log-rotation-timespan,omitempty"` + // +optional + PanicWhenUnexpectedKeyOrData *bool `json:"panic-when-unexpected-key-or-data,omitempty" toml:"panic-when-unexpected-key-or-data,omitempty"` + // +optional + Server *FlashServerConfig `json:"server,omitempty" toml:"server,omitempty"` + // +optional + Storage *TiKVStorageConfig `json:"storage,omitempty" toml:"storage,omitempty"` + // +optional + Raftstore *TiKVRaftstoreConfig `json:"raftstore,omitempty" toml:"raftstore,omitempty"` + // +optional + Rocksdb *TiKVDbConfig `json:"rocksdb,omitempty" toml:"rocksdb,omitempty"` + // +optional + Coprocessor *TiKVCoprocessorConfig `json:"coprocessor,omitempty" toml:"coprocessor,omitempty"` + // +optional + ReadPool *TiKVReadPoolConfig `json:"readpool,omitempty" toml:"readpool,omitempty"` + // +optional + RaftDB *TiKVRaftDBConfig `json:"raftdb,omitempty" toml:"raftdb,omitempty"` + // +optional + Import *TiKVImportConfig `json:"import,omitempty" toml:"import,omitempty"` + // +optional + GC *TiKVGCConfig `json:"gc,omitempty" toml:"gc,omitempty"` + // +optional + PD *TiKVPDConfig `json:"pd,omitempty" toml:"pd,omitempty"` + // +optional + Security *TiKVSecurityConfig `json:"security,omitempty" toml:"security,omitempty"` +} + +// ProxyServer is the configuration of TiFlash proxy server. +// +k8s:openapi-gen=false +type ProxyServer struct { + // +optional + EngineAddr string `json:"engine-addr,omitempty" toml:"engine-addr,omitempty"` +} + +// CommonConfig is the configuration of TiFlash process. +// +k8s:openapi-gen=true +type CommonConfig struct { + // Optional: Defaults to "/data/tmp" + // +optional + // +k8s:openapi-gen=false + TmpPath string `json:"tmp_path,omitempty" toml:"tmp_path,omitempty"` + + // Optional: Defaults to "TiFlash" + // +optional + // +k8s:openapi-gen=false + DisplayName string `json:"display_name,omitempty" toml:"display_name,omitempty"` + + // Optional: Defaults to "default" + // +optional + // +k8s:openapi-gen=false + DefaultProfile string `json:"default_profile,omitempty" toml:"default_profile,omitempty"` + + // Optional: Defaults to "/data/db" + // +optional + // +k8s:openapi-gen=false + Path string `json:"path,omitempty" toml:"path,omitempty"` + + // Optional: Defaults to false + // +optional + PathRealtimeMode *bool `json:"path_realtime_mode,omitempty" toml:"path_realtime_mode,omitempty"` + + // Optional: Defaults to 5368709120 + // +optional + MarkCacheSize *int64 `json:"mark_cache_size,omitempty" toml:"mark_cache_size,omitempty"` + + // Optional: Defaults to 5368709120 + // +optional + MinmaxIndexCacheSize *int64 `json:"minmax_index_cache_size,omitempty" toml:"minmax_index_cache_size,omitempty"` + + // Optional: Defaults to "0.0.0.0" + // +optional + // +k8s:openapi-gen=false + ListenHost string `json:"listen_host,omitempty" toml:"listen_host,omitempty"` + + // Optional: Defaults to 9000 + // +optional + // +k8s:openapi-gen=false + TCPPort *int32 `json:"tcp_port,omitempty" toml:"tcp_port,omitempty"` + // Optional: Defaults to 8123 + // +optional + // +k8s:openapi-gen=false + HTTPPort *int32 `json:"http_port,omitempty" toml:"http_port,omitempty"` + // Optional: Defaults to 9009 + // +optional + // +k8s:openapi-gen=false + InternalServerHTTPPort *int32 `json:"interserver_http_port,omitempty" toml:"interserver_http_port,omitempty"` + // +optional + Flash *Flash `json:"flash,omitempty" toml:"flash,omitempty"` + // +optional + FlashLogger *FlashLogger `json:"loger,omitempty" toml:"logger,omitempty"` + // +optional + // +k8s:openapi-gen=false + FlashApplication *FlashApplication `json:"application,omitempty" toml:"application,omitempty"` + // +optional + // +k8s:openapi-gen=false + FlashRaft *FlashRaft `json:"raft,omitempty" toml:"raft,omitempty"` + // +optional + // +k8s:openapi-gen=false + FlashStatus *FlashStatus `json:"status,omitempty" toml:"status,omitempty"` + // +optional + // +k8s:openapi-gen=false + FlashQuota *FlashQuota `json:"quotas,omitempty" toml:"quotas,omitempty"` + // +optional + // +k8s:openapi-gen=false + FlashUser *FlashUser `json:"users,omitempty" toml:"users,omitempty"` + // +optional + // +k8s:openapi-gen=false + FlashProfile *FlashProfile `json:"profiles,omitempty" toml:"profiles,omitempty"` +} + +// FlashProfile is the configuration of [profiles] section. +// +k8s:openapi-gen=false +type FlashProfile struct { + // +optional + Readonly *Profile `json:"readonly,omitempty" toml:"readonly,omitempty"` + // +optional + Default *Profile `json:"default,omitempty" toml:"default,omitempty"` +} + +// Profile is the configuration profiles. +// +k8s:openapi-gen=false +type Profile struct { + // +optional + Readonly *int32 `json:"readonly,omitempty" toml:"readonly,omitempty"` + // +optional + MaxMemoryUsage *int64 `json:"max_memory_usage,omitempty" toml:"max_memory_usage,omitempty"` + // +optional + UseUncompressedCache *int32 `json:"use_uncompressed_cache,omitempty" toml:"use_uncompressed_cache,omitempty"` + // +optional + LoadBalancing *string `json:"load_balancing,omitempty" toml:"load_balancing,omitempty"` +} + +// FlashUser is the configuration of [users] section. +// +k8s:openapi-gen=false +type FlashUser struct { + // +optional + Readonly *User `json:"readonly,omitempty" toml:"readonly,omitempty"` + Default *User `json:"default,omitempty" toml:"default,omitempty"` +} + +// User is the configuration of users. +// +k8s:openapi-gen=false +type User struct { + // +optional + Password string `json:"password,omitempty" toml:"password,omitempty"` + // +optional + Profile string `json:"profile,omitempty" toml:"profile,omitempty"` + // +optional + Quota string `json:"quota,omitempty" toml:"quota,omitempty"` + // +optional + Networks *Networks `json:"networks,omitempty" toml:"networks,omitempty"` +} + +// Networks is the configuration of [users.readonly.networks] section. +// +k8s:openapi-gen=false +type Networks struct { + // +optional + IP string `json:"ip,omitempty" toml:"ip,omitempty"` +} + +// FlashQuota is the configuration of [quotas] section. +// +k8s:openapi-gen=false +type FlashQuota struct { + // +optional + Default *Quota `json:"default,omitempty" toml:"default,omitempty"` +} + +// Quota is the configuration of [quotas.default] section. +// +k8s:openapi-gen=false +type Quota struct { + // +optional + Interval *Interval `json:"interval,omitempty" toml:"interval,omitempty"` +} + +// Interval is the configuration of [quotas.default.interval] section. +// +k8s:openapi-gen=false +type Interval struct { + // Optional: Defaults to 3600 + // +optional + Duration *int32 `json:"duration,omitempty" toml:"duration,omitempty"` + // Optional: Defaults to 0 + // +optional + Queries *int32 `json:"queries,omitempty" toml:"queries,omitempty"` + // Optional: Defaults to 0 + // +optional + Errors *int32 `json:"errors,omitempty" toml:"errors,omitempty"` + // Optional: Defaults to 0 + // +optional + ResultRows *int32 `json:"result_rows,omitempty" toml:"result_rows,omitempty"` + // Optional: Defaults to 0 + // +optional + ReadRows *int32 `json:"read_rows,omitempty" toml:"read_rows,omitempty"` + // Optional: Defaults to 0 + // +optional + ExecutionTime *int32 `json:"execution_time,omitempty" toml:"execution_time,omitempty"` +} + +// FlashStatus is the configuration of [status] section. +// +k8s:openapi-gen=false +type FlashStatus struct { + // Optional: Defaults to 8234 + // +optional + MetricsPort *int32 `json:"metrics_port,omitempty" toml:"metrics_port,omitempty"` +} + +// FlashRaft is the configuration of [raft] section. +// +k8s:openapi-gen=false +type FlashRaft struct { + // +optional + PDAddr string `json:"pd_addr,omitempty" toml:"pd_addr,omitempty"` + // Optional: Defaults to /data/kvstore + // +optional + KVStorePath string `json:"kvstore_path,omitempty" toml:"kvstore_path,omitempty"` + // Optional: Defaults to dt + // +optional + StorageEngine string `json:"storage_engine,omitempty" toml:"storage_engine,omitempty"` +} + +// FlashApplication is the configuration of [application] section. +// +k8s:openapi-gen=false +type FlashApplication struct { + // Optional: Defaults to true + // +optional + RunAsDaemon *bool `json:"runAsDaemon,omitempty" toml:"runAsDaemon,omitempty"` +} + +// FlashLogger is the configuration of [logger] section. +// +k8s:openapi-gen=true +type FlashLogger struct { + // Optional: Defaults to /data/logs/error.log + // +optional + // +k8s:openapi-gen=false + Errorlog string `json:"errorlog,omitempty" toml:"errorlog,omitempty"` + // Optional: Defaults to 100M + // +optional + Size string `json:"size,omitempty" toml:"size,omitempty"` + // Optional: Defaults to /data/logs/server.log + // +optional + // +k8s:openapi-gen=false + ServerLog string `json:"log,omitempty" toml:"log,omitempty"` + // Optional: Defaults to information + // +optional + Level string `json:"level,omitempty" toml:"level,omitempty"` + // Optional: Defaults to 10 + // +optional + Count *int32 `json:"count,omitempty" toml:"count,omitempty"` +} + +// Flash is the configuration of [flash] section. +// +k8s:openapi-gen=true +type Flash struct { + // +optional + // +k8s:openapi-gen=false + TiDBStatusAddr string `json:"tidb_status_addr,omitempty" toml:"tidb_status_addr,omitempty"` + // +optional + // +k8s:openapi-gen=false + ServiceAddr string `json:"service_addr,omitempty" toml:"service_addr,omitempty"` + // Optional: Defaults to 0.6 + // +optional + OverlapThreshold *float64 `json:"overlap_threshold,omitempty" toml:"overlap_threshold,omitempty"` + // Optional: Defaults to 200 + // +optional + CompactLogMinPeriod *int32 `json:"compact_log_min_period,omitempty" toml:"compact_log_min_period,omitempty"` + // +optional + FlashCluster *FlashCluster `json:"flash_cluster,omitempty" toml:"flash_cluster,omitempty"` + // +optional + // +k8s:openapi-gen=false + FlashProxy *FlashProxy `json:"proxy,omitempty" toml:"proxy,omitempty"` +} + +// FlashCluster is the configuration of [flash.flash_cluster] section. +// +k8s:openapi-gen=true +type FlashCluster struct { + // Optional: Defaults to /tiflash/flash_cluster_manager + // +optional + // +k8s:openapi-gen=false + ClusterManagerPath string `json:"cluster_manager_path,omitempty" toml:"cluster_manager_path,omitempty"` + // Optional: Defaults to /data/logs/flash_cluster_manager.log + // +optional + // +k8s:openapi-gen=false + ClusterLog string `json:"log,omitempty" toml:"log,omitempty"` + // Optional: Defaults to 20 + // +optional + RefreshInterval *int32 `json:"refresh_interval,omitempty" toml:"refresh_interval,omitempty"` + // Optional: Defaults to 10 + // +optional + UpdateRuleInterval *int32 `json:"update_rule_interval,omitempty" toml:"update_rule_interval,omitempty"` + // Optional: Defaults to 60 + // +optional + MasterTTL *int32 `json:"master_ttl,omitempty" toml:"master_ttl,omitempty"` +} + +// FlashProxy is the configuration of [flash.proxy] section. +// +k8s:openapi-gen=false +type FlashProxy struct { + // Optional: Defaults to 0.0.0.0:20170 + // +optional + Addr string `json:"addr,omitempty" toml:"addr,omitempty"` + // +optional + AdvertiseAddr string `json:"advertise-addr,omitempty" toml:"advertise-addr,omitempty"` + // Optional: Defaults to /data/proxy + // +optional + DataDir string `json:"data-dir,omitempty" toml:"data-dir,omitempty"` + // Optional: Defaults to /data/proxy.toml + // +optional + Config string `json:"config,omitempty" toml:"config,omitempty"` + // Optional: Defaults to /data/logs/proxy.log + // +optional + LogFile string `json:"log-file,omitempty" toml:"log-file,omitempty"` +} diff --git a/pkg/apis/pingcap/v1alpha1/types.go b/pkg/apis/pingcap/v1alpha1/types.go index dc932d8d5a..a3d1bfe8fa 100644 --- a/pkg/apis/pingcap/v1alpha1/types.go +++ b/pkg/apis/pingcap/v1alpha1/types.go @@ -111,6 +111,10 @@ type TidbClusterSpec struct { // TiKV cluster spec TiKV TiKVSpec `json:"tikv"` + // TiFlash cluster spec + // +optional + TiFlash *TiFlashSpec `json:"tiflash,omitempty"` + // Pump cluster spec // +optional Pump *PumpSpec `json:"pump,omitempty"` @@ -278,6 +282,58 @@ type TiKVSpec struct { Config *TiKVConfig `json:"config,omitempty"` } +// TiFlashSpec contains details of TiFlash members +// +k8s:openapi-gen=true +type TiFlashSpec struct { + ComponentSpec `json:",inline"` + corev1.ResourceRequirements `json:",inline"` + + // Specify a Service Account for TiFlash + ServiceAccount string `json:"serviceAccount,omitempty"` + + // The desired ready replicas + // +kubebuilder:validation:Minimum=1 + Replicas int32 `json:"replicas"` + + // Base image of the component, image tag is now allowed during validation + // +kubebuilder:default=pingcap/tiflash + // +optional + BaseImage string `json:"baseImage"` + + // Whether create the TiFlash container in privileged mode, it is highly discouraged to enable this in + // critical environment. + // Optional: defaults to false + // +optional + Privileged *bool `json:"privileged,omitempty"` + + // MaxFailoverCount limit the max replicas could be added in failover, 0 means no failover + // Optional: Defaults to 3 + // +kubebuilder:validation:Minimum=0 + // +optional + MaxFailoverCount *int32 `json:"maxFailoverCount,omitempty"` + + // The persistent volume claims of the TiFlash data storages. + // TiFlash supports multiple disks. + StorageClaims []StorageClaim `json:"storageClaims"` + + // Config is the Configuration of TiFlash + // +optional + Config *TiFlashConfig `json:"config,omitempty"` +} + +// +k8s:openapi-gen=true +// StorageClaim contains details of TiFlash storages +type StorageClaim struct { + // Resources represents the minimum resources the volume should have. + // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources + // +optional + Resources corev1.ResourceRequirements `json:"resources,omitempty"` + // Name of the StorageClass required by the claim. + // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 + // +optional + StorageClassName *string `json:"storageClassName,omitempty"` +} + // +k8s:openapi-gen=true // TiDBSpec contains details of TiDB members type TiDBSpec struct { diff --git a/pkg/apis/pingcap/v1alpha1/validation/validation.go b/pkg/apis/pingcap/v1alpha1/validation/validation.go index 4efa0c350e..1196fb8271 100644 --- a/pkg/apis/pingcap/v1alpha1/validation/validation.go +++ b/pkg/apis/pingcap/v1alpha1/validation/validation.go @@ -56,6 +56,9 @@ func validateTiDBClusterSpec(spec *v1alpha1.TidbClusterSpec, fldPath *field.Path if spec.Pump != nil { allErrs = append(allErrs, validatePumpSpec(spec.Pump, fldPath.Child("pump"))...) } + if spec.TiFlash != nil { + allErrs = append(allErrs, validateTiFlashSpec(spec.TiFlash, fldPath.Child("tiflash"))...) + } return allErrs } @@ -71,6 +74,28 @@ func validateTiKVSpec(spec *v1alpha1.TiKVSpec, fldPath *field.Path) field.ErrorL return allErrs } +func validateTiFlashSpec(spec *v1alpha1.TiFlashSpec, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + allErrs = append(allErrs, validateComponentSpec(&spec.ComponentSpec, fldPath)...) + allErrs = append(allErrs, validateTiFlashConfig(spec.Config, fldPath)...) + return allErrs +} + +func validateTiFlashConfig(config *v1alpha1.TiFlashConfig, path *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if config == nil { + return allErrs + } + if config.CommonConfig.Flash.OverlapThreshold != nil { + if *config.CommonConfig.Flash.OverlapThreshold < 0 || *config.CommonConfig.Flash.OverlapThreshold > 1 { + allErrs = append(allErrs, field.Invalid(path.Child("config.config.flash.overlap_threshold"), + config.CommonConfig.Flash.OverlapThreshold, + "overlap_threshold must be in the range of [0,1].")) + } + } + return allErrs +} + func validateTiDBSpec(spec *v1alpha1.TiDBSpec, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} allErrs = append(allErrs, validateComponentSpec(&spec.ComponentSpec, fldPath)...) diff --git a/pkg/apis/pingcap/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/pingcap/v1alpha1/zz_generated.deepcopy.go index f7a95863f7..2e7a088d85 100644 --- a/pkg/apis/pingcap/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/pingcap/v1alpha1/zz_generated.deepcopy.go @@ -425,6 +425,92 @@ func (in *Binlog) DeepCopy() *Binlog { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CommonConfig) DeepCopyInto(out *CommonConfig) { + *out = *in + if in.PathRealtimeMode != nil { + in, out := &in.PathRealtimeMode, &out.PathRealtimeMode + *out = new(bool) + **out = **in + } + if in.MarkCacheSize != nil { + in, out := &in.MarkCacheSize, &out.MarkCacheSize + *out = new(int64) + **out = **in + } + if in.MinmaxIndexCacheSize != nil { + in, out := &in.MinmaxIndexCacheSize, &out.MinmaxIndexCacheSize + *out = new(int64) + **out = **in + } + if in.TCPPort != nil { + in, out := &in.TCPPort, &out.TCPPort + *out = new(int32) + **out = **in + } + if in.HTTPPort != nil { + in, out := &in.HTTPPort, &out.HTTPPort + *out = new(int32) + **out = **in + } + if in.InternalServerHTTPPort != nil { + in, out := &in.InternalServerHTTPPort, &out.InternalServerHTTPPort + *out = new(int32) + **out = **in + } + if in.Flash != nil { + in, out := &in.Flash, &out.Flash + *out = new(Flash) + (*in).DeepCopyInto(*out) + } + if in.FlashLogger != nil { + in, out := &in.FlashLogger, &out.FlashLogger + *out = new(FlashLogger) + (*in).DeepCopyInto(*out) + } + if in.FlashApplication != nil { + in, out := &in.FlashApplication, &out.FlashApplication + *out = new(FlashApplication) + (*in).DeepCopyInto(*out) + } + if in.FlashRaft != nil { + in, out := &in.FlashRaft, &out.FlashRaft + *out = new(FlashRaft) + **out = **in + } + if in.FlashStatus != nil { + in, out := &in.FlashStatus, &out.FlashStatus + *out = new(FlashStatus) + (*in).DeepCopyInto(*out) + } + if in.FlashQuota != nil { + in, out := &in.FlashQuota, &out.FlashQuota + *out = new(FlashQuota) + (*in).DeepCopyInto(*out) + } + if in.FlashUser != nil { + in, out := &in.FlashUser, &out.FlashUser + *out = new(FlashUser) + (*in).DeepCopyInto(*out) + } + if in.FlashProfile != nil { + in, out := &in.FlashProfile, &out.FlashProfile + *out = new(FlashProfile) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonConfig. +func (in *CommonConfig) DeepCopy() *CommonConfig { + if in == nil { + return nil + } + out := new(CommonConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ComponentSpec) DeepCopyInto(out *ComponentSpec) { *out = *in @@ -720,6 +806,258 @@ func (in *FileLogConfig) DeepCopy() *FileLogConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Flash) DeepCopyInto(out *Flash) { + *out = *in + if in.OverlapThreshold != nil { + in, out := &in.OverlapThreshold, &out.OverlapThreshold + *out = new(float64) + **out = **in + } + if in.CompactLogMinPeriod != nil { + in, out := &in.CompactLogMinPeriod, &out.CompactLogMinPeriod + *out = new(int32) + **out = **in + } + if in.FlashCluster != nil { + in, out := &in.FlashCluster, &out.FlashCluster + *out = new(FlashCluster) + (*in).DeepCopyInto(*out) + } + if in.FlashProxy != nil { + in, out := &in.FlashProxy, &out.FlashProxy + *out = new(FlashProxy) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Flash. +func (in *Flash) DeepCopy() *Flash { + if in == nil { + return nil + } + out := new(Flash) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlashApplication) DeepCopyInto(out *FlashApplication) { + *out = *in + if in.RunAsDaemon != nil { + in, out := &in.RunAsDaemon, &out.RunAsDaemon + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashApplication. +func (in *FlashApplication) DeepCopy() *FlashApplication { + if in == nil { + return nil + } + out := new(FlashApplication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlashCluster) DeepCopyInto(out *FlashCluster) { + *out = *in + if in.RefreshInterval != nil { + in, out := &in.RefreshInterval, &out.RefreshInterval + *out = new(int32) + **out = **in + } + if in.UpdateRuleInterval != nil { + in, out := &in.UpdateRuleInterval, &out.UpdateRuleInterval + *out = new(int32) + **out = **in + } + if in.MasterTTL != nil { + in, out := &in.MasterTTL, &out.MasterTTL + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashCluster. +func (in *FlashCluster) DeepCopy() *FlashCluster { + if in == nil { + return nil + } + out := new(FlashCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlashLogger) DeepCopyInto(out *FlashLogger) { + *out = *in + if in.Count != nil { + in, out := &in.Count, &out.Count + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashLogger. +func (in *FlashLogger) DeepCopy() *FlashLogger { + if in == nil { + return nil + } + out := new(FlashLogger) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlashProfile) DeepCopyInto(out *FlashProfile) { + *out = *in + if in.Readonly != nil { + in, out := &in.Readonly, &out.Readonly + *out = new(Profile) + (*in).DeepCopyInto(*out) + } + if in.Default != nil { + in, out := &in.Default, &out.Default + *out = new(Profile) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashProfile. +func (in *FlashProfile) DeepCopy() *FlashProfile { + if in == nil { + return nil + } + out := new(FlashProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlashProxy) DeepCopyInto(out *FlashProxy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashProxy. +func (in *FlashProxy) DeepCopy() *FlashProxy { + if in == nil { + return nil + } + out := new(FlashProxy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlashQuota) DeepCopyInto(out *FlashQuota) { + *out = *in + if in.Default != nil { + in, out := &in.Default, &out.Default + *out = new(Quota) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashQuota. +func (in *FlashQuota) DeepCopy() *FlashQuota { + if in == nil { + return nil + } + out := new(FlashQuota) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlashRaft) DeepCopyInto(out *FlashRaft) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashRaft. +func (in *FlashRaft) DeepCopy() *FlashRaft { + if in == nil { + return nil + } + out := new(FlashRaft) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlashServerConfig) DeepCopyInto(out *FlashServerConfig) { + *out = *in + in.TiKVServerConfig.DeepCopyInto(&out.TiKVServerConfig) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashServerConfig. +func (in *FlashServerConfig) DeepCopy() *FlashServerConfig { + if in == nil { + return nil + } + out := new(FlashServerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlashStatus) DeepCopyInto(out *FlashStatus) { + *out = *in + if in.MetricsPort != nil { + in, out := &in.MetricsPort, &out.MetricsPort + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashStatus. +func (in *FlashStatus) DeepCopy() *FlashStatus { + if in == nil { + return nil + } + out := new(FlashStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlashUser) DeepCopyInto(out *FlashUser) { + *out = *in + if in.Readonly != nil { + in, out := &in.Readonly, &out.Readonly + *out = new(User) + (*in).DeepCopyInto(*out) + } + if in.Default != nil { + in, out := &in.Default, &out.Default + *out = new(User) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashUser. +func (in *FlashUser) DeepCopy() *FlashUser { + if in == nil { + return nil + } + out := new(FlashUser) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GcsStorageProvider) DeepCopyInto(out *GcsStorageProvider) { *out = *in @@ -811,6 +1149,52 @@ func (in *InitializerSpec) DeepCopy() *InitializerSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Interval) DeepCopyInto(out *Interval) { + *out = *in + if in.Duration != nil { + in, out := &in.Duration, &out.Duration + *out = new(int32) + **out = **in + } + if in.Queries != nil { + in, out := &in.Queries, &out.Queries + *out = new(int32) + **out = **in + } + if in.Errors != nil { + in, out := &in.Errors, &out.Errors + *out = new(int32) + **out = **in + } + if in.ResultRows != nil { + in, out := &in.ResultRows, &out.ResultRows + *out = new(int32) + **out = **in + } + if in.ReadRows != nil { + in, out := &in.ReadRows, &out.ReadRows + *out = new(int32) + **out = **in + } + if in.ExecutionTime != nil { + in, out := &in.ExecutionTime, &out.ExecutionTime + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Interval. +func (in *Interval) DeepCopy() *Interval { + if in == nil { + return nil + } + out := new(Interval) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IsolationRead) DeepCopyInto(out *IsolationRead) { *out = *in @@ -930,6 +1314,22 @@ func (in *MonitorContainer) DeepCopy() *MonitorContainer { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Networks) DeepCopyInto(out *Networks) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Networks. +func (in *Networks) DeepCopy() *Networks { + if in == nil { + return nil + } + out := new(Networks) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OpenTracing) DeepCopyInto(out *OpenTracing) { *out = *in @@ -1891,6 +2291,42 @@ func (in *PreparedPlanCache) DeepCopy() *PreparedPlanCache { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Profile) DeepCopyInto(out *Profile) { + *out = *in + if in.Readonly != nil { + in, out := &in.Readonly, &out.Readonly + *out = new(int32) + **out = **in + } + if in.MaxMemoryUsage != nil { + in, out := &in.MaxMemoryUsage, &out.MaxMemoryUsage + *out = new(int64) + **out = **in + } + if in.UseUncompressedCache != nil { + in, out := &in.UseUncompressedCache, &out.UseUncompressedCache + *out = new(int32) + **out = **in + } + if in.LoadBalancing != nil { + in, out := &in.LoadBalancing, &out.LoadBalancing + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Profile. +func (in *Profile) DeepCopy() *Profile { + if in == nil { + return nil + } + out := new(Profile) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PrometheusSpec) DeepCopyInto(out *PrometheusSpec) { *out = *in @@ -1909,6 +2345,82 @@ func (in *PrometheusSpec) DeepCopy() *PrometheusSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyConfig) DeepCopyInto(out *ProxyConfig) { + *out = *in + if in.PanicWhenUnexpectedKeyOrData != nil { + in, out := &in.PanicWhenUnexpectedKeyOrData, &out.PanicWhenUnexpectedKeyOrData + *out = new(bool) + **out = **in + } + if in.Server != nil { + in, out := &in.Server, &out.Server + *out = new(FlashServerConfig) + (*in).DeepCopyInto(*out) + } + if in.Storage != nil { + in, out := &in.Storage, &out.Storage + *out = new(TiKVStorageConfig) + (*in).DeepCopyInto(*out) + } + if in.Raftstore != nil { + in, out := &in.Raftstore, &out.Raftstore + *out = new(TiKVRaftstoreConfig) + (*in).DeepCopyInto(*out) + } + if in.Rocksdb != nil { + in, out := &in.Rocksdb, &out.Rocksdb + *out = new(TiKVDbConfig) + (*in).DeepCopyInto(*out) + } + if in.Coprocessor != nil { + in, out := &in.Coprocessor, &out.Coprocessor + *out = new(TiKVCoprocessorConfig) + (*in).DeepCopyInto(*out) + } + if in.ReadPool != nil { + in, out := &in.ReadPool, &out.ReadPool + *out = new(TiKVReadPoolConfig) + (*in).DeepCopyInto(*out) + } + if in.RaftDB != nil { + in, out := &in.RaftDB, &out.RaftDB + *out = new(TiKVRaftDBConfig) + (*in).DeepCopyInto(*out) + } + if in.Import != nil { + in, out := &in.Import, &out.Import + *out = new(TiKVImportConfig) + (*in).DeepCopyInto(*out) + } + if in.GC != nil { + in, out := &in.GC, &out.GC + *out = new(TiKVGCConfig) + (*in).DeepCopyInto(*out) + } + if in.PD != nil { + in, out := &in.PD, &out.PD + *out = new(TiKVPDConfig) + (*in).DeepCopyInto(*out) + } + if in.Security != nil { + in, out := &in.Security, &out.Security + *out = new(TiKVSecurityConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfig. +func (in *ProxyConfig) DeepCopy() *ProxyConfig { + if in == nil { + return nil + } + out := new(ProxyConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProxyProtocol) DeepCopyInto(out *ProxyProtocol) { *out = *in @@ -1935,6 +2447,22 @@ func (in *ProxyProtocol) DeepCopy() *ProxyProtocol { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyServer) DeepCopyInto(out *ProxyServer) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyServer. +func (in *ProxyServer) DeepCopy() *ProxyServer { + if in == nil { + return nil + } + out := new(ProxyServer) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PumpSpec) DeepCopyInto(out *PumpSpec) { *out = *in @@ -1985,6 +2513,27 @@ func (in *PumpStatus) DeepCopy() *PumpStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Quota) DeepCopyInto(out *Quota) { + *out = *in + if in.Interval != nil { + in, out := &in.Interval, &out.Interval + *out = new(Interval) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Quota. +func (in *Quota) DeepCopy() *Quota { + if in == nil { + return nil + } + out := new(Quota) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ReloaderSpec) DeepCopyInto(out *ReloaderSpec) { *out = *in @@ -2354,6 +2903,28 @@ func (in *StmtSummary) DeepCopy() *StmtSummary { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageClaim) DeepCopyInto(out *StorageClaim) { + *out = *in + in.Resources.DeepCopyInto(&out.Resources) + if in.StorageClassName != nil { + in, out := &in.StorageClassName, &out.StorageClassName + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClaim. +func (in *StorageClaim) DeepCopy() *StorageClaim { + if in == nil { + return nil + } + out := new(StorageClaim) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageProvider) DeepCopyInto(out *StorageProvider) { *out = *in @@ -2820,6 +3391,72 @@ func (in *TiDBTLSClient) DeepCopy() *TiDBTLSClient { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TiFlashConfig) DeepCopyInto(out *TiFlashConfig) { + *out = *in + if in.CommonConfig != nil { + in, out := &in.CommonConfig, &out.CommonConfig + *out = new(CommonConfig) + (*in).DeepCopyInto(*out) + } + if in.ProxyConfig != nil { + in, out := &in.ProxyConfig, &out.ProxyConfig + *out = new(ProxyConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiFlashConfig. +func (in *TiFlashConfig) DeepCopy() *TiFlashConfig { + if in == nil { + return nil + } + out := new(TiFlashConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TiFlashSpec) DeepCopyInto(out *TiFlashSpec) { + *out = *in + in.ComponentSpec.DeepCopyInto(&out.ComponentSpec) + in.ResourceRequirements.DeepCopyInto(&out.ResourceRequirements) + if in.Privileged != nil { + in, out := &in.Privileged, &out.Privileged + *out = new(bool) + **out = **in + } + if in.MaxFailoverCount != nil { + in, out := &in.MaxFailoverCount, &out.MaxFailoverCount + *out = new(int32) + **out = **in + } + if in.StorageClaims != nil { + in, out := &in.StorageClaims, &out.StorageClaims + *out = make([]StorageClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = new(TiFlashConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiFlashSpec. +func (in *TiFlashSpec) DeepCopy() *TiFlashSpec { + if in == nil { + return nil + } + out := new(TiFlashSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TiKVBlockCacheConfig) DeepCopyInto(out *TiKVBlockCacheConfig) { *out = *in @@ -4220,6 +4857,11 @@ func (in *TidbClusterSpec) DeepCopyInto(out *TidbClusterSpec) { in.PD.DeepCopyInto(&out.PD) in.TiDB.DeepCopyInto(&out.TiDB) in.TiKV.DeepCopyInto(&out.TiKV) + if in.TiFlash != nil { + in, out := &in.TiFlash, &out.TiFlash + *out = new(TiFlashSpec) + (*in).DeepCopyInto(*out) + } if in.Pump != nil { in, out := &in.Pump, &out.Pump *out = new(PumpSpec) @@ -4656,3 +5298,24 @@ func (in *UnjoinedMember) DeepCopy() *UnjoinedMember { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *User) DeepCopyInto(out *User) { + *out = *in + if in.Networks != nil { + in, out := &in.Networks, &out.Networks + *out = new(Networks) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User. +func (in *User) DeepCopy() *User { + if in == nil { + return nil + } + out := new(User) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/controller/controller_utils.go b/pkg/controller/controller_utils.go index 6d91a7c895..6ee5f55e69 100644 --- a/pkg/controller/controller_utils.go +++ b/pkg/controller/controller_utils.go @@ -247,6 +247,16 @@ func TiKVPeerMemberName(clusterName string) string { return fmt.Sprintf("%s-tikv-peer", clusterName) } +// TiFlashMemberName returns tiflash member name +func TiFlashMemberName(clusterName string) string { + return fmt.Sprintf("%s-tiflash", clusterName) +} + +// TiFlashPeerMemberName returns tiflash peer service name +func TiFlashPeerMemberName(clusterName string) string { + return fmt.Sprintf("%s-tiflash-peer", clusterName) +} + // TiDBMemberName returns tidb member name func TiDBMemberName(clusterName string) string { return fmt.Sprintf("%s-tidb", clusterName)