v1alpha1

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 32 Imported by: 24

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API. +groupName=pingcap.com

Index

Constants

View Source
const (
	// BackupNameTimeFormat is the time format for generate backup CR name
	BackupNameTimeFormat = "2006-01-02t15-04-05"

	// DefaultTidbUser is the default tidb user for login tidb cluster
	DefaultTidbUser = "root"
)
View Source
const (
	Version   = "v1alpha1"
	GroupName = "pingcap.com"

	TiDBClusterName    = "tidbclusters"
	TiDBClusterKind    = "TidbCluster"
	TiDBClusterKindKey = "tidbcluster"

	DMClusterName    = "dmclusters"
	DMClusterKind    = "DMCluster"
	DMClusterKindKey = "dmcluster"

	BackupName    = "backups"
	BackupKind    = "Backup"
	BackupKindKey = "backup"

	RestoreName    = "restores"
	RestoreKind    = "Restore"
	RestoreKindKey = "restore"

	BackupScheduleName    = "backupschedules"
	BackupScheduleKind    = "BackupSchedule"
	BackupScheduleKindKey = "backupschedule"

	TiDBMonitorName    = "tidbmonitors"
	TiDBMonitorKind    = "TidbMonitor"
	TiDBMonitorKindKey = "tidbmonitor"

	TiDBInitializerName    = "tidbinitializers"
	TiDBInitializerKind    = "TidbInitializer"
	TiDBInitializerKindKey = "tidbinitializer"

	TidbClusterAutoScalerName    = "tidbclusterautoscalers"
	TidbClusterAutoScalerKind    = "TidbClusterAutoScaler"
	TidbClusterAutoScalerKindKey = "tidbclusterautoscaler"

	TiDBNGMonitoringName    = "tidbngmonitorings"
	TiDBNGMonitoringKind    = "TidbNGMonitoring"
	TiDBNGMonitoringKindKey = "tidbngmonitoring"

	TiDBDashboardName    = "tidbdashboards"
	TiDBDashboardKind    = "TidbDashboard"
	TiDBDashboardKindKey = "tidbdashboard"

	SpecPath = "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1."
)
View Source
const (
	// TiKVStateUp represents status of Up of TiKV
	TiKVStateUp string = "Up"
	// TiKVStateDown represents status of Down of TiKV
	TiKVStateDown string = "Down"
	// TiKVStateOffline represents status of Offline of TiKV
	TiKVStateOffline string = "Offline"
	// TiKVStateTombstone represents status of Tombstone of TiKV
	TiKVStateTombstone string = "Tombstone"

	// DMWorkerStateFree represents status of free of dm-worker
	DMWorkerStateFree string = "free"
	// DMWorkerStateBound represents status of bound of dm-worker
	DMWorkerStateBound string = "bound"
	// DMWorkerStateOffline represents status of offline of dm-worker
	DMWorkerStateOffline string = "offline"

	// PumpStateOnline represents status of online of Pump
	PumpStateOnline string = "online"
	// PumpStateOffline represents status of offline of Pump
	PumpStateOffline string = "offline"
)
View Source
const (
	StartScriptV2FeatureFlagWaitForDnsNameIpMatch          = "WaitForDnsNameIpMatch"
	StartScriptV2FeatureFlagPreferPDAddressesOverDiscovery = "PreferPDAddressesOverDiscovery"
)
View Source
const (
	// TCPProbeType represents the readiness prob method with TCP
	TCPProbeType string = "tcp"
	// CommandProbeType represents the readiness prob method with arbitrary unix `exec` call format commands
	CommandProbeType string = "command"
)
View Source
const (
	// EvictLeaderAnnKey is the annotation key to evict leader used by user.
	EvictLeaderAnnKey = "tidb.pingcap.com/evict-leader"
	// EvictLeaderAnnKeyForResize is the annotation key to evict leader user by pvc resizer.
	EvictLeaderAnnKeyForResize = "tidb.pingcap.com/evict-leader-for-resize"
	// PDLeaderTransferAnnKey is the annotation key to transfer PD leader used by user.
	PDLeaderTransferAnnKey = "tidb.pingcap.com/pd-transfer-leader"
	// TiDBGracefulShutdownAnnKey is the annotation key to graceful shutdown tidb pod by user.
	TiDBGracefulShutdownAnnKey = "tidb.pingcap.com/tidb-graceful-shutdown"
	// TiKVEvictLeaderExpirationTimeAnnKey is the annotation key to expire evict leader annotation. Type: time.RFC3339.
	TiKVEvictLeaderExpirationTimeAnnKey = "tidb.pingcap.com/tikv-evict-leader-expiration-time"
	// PDLeaderTransferExpirationTimeAnnKey is the annotation key to expire transfer leader annotation. Type: time.RFC3339.
	PDLeaderTransferExpirationTimeAnnKey = "tidb.pingcap.com/pd-evict-leader-expiration-time"
	// ReplaceVolumeAnnKey is the annotation key to replace disks used by pod.
	ReplaceVolumeAnnKey = "tidb.pingcap.com/replace-volume"
)
View Source
const (
	EvictLeaderValueNone      = "none"
	EvictLeaderValueDeletePod = "delete-pod"
)

The `Value` of annotation controls the behavior when the leader count drops to zero, the valid value is one of:

- `none`: doing nothing. - `delete-pod`: delete pod and remove the evict-leader scheduler from PD.

View Source
const (
	TransferLeaderValueNone      = "none"
	TransferLeaderValueDeletePod = "delete-pod"
)

The `Value` of PD leader transfer annotation controls the behavior when the leader is transferred to another member, the valid value is one of:

- `none`: doing nothing. - `delete-pod`: delete pod.

View Source
const (
	TiDBPodDeletionValueNone = "none"
	TiDBPodDeletionDeletePod = "delete-pod"
)

The `Value` of TiDB deletion annotation controls the behavior when the tidb pod got deleted, the valid value is one of:

- `none`: doing nothing. - `delete-pod`: delete pod.

View Source
const (
	// ComponentVolumeResizing indicates that any volume of this component is resizing.
	ComponentVolumeResizing string = "ComponentVolumeResizing"
)

The `Type` of the component condition

View Source
const (
	// It means whether some pods are evicting leader
	// This condition is used to avoid too many pods evict leader at same time
	// Normally we only allow one pod evicts leader.
	// TODO: set this condition before all leader eviction behavior
	ConditionTypeLeaderEvicting = "LeaderEvicting"
)
View Source
const (
	ReplaceVolumeValueTrue = "true"
)

Only supported value for ReplaceVolume Annotation.

View Source
const (
	RetryEvictLeaderInterval = 10 * time.Minute
)

Variables

View Source
var (
	DefaultTiDBServerPort = int32(4000)

	DefaultTiDBStatusPort = int32(10080)

	DefaultPDClientPort = int32(2379)

	DefaultPDPeerPort = int32(2380)

	DefaultTiKVServerPort = int32(20160)

	DefaultTiKVStatusPort = int32(20180)

	DefaultTiFlashTcpPort = int32(9000)

	DefaultTiFlashHttpPort = int32(8123)

	DefaultTiFlashFlashPort = int32(3930)

	DefaultTiFlashProxyPort = int32(20170)

	DefaultTiFlashMetricsPort = int32(8234)

	DefaultTiFlashProxyStatusPort = int32(20292)

	DefaultTiFlashInternalPort = int32(9009)

	DefaultPumpPort = int32(8250)

	// in fact, only used in tests now
	DefaultDrainerPort = int32(8249)

	// NOTE: this should be 8300 in TiCDC itself, but we have used 8301 in TiDB Operator at the beginning
	DefaultTiCDCPort = int32(8301)

	DefaultTiProxyServerPort = int32(6000)

	DefaultTiProxyStatusPort = int32(3080)
)

Default component ports, can be overridden with ENV variables when building

View Source
var (
	SchemeBuilder runtime.SchemeBuilder

	// AddToScheme applies all the stored functions to the scheme.
	AddToScheme = localSchemeBuilder.AddToScheme
	// Scheme is the scheme instance of operator
	Scheme *runtime.Scheme
)
View Source
var (
	DefaultBatchDeleteOption = BatchDeleteOption{
		BatchConcurrency:   10,
		RoutineConcurrency: 100,
	}
)
View Source
var DefaultCrdKinds = CrdKinds{
	KindsString:           "",
	TiDBCluster:           CrdKind{Plural: TiDBClusterName, Kind: TiDBClusterKind, ShortNames: []string{"tc"}, SpecName: SpecPath + TiDBClusterKind},
	DMCluster:             CrdKind{Plural: DMClusterName, Kind: DMClusterKind, ShortNames: []string{"dc"}, SpecName: SpecPath + DMClusterKind},
	Backup:                CrdKind{Plural: BackupName, Kind: BackupKind, ShortNames: []string{"bk"}, SpecName: SpecPath + BackupKind},
	Restore:               CrdKind{Plural: RestoreName, Kind: RestoreKind, ShortNames: []string{"rt"}, SpecName: SpecPath + RestoreKind},
	BackupSchedule:        CrdKind{Plural: BackupScheduleName, Kind: BackupScheduleKind, ShortNames: []string{"bks"}, SpecName: SpecPath + BackupScheduleKind},
	TiDBMonitor:           CrdKind{Plural: TiDBMonitorName, Kind: TiDBMonitorKind, ShortNames: []string{"tm"}, SpecName: SpecPath + TiDBMonitorKind},
	TiDBInitializer:       CrdKind{Plural: TiDBInitializerName, Kind: TiDBInitializerKind, ShortNames: []string{"ti"}, SpecName: SpecPath + TiDBInitializerKind},
	TidbClusterAutoScaler: CrdKind{Plural: TidbClusterAutoScalerName, Kind: TidbClusterAutoScalerKind, ShortNames: []string{"ta"}, SpecName: SpecPath + TidbClusterAutoScalerKind},
	TiDBNGMonitoring:      CrdKind{Plural: TiDBNGMonitoringName, Kind: TiDBNGMonitoringKind, ShortNames: []string{"tngm"}, SpecName: SpecPath + TiDBNGMonitoringKind},
}
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: groupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func GetLogSubcommandConditionInfo added in v1.4.0

func GetLogSubcommandConditionInfo(backup *Backup) (reason, message string)

GetLogSubcommandConditionInfo gets log subcommand current phase's reason and message

func GetMaxReplicaCountAndDeleteSlots

func GetMaxReplicaCountAndDeleteSlots(replicas int32, deleteSlots sets.Int32) (int32, sets.Int32)

GetMaxReplicaCountAndDeleteSlots returns the max replica count and delete slots. The desired slots of this stateful set will be [0, replicaCount) - [delete slots].

workaround for removing dependency about package 'advanced-statefulset' copy from https://github.com/pingcap/advanced-statefulset/blob/f94e356d25058396e94d33c3fe7224d5a2ca1517/client/apis/apps/v1/helper/helper.go#L74

func GetPodOrdinalsFromReplicasAndDeleteSlots

func GetPodOrdinalsFromReplicasAndDeleteSlots(replicas int32, deleteSlots sets.Int32) sets.Int32

workaround for removing dependency about package 'advanced-statefulset' copy from https://github.com/pingcap/advanced-statefulset/blob/f94e356d25058396e94d33c3fe7224d5a2ca1517/client/apis/apps/v1/helper/helper.go#L94

func HashContents

func HashContents(contents []byte) string

HashContents hashes the contents using FNV hashing. The returned hash will be a safe encoded string to avoid bad words.

func IsBackupClean

func IsBackupClean(backup *Backup) bool

IsBackupClean returns true if a Backup has been successfully cleaned up

func IsBackupCleanFailed added in v1.5.3

func IsBackupCleanFailed(backup *Backup) bool

IsBackupCleanFailed returns true if a Backup has failed to clean up

func IsBackupComplete

func IsBackupComplete(backup *Backup) bool

IsBackupComplete returns true if a Backup has successfully completed

func IsBackupFailed

func IsBackupFailed(backup *Backup) bool

IsBackupFailed returns true if a Backup has failed

func IsBackupInvalid

func IsBackupInvalid(backup *Backup) bool

IsBackupInvalid returns true if a Backup has invalid condition set

func IsBackupPrepared

func IsBackupPrepared(backup *Backup) bool

IsBackupPrepared returns true if a Backup is Prepare.

func IsBackupRestart added in v1.4.4

func IsBackupRestart(backup *Backup) bool

IsBackupRestart returns true if a Backup was restarted.

func IsBackupRunning

func IsBackupRunning(backup *Backup) bool

IsBackupRunning returns true if a Backup is Running.

func IsBackupScheduled

func IsBackupScheduled(backup *Backup) bool

IsBackupScheduled returns true if a Backup has successfully scheduled

func IsCleanCandidate

func IsCleanCandidate(backup *Backup) bool

IsCleanCandidate returns true if a Backup should be added to clean candidate according to cleanPolicy

func IsCleanVolumeComplete added in v1.5.4

func IsCleanVolumeComplete(restore *Restore) bool

IsCleanVolumeComplete returns true if restored volumes are cleaned

func IsLogBackupAlreadyStart added in v1.4.0

func IsLogBackupAlreadyStart(backup *Backup) bool

IsLogBackupAlreadyStart return whether log backup has already started.

func IsLogBackupAlreadyStop added in v1.4.0

func IsLogBackupAlreadyStop(backup *Backup) bool

IsLogBackupAlreadyStop return whether log backup has already stopped.

func IsLogBackupAlreadyTruncate added in v1.4.0

func IsLogBackupAlreadyTruncate(backup *Backup) bool

IsLogBackupAlreadyTruncate return whether log backup has already truncated.

func IsLogBackupStopped added in v1.4.0

func IsLogBackupStopped(backup *Backup) bool

IsLogBackupStopped returns true if a log backup is stopped. It means log backup is at stopped status. It used to filter CR update event which is stop command and stopped status, and let it run truncate after log backup stopped which is truncate command and stopped status.

func IsLogBackupSubCommandOntheCondition added in v1.4.0

func IsLogBackupSubCommandOntheCondition(backup *Backup, conditionType BackupConditionType) bool

IsLogBackupSubCommandOntheCondition return whether the log subcommand on the condition.

func IsPDMSMemberType added in v1.6.0

func IsPDMSMemberType(name MemberType) bool

func IsRestoreComplete

func IsRestoreComplete(restore *Restore) bool

IsRestoreComplete returns true if a Restore has successfully completed

func IsRestoreDataComplete added in v1.4.0

func IsRestoreDataComplete(restore *Restore) bool

IsRestoreDataComplete returns true if a Restore for data consistency has successfully completed

func IsRestoreFailed

func IsRestoreFailed(restore *Restore) bool

IsRestoreFailed returns true if a Restore is Failed

func IsRestoreInvalid

func IsRestoreInvalid(restore *Restore) bool

IsRestoreInvalid returns true if a Restore has invalid condition set

func IsRestoreRunning

func IsRestoreRunning(restore *Restore) bool

IsRestoreRunning returns true if a Restore is Running

func IsRestoreScheduled

func IsRestoreScheduled(restore *Restore) bool

IsRestoreScheduled returns true if a Restore has successfully scheduled

func IsRestoreTiKVComplete added in v1.5.0

func IsRestoreTiKVComplete(restore *Restore) bool

IsRestoreTiKVComplete returns true if all TiKVs run successfully during volume restore

func IsRestoreVolumeComplete added in v1.4.0

func IsRestoreVolumeComplete(restore *Restore) bool

IsRestoreVolumeComplete returns true if a Restore for volume has successfully completed

func IsRestoreVolumeFailed added in v1.5.4

func IsRestoreVolumeFailed(restore *Restore) bool

IsRestoreVolumeFailed returns true if a Restore for volume is Failed

func IsRestoreWarmUpComplete added in v1.5.1

func IsRestoreWarmUpComplete(restore *Restore) bool

IsRestoreWarmUpComplete returns true if all the warmup jobs has successfully finished

func IsRestoreWarmUpStarted added in v1.5.1

func IsRestoreWarmUpStarted(restore *Restore) bool

IsRestoreWarmUpStarted returns true if all the warmup jobs has successfully started

func IsVolumeBackupComplete added in v1.5.0

func IsVolumeBackupComplete(backup *Backup) bool

IsVolumeBackupComplete returns true if volume backup is complete

func IsVolumeBackupFailed added in v1.5.0

func IsVolumeBackupFailed(backup *Backup) bool

IsVolumeBackupFailed returns true if volume backup is failed

func IsVolumeBackupInitializeComplete added in v1.5.1

func IsVolumeBackupInitializeComplete(backup *Backup) bool

func IsVolumeBackupInitializeFailed added in v1.5.0

func IsVolumeBackupInitializeFailed(backup *Backup) bool

IsVolumeBackupInitializeFailed returns true if volume backup is initialized failed

func IsVolumeBackupInitialized added in v1.5.0

func IsVolumeBackupInitialized(backup *Backup) bool

IsVolumeBackupInitialized returns true if volume backup is initialized

func IsVolumeBackupSnapshotsCreated added in v1.5.1

func IsVolumeBackupSnapshotsCreated(backup *Backup) bool

func NeedNotClean

func NeedNotClean(backup *Backup) bool

NeedNotClean returns true if a Backup need not to be cleaned up according to cleanPolicy

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns back a Group qualified GroupResource

func UpdateBackupCondition

func UpdateBackupCondition(status *BackupStatus, condition *BackupCondition) bool

UpdateBackupCondition updates existing Backup condition or creates a new one. Sets LastTransitionTime to now if the status has changed. Returns true if Backup condition has changed or has been added.

func UpdateRestoreCondition

func UpdateRestoreCondition(status *RestoreStatus, condition *RestoreCondition) bool

UpdateRestoreCondition updates existing Restore condition or creates a new one. Sets LastTransitionTime to now if the status has changed. Returns true if Restore condition has changed or has been added.

Types

type AutoResource

type AutoResource struct {
	// CPU defines the CPU of this resource type
	CPU resource.Quantity `json:"cpu"`
	// Memory defines the memory of this resource type
	Memory resource.Quantity `json:"memory"`
	// Storage defines the storage of this resource type
	Storage resource.Quantity `json:"storage,omitempty"`
	// Count defines the max availabel count of this resource type
	Count *int32 `json:"count,omitempty"`
}

+k8s:openapi-gen=true AutoResource describes the resource type definitions

func (*AutoResource) DeepCopy

func (in *AutoResource) DeepCopy() *AutoResource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoResource.

func (*AutoResource) DeepCopyInto

func (in *AutoResource) DeepCopyInto(out *AutoResource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AutoRule

type AutoRule struct {
	// MaxThreshold defines the threshold to scale out
	MaxThreshold float64 `json:"max_threshold"`
	// MinThreshold defines the threshold to scale in, not applicable to `storage` rule
	MinThreshold *float64 `json:"min_threshold,omitempty"`
	// ResourceTypes defines the resource types that can be used for scaling
	ResourceTypes []string `json:"resource_types,omitempty"`
}

+k8s:openapi-gen=true AutoRule describes the rules for auto-scaling with PD API

func (*AutoRule) DeepCopy

func (in *AutoRule) DeepCopy() *AutoRule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoRule.

func (*AutoRule) DeepCopyInto

func (in *AutoRule) DeepCopyInto(out *AutoRule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AzblobStorageProvider added in v1.3.5

type AzblobStorageProvider struct {
	// Path is the full path where the backup is saved.
	// The format of the path must be: "<container-name>/<path-to-backup-file>"
	Path string `json:"path,omitempty"`
	// Container in which to store the backup data.
	Container string `json:"container,omitempty"`
	// Access tier of the uploaded objects.
	AccessTier string `json:"accessTier,omitempty"`
	// SecretName is the name of secret which stores the
	// azblob service account credentials.
	SecretName string `json:"secretName,omitempty"`
	// Prefix of the data path.
	Prefix string `json:"prefix,omitempty"`
}

+k8s:openapi-gen=true AzblobStorageProvider represents the azure blob storage for storing backups.

func (*AzblobStorageProvider) DeepCopy added in v1.3.5

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzblobStorageProvider.

func (*AzblobStorageProvider) DeepCopyInto added in v1.3.5

func (in *AzblobStorageProvider) DeepCopyInto(out *AzblobStorageProvider)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BRConfig

type BRConfig struct {
	// ClusterName of backup/restore cluster
	Cluster string `json:"cluster"`
	// Namespace of backup/restore cluster
	ClusterNamespace string `json:"clusterNamespace,omitempty"`
	// Deprecated from BR v4.0.3. Please use `Spec.TableFilter` instead. DB is the specific DB which will be backed-up or restored
	DB string `json:"db,omitempty"`
	// Deprecated from BR v4.0.3. Please use `Spec.TableFilter` instead. Table is the specific table which will be backed-up or restored
	Table string `json:"table,omitempty"`
	// LogLevel is the log level
	LogLevel string `json:"logLevel,omitempty"`
	// StatusAddr is the HTTP listening address for the status report service. Set to empty string to disable
	StatusAddr string `json:"statusAddr,omitempty"`
	// Concurrency is the size of thread pool on each node that execute the backup task
	Concurrency *uint32 `json:"concurrency,omitempty"`
	// RateLimit is the rate limit of the backup task, MB/s per node
	RateLimit *uint `json:"rateLimit,omitempty"`
	// TimeAgo is the history version of the backup task, e.g. 1m, 1h
	TimeAgo string `json:"timeAgo,omitempty"`
	// Checksum specifies whether to run checksum after backup
	Checksum *bool `json:"checksum,omitempty"`
	// CheckRequirements specifies whether to check requirements
	CheckRequirements *bool `json:"checkRequirements,omitempty"`
	// SendCredToTikv specifies whether to send credentials to TiKV
	SendCredToTikv *bool `json:"sendCredToTikv,omitempty"`
	// OnLine specifies whether online during restore
	OnLine *bool `json:"onLine,omitempty"`
	// Options means options for backup data to remote storage with BR. These options has highest priority.
	Options []string `json:"options,omitempty"`
}

+k8s:openapi-gen=true BRConfig contains config for BR

func (*BRConfig) DeepCopy

func (in *BRConfig) DeepCopy() *BRConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BRConfig.

func (*BRConfig) DeepCopyInto

func (in *BRConfig) DeepCopyInto(out *BRConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackoffRetryPolicy added in v1.4.4

type BackoffRetryPolicy struct {
	// MinRetryDuration is the min retry duration, the retry duration will be MinRetryDuration << (retry num -1)
	// format reference, https://golang.org/pkg/time/#ParseDuration
	// +kubebuilder:default="300s"
	MinRetryDuration string `json:"minRetryDuration,omitempty"`
	// MaxRetryTimes is the max retry times
	// +kubebuilder:default=2
	MaxRetryTimes int `json:"maxRetryTimes,omitempty"`
	// RetryTimeout is the retry timeout
	// format reference, https://golang.org/pkg/time/#ParseDuration
	// +kubebuilder:default="30m"
	RetryTimeout string `json:"retryTimeout,omitempty"`
}

BackoffRetryPolicy is the backoff retry policy, currently only valid for snapshot backup. When backup job or pod failed, it will retry in the following way: first time: retry after MinRetryDuration second time: retry after MinRetryDuration * 2 third time: retry after MinRetryDuration * 2 * 2 ... as the limit: 1. the number of retries can not exceed MaxRetryTimes 2. the time from discovery failure can not exceed RetryTimeout

func (*BackoffRetryPolicy) DeepCopy added in v1.4.4

func (in *BackoffRetryPolicy) DeepCopy() *BackoffRetryPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackoffRetryPolicy.

func (*BackoffRetryPolicy) DeepCopyInto added in v1.4.4

func (in *BackoffRetryPolicy) DeepCopyInto(out *BackoffRetryPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackoffRetryRecord added in v1.4.4

type BackoffRetryRecord struct {
	// RetryNum is the number of retry
	RetryNum int `json:"retryNum,omitempty"`
	// DetectFailedAt is the time when detect failure
	DetectFailedAt *metav1.Time `json:"detectFailedAt,omitempty"`
	// ExpectedRetryAt is the time we calculate and expect retry after it
	ExpectedRetryAt *metav1.Time `json:"expectedRetryAt,omitempty"`
	// RealRetryAt is the time when the retry was actually initiated
	RealRetryAt *metav1.Time `json:"realRetryAt,omitempty"`
	// Reason is the reason of retry
	RetryReason string `json:"retryReason,omitempty"`
	// OriginalReason is the original reason of backup job or pod failed
	OriginalReason string `json:"originalReason,omitempty"`
}

BackoffRetryRecord is the record of backoff retry

func (*BackoffRetryRecord) DeepCopy added in v1.4.4

func (in *BackoffRetryRecord) DeepCopy() *BackoffRetryRecord

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackoffRetryRecord.

func (*BackoffRetryRecord) DeepCopyInto added in v1.4.4

func (in *BackoffRetryRecord) DeepCopyInto(out *BackoffRetryRecord)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Backup

type Backup struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata"`

	Spec BackupSpec `json:"spec"`
	// +k8s:openapi-gen=false
	Status BackupStatus `json:"status,omitempty"`
}

Backup is a backup of tidb cluster.

+k8s:openapi-gen=true +kubebuilder:resource:shortName="bk" +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.backupType`,description="the type of backup, such as full, db, table. Only used when Mode = snapshot." +kubebuilder:printcolumn:name="Mode",type=string,JSONPath=`.spec.backupMode`,description="the mode of backup, such as snapshot, log." +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`,description="The current status of the backup" +kubebuilder:printcolumn:name="BackupPath",type=string,JSONPath=`.status.backupPath`,description="The full path of backup data" +kubebuilder:printcolumn:name="BackupSize",type=string,JSONPath=`.status.backupSizeReadable`,description="The data size of the backup" +kubebuilder:printcolumn:name="IncrementalBackupSize",type=string,JSONPath=`.status.incrementalBackupSizeReadable`,description="The real size of volume snapshot backup, only valid to volume snapshot backup",priority=10 +kubebuilder:printcolumn:name="CommitTS",type=string,JSONPath=`.status.commitTs`,description="The commit ts of the backup" +kubebuilder:printcolumn:name="LogTruncateUntil",type=string,JSONPath=`.status.logSuccessTruncateUntil`,description="The log backup truncate until ts" +kubebuilder:printcolumn:name="Started",type=date,JSONPath=`.status.timeStarted`,description="The time at which the backup was started",priority=1 +kubebuilder:printcolumn:name="Completed",type=date,JSONPath=`.status.timeCompleted`,description="The time at which the backup was completed",priority=1 +kubebuilder:printcolumn:name="TimeTaken",type=string,JSONPath=`.status.timeTaken`,description="The time that the backup takes" +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*Backup) DeepCopy

func (in *Backup) DeepCopy() *Backup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backup.

func (*Backup) DeepCopyInto

func (in *Backup) DeepCopyInto(out *Backup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Backup) DeepCopyObject

func (in *Backup) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Backup) GetAllLogBackupJobName added in v1.4.0

func (bk *Backup) GetAllLogBackupJobName() []string

GetAllLogBackupJobName return the all log backup job name

func (*Backup) GetBackupJobName

func (bk *Backup) GetBackupJobName() string

GetBackupJobName return the backup job name

func (*Backup) GetBackupPVCName

func (bk *Backup) GetBackupPVCName() string

GetBackupPVCName return the backup pvc name

func (*Backup) GetCleanJobName

func (bk *Backup) GetCleanJobName() string

GetCleanJobName return the clean job name

func (*Backup) GetCleanOption

func (bk *Backup) GetCleanOption() CleanOption

GetCleanOption return the clean option

func (*Backup) GetInstanceName

func (bk *Backup) GetInstanceName() string

GetInstanceName return the backup instance name

func (*Backup) GetTidbEndpointHash

func (bk *Backup) GetTidbEndpointHash() string

GetTidbEndpointHash return the hash string base on tidb cluster's host and port

func (*Backup) GetVolumeBackupInitializeJobName added in v1.5.0

func (bk *Backup) GetVolumeBackupInitializeJobName() string

type BackupCondition

type BackupCondition struct {
	Command LogSubCommandType      `json:"command,omitempty"`
	Type    BackupConditionType    `json:"type"`
	Status  corev1.ConditionStatus `json:"status"`
	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	Reason             string      `json:"reason,omitempty"`
	Message            string      `json:"message,omitempty"`
}

BackupCondition describes the observed state of a Backup at a certain point.

func GetBackupCondition

func GetBackupCondition(status *BackupStatus, conditionType BackupConditionType) (int, *BackupCondition)

GetBackupCondition get the specify type's BackupCondition from the given BackupStatus

func (*BackupCondition) DeepCopy

func (in *BackupCondition) DeepCopy() *BackupCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupCondition.

func (*BackupCondition) DeepCopyInto

func (in *BackupCondition) DeepCopyInto(out *BackupCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupConditionType

type BackupConditionType string

BackupConditionType represents a valid condition of a Backup.

const (
	// BackupScheduled means the backup related job has been created
	BackupScheduled BackupConditionType = "Scheduled"
	// BackupRunning means the backup is currently being executed.
	BackupRunning BackupConditionType = "Running"
	// BackupComplete means the backup has successfully executed and the
	// resulting artifact has been stored in backend storage.
	BackupComplete BackupConditionType = "Complete"
	// BackupClean means the clean job has been created to clean backup data
	BackupClean BackupConditionType = "Clean"
	// BackupFailed means the backup has failed.
	BackupFailed BackupConditionType = "Failed"
	// BackupRetryTheFailed means this failure can be retried
	BackupRetryTheFailed BackupConditionType = "RetryFailed"
	// BackupCleanFailed means the clean job has failed
	BackupCleanFailed BackupConditionType = "CleanFailed"
	// BackupInvalid means invalid backup CR
	BackupInvalid BackupConditionType = "Invalid"
	// BackupPrepare means the backup prepare backup process
	BackupPrepare BackupConditionType = "Prepare"
	// BackupStopped means the backup was stopped, just log backup has this condition
	BackupStopped BackupConditionType = "Stopped"
	// BackupRestart means the backup was restarted, now just support snapshot backup
	BackupRestart BackupConditionType = "Restart"
	// VolumeBackupInitialized means the volume backup has stopped GC and PD scheduler
	VolumeBackupInitialized BackupConditionType = "VolumeBackupInitialized"
	// VolumeBackupInitializeFailed means the volume backup initialize job failed
	VolumeBackupInitializeFailed BackupConditionType = "VolumeBackupInitializeFailed"
	// VolumeBackupSnapshotsCreated means the local volume snapshots created, and they won't be changed
	VolumeBackupSnapshotsCreated BackupConditionType = "VolumeBackupSnapshotsCreated"
	// VolumeBackupInitializeComplete means the volume backup has safely resumed GC and PD scheduler
	VolumeBackupInitializeComplete BackupConditionType = "VolumeBackupInitializeComplete"
	// VolumeBackupComplete means the volume backup has taken volume snapshots successfully
	VolumeBackupComplete BackupConditionType = "VolumeBackupComplete"
	// VolumeBackupFailed means the volume backup take volume snapshots failed
	VolumeBackupFailed BackupConditionType = "VolumeBackupFailed"
)

type BackupList

type BackupList struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ListMeta `json:"metadata"`

	Items []Backup `json:"items"`
}

+k8s:openapi-gen=true BackupList contains a list of Backup.

func (*BackupList) DeepCopy

func (in *BackupList) DeepCopy() *BackupList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupList.

func (*BackupList) DeepCopyInto

func (in *BackupList) DeepCopyInto(out *BackupList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupList) DeepCopyObject

func (in *BackupList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupMode added in v1.4.0

type BackupMode string

BackupType represents the backup mode, such as snapshot backup or log backup. +k8s:openapi-gen=true

const (
	// BackupModeSnapshot represents the snapshot backup of tidb cluster.
	BackupModeSnapshot BackupMode = "snapshot"
	// BackupModeLog represents the log backup of tidb cluster.
	BackupModeLog BackupMode = "log"
	// BackupModeVolumeSnapshot represents volume backup of tidb cluster.
	BackupModeVolumeSnapshot BackupMode = "volume-snapshot"
)

type BackupSchedule

type BackupSchedule struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata"`

	Spec BackupScheduleSpec `json:"spec"`
	// +k8s:openapi-gen=false
	Status BackupScheduleStatus `json:"status,omitempty"`
}

BackupSchedule is a backup schedule of tidb cluster.

+k8s:openapi-gen=true +kubebuilder:resource:shortName="bks" +kubebuilder:printcolumn:name="Schedule",type=string,JSONPath=`.spec.schedule`,description="The cron format string used for backup scheduling" +kubebuilder:printcolumn:name="MaxBackups",type=integer,JSONPath=`.spec.maxBackups`,description="The max number of backups we want to keep" +kubebuilder:printcolumn:name="MaxReservedTime",type=string,JSONPath=`.spec.maxReservedTime`,description="How long backups we want to keep" +kubebuilder:printcolumn:name="LastBackup",type=string,JSONPath=`.status.lastBackup`,description="The last backup CR name",priority=1 +kubebuilder:printcolumn:name="LastBackupTime",type=date,JSONPath=`.status.lastBackupTime`,description="The last time the backup was successfully created",priority=1 +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*BackupSchedule) DeepCopy

func (in *BackupSchedule) DeepCopy() *BackupSchedule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSchedule.

func (*BackupSchedule) DeepCopyInto

func (in *BackupSchedule) DeepCopyInto(out *BackupSchedule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupSchedule) DeepCopyObject

func (in *BackupSchedule) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*BackupSchedule) GetBackupCRDName

func (bs *BackupSchedule) GetBackupCRDName(timestamp time.Time) string

func (*BackupSchedule) GetLogBackupCRDName added in v1.4.4

func (bs *BackupSchedule) GetLogBackupCRDName() string

type BackupScheduleList

type BackupScheduleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []BackupSchedule `json:"items"`
}

+k8s:openapi-gen=true BackupScheduleList contains a list of BackupSchedule.

func (*BackupScheduleList) DeepCopy

func (in *BackupScheduleList) DeepCopy() *BackupScheduleList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupScheduleList.

func (*BackupScheduleList) DeepCopyInto

func (in *BackupScheduleList) DeepCopyInto(out *BackupScheduleList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BackupScheduleList) DeepCopyObject

func (in *BackupScheduleList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BackupScheduleSpec

type BackupScheduleSpec struct {
	// Schedule specifies the cron string used for backup scheduling.
	Schedule string `json:"schedule"`
	// Pause means paused backupSchedule
	Pause bool `json:"pause,omitempty"`
	// MaxBackups is to specify how many backups we want to keep
	// 0 is magic number to indicate un-limited backups.
	// if MaxBackups and MaxReservedTime are set at the same time, MaxReservedTime is preferred
	// and MaxBackups is ignored.
	MaxBackups *int32 `json:"maxBackups,omitempty"`
	// MaxReservedTime is to specify how long backups we want to keep.
	MaxReservedTime *string `json:"maxReservedTime,omitempty"`
	// BackupTemplate is the specification of the backup structure to get scheduled.
	BackupTemplate BackupSpec `json:"backupTemplate"`
	// LogBackupTemplate is the specification of the log backup structure to get scheduled.
	// +optional
	LogBackupTemplate *BackupSpec `json:"logBackupTemplate"`
	// The storageClassName of the persistent volume for Backup data storage if not storage class name set in BackupSpec.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`
	// StorageSize is the request storage size for backup job
	StorageSize string `json:"storageSize,omitempty"`
	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}

+k8s:openapi-gen=true BackupScheduleSpec contains the backup schedule specification for a tidb cluster.

func (*BackupScheduleSpec) DeepCopy

func (in *BackupScheduleSpec) DeepCopy() *BackupScheduleSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupScheduleSpec.

func (*BackupScheduleSpec) DeepCopyInto

func (in *BackupScheduleSpec) DeepCopyInto(out *BackupScheduleSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupScheduleStatus

type BackupScheduleStatus struct {
	// LastBackup represents the last backup.
	LastBackup string `json:"lastBackup,omitempty"`
	// logBackup represents the name of log backup.
	LogBackup *string `json:"logBackup,omitempty"`
	// LastBackupTime represents the last time the backup was successfully created.
	LastBackupTime *metav1.Time `json:"lastBackupTime,omitempty"`
	// AllBackupCleanTime represents the time when all backup entries are cleaned up
	AllBackupCleanTime *metav1.Time `json:"allBackupCleanTime,omitempty"`
}

BackupScheduleStatus represents the current state of a BackupSchedule.

func (*BackupScheduleStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupScheduleStatus.

func (*BackupScheduleStatus) DeepCopyInto

func (in *BackupScheduleStatus) DeepCopyInto(out *BackupScheduleStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupSpec

type BackupSpec struct {
	corev1.ResourceRequirements `json:"resources,omitempty"`
	// List of environment variables to set in the container, like v1.Container.Env.
	// Note that the following builtin env vars will be overwritten by values set here
	// - S3_PROVIDER
	// - S3_ENDPOINT
	// - AWS_REGION
	// - AWS_ACL
	// - AWS_STORAGE_CLASS
	// - AWS_DEFAULT_REGION
	// - AWS_ACCESS_KEY_ID
	// - AWS_SECRET_ACCESS_KEY
	// - GCS_PROJECT_ID
	// - GCS_OBJECT_ACL
	// - GCS_BUCKET_ACL
	// - GCS_LOCATION
	// - GCS_STORAGE_CLASS
	// - GCS_SERVICE_ACCOUNT_JSON_KEY
	// - BR_LOG_TO_TERM
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`
	// From is the tidb cluster that needs to backup.
	From *TiDBAccessConfig `json:"from,omitempty"`
	// Type is the backup type for tidb cluster and only used when Mode = snapshot, such as full, db, table.
	Type BackupType `json:"backupType,omitempty"`
	// Mode is the backup mode, such as snapshot backup or log backup.
	// +kubebuilder:default=snapshot
	Mode BackupMode `json:"backupMode,omitempty"`
	// TikvGCLifeTime is to specify the safe gc life time for backup.
	// The time limit during which data is retained for each GC, in the format of Go Duration.
	// When a GC happens, the current time minus this value is the safe point.
	TikvGCLifeTime *string `json:"tikvGCLifeTime,omitempty"`
	// StorageProvider configures where and how backups should be stored.
	StorageProvider `json:",inline"`
	// The storageClassName of the persistent volume for Backup data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`
	// StorageSize is the request storage size for backup job
	StorageSize string `json:"storageSize,omitempty"`
	// BRConfig is the configs for BR
	BR *BRConfig `json:"br,omitempty"`
	// CommitTs is the commit ts of the backup, snapshot ts for full backup or start ts for log backup.
	// Format supports TSO or datetime, e.g. '400036290571534337', '2018-05-11 01:42:23'.
	// Default is current timestamp.
	// +optional
	CommitTs string `json:"commitTs,omitempty"`
	// LogTruncateUntil is log backup truncate until timestamp.
	// Format supports TSO or datetime, e.g. '400036290571534337', '2018-05-11 01:42:23'.
	// +optional
	LogTruncateUntil string `json:"logTruncateUntil,omitempty"`
	// LogStop indicates that will stop the log backup.
	// +optional
	LogStop bool `json:"logStop,omitempty"`
	// CalcSizeLevel determines how to size calculation of snapshots for EBS volume snapshot backup
	// +optional
	// +kubebuilder:default="all"
	CalcSizeLevel string `json:"calcSizeLevel,omitempty"`
	// FederalVolumeBackupPhase indicates which phase to execute in federal volume backup
	// +optional
	FederalVolumeBackupPhase FederalVolumeBackupPhase `json:"federalVolumeBackupPhase,omitempty"`
	// ResumeGcSchedule indicates whether resume gc and pd scheduler for EBS volume snapshot backup
	// +optional
	ResumeGcSchedule bool `json:"resumeGcSchedule,omitempty"`
	// DumplingConfig is the configs for dumpling
	Dumpling *DumplingConfig `json:"dumpling,omitempty"`
	// Base tolerations of backup Pods, components may add more tolerations upon this respectively
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
	// ToolImage specifies the tool image used in `Backup`, which supports BR and Dumpling images.
	// For examples `spec.toolImage: pingcap/br:v4.0.8` or `spec.toolImage: pingcap/dumpling:v4.0.8`
	// For BR image, if it does not contain tag, Pod will use image 'ToolImage:${TiKV_Version}'.
	// +optional
	ToolImage string `json:"toolImage,omitempty"`
	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
	// TableFilter means Table filter expression for 'db.table' matching. BR supports this from v4.0.3.
	TableFilter []string `json:"tableFilter,omitempty"`
	// Affinity of backup Pods
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`
	// Use KMS to decrypt the secrets
	UseKMS bool `json:"useKMS,omitempty"`
	// Specify service account of backup
	ServiceAccount string `json:"serviceAccount,omitempty"`
	// CleanPolicy denotes whether to clean backup data when the object is deleted from the cluster, if not set, the backup data will be retained
	CleanPolicy CleanPolicyType `json:"cleanPolicy,omitempty"`
	// CleanOption controls the behavior of clean.
	CleanOption *CleanOption `json:"cleanOption,omitempty"`

	// PodSecurityContext of the component
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// PriorityClassName of Backup Job Pods
	PriorityClassName string `json:"priorityClassName,omitempty"`

	// BackoffRetryPolicy the backoff retry policy, currently only valid for snapshot backup
	BackoffRetryPolicy BackoffRetryPolicy `json:"backoffRetryPolicy,omitempty"`

	// Additional volumes of component pod.
	// +optional
	AdditionalVolumes []corev1.Volume `json:"additionalVolumes,omitempty"`
	// Additional volume mounts of component pod.
	// +optional
	AdditionalVolumeMounts []corev1.VolumeMount `json:"additionalVolumeMounts,omitempty"`
	// VolumeBackupInitJobMaxActiveSeconds represents the deadline (in seconds) of the vbk init job
	// +kubebuilder:default=600
	VolumeBackupInitJobMaxActiveSeconds int `json:"volumeBackupInitJobMaxActiveSeconds,omitempty"`
}

BackupSpec contains the backup specification for a tidb cluster. +k8s:openapi-gen=true

func (*BackupSpec) DeepCopy

func (in *BackupSpec) DeepCopy() *BackupSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSpec.

func (*BackupSpec) DeepCopyInto

func (in *BackupSpec) DeepCopyInto(out *BackupSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupStatus

type BackupStatus struct {
	// BackupPath is the location of the backup.
	BackupPath string `json:"backupPath,omitempty"`
	// TimeStarted is the time at which the backup was started.
	// TODO: remove nullable, https://github.com/kubernetes/kubernetes/issues/86811
	// +nullable
	TimeStarted metav1.Time `json:"timeStarted,omitempty"`
	// TimeCompleted is the time at which the backup was completed.
	// TODO: remove nullable, https://github.com/kubernetes/kubernetes/issues/86811
	// +nullable
	TimeCompleted metav1.Time `json:"timeCompleted,omitempty"`
	// TimeTaken is the time that backup takes, it is TimeCompleted - TimeStarted
	TimeTaken string `json:"timeTaken,omitempty"`
	// BackupSizeReadable is the data size of the backup.
	// the difference with BackupSize is that its format is human readable
	BackupSizeReadable string `json:"backupSizeReadable,omitempty"`
	// BackupSize is the data size of the backup.
	BackupSize int64 `json:"backupSize,omitempty"`
	// the difference with IncrementalBackupSize is that its format is human readable
	IncrementalBackupSizeReadable string `json:"incrementalBackupSizeReadable,omitempty"`
	// IncrementalBackupSize is the incremental data size of the backup, it is only used for volume snapshot backup
	// it is the real size of volume snapshot backup
	IncrementalBackupSize int64 `json:"incrementalBackupSize,omitempty"`
	// CommitTs is the commit ts of the backup, snapshot ts for full backup or start ts for log backup.
	CommitTs string `json:"commitTs,omitempty"`
	// LogSuccessTruncateUntil is log backup already successfully truncate until timestamp.
	LogSuccessTruncateUntil string `json:"logSuccessTruncateUntil,omitempty"`
	// LogCheckpointTs is the ts of log backup process.
	LogCheckpointTs string `json:"logCheckpointTs,omitempty"`
	// Phase is a user readable state inferred from the underlying Backup conditions
	Phase BackupConditionType `json:"phase,omitempty"`
	// +nullable
	Conditions []BackupCondition `json:"conditions,omitempty"`
	// LogSubCommandStatuses is the detail status of log backup subcommands, record each command separately, but only record the last command.
	LogSubCommandStatuses map[LogSubCommandType]LogSubCommandStatus `json:"logSubCommandStatuses,omitempty"`
	// Progresses is the progress of backup.
	// +nullable
	Progresses []Progress `json:"progresses,omitempty"`
	// BackoffRetryStatus is status of the backoff retry, it will be used when backup pod or job exited unexpectedly
	BackoffRetryStatus []BackoffRetryRecord `json:"backoffRetryStatus,omitempty"`
}

BackupStatus represents the current status of a backup.

func (*BackupStatus) DeepCopy

func (in *BackupStatus) DeepCopy() *BackupStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupStatus.

func (*BackupStatus) DeepCopyInto

func (in *BackupStatus) DeepCopyInto(out *BackupStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupStorageType

type BackupStorageType string

+k8s:openapi-gen=true BackupStorageType represents the backend storage type of backup.

const (
	// BackupStorageTypeS3 represents all storage that compatible with the Amazon S3.
	BackupStorageTypeS3 BackupStorageType = "s3"
	// BackupStorageTypeGcs represents the google cloud storage
	BackupStorageTypeGcs BackupStorageType = "gcs"
	// BackupStorageType represents the azure blob storage
	BackupStorageTypeAzblob BackupStorageType = "azblob"
	// BackupStorageTypeLocal represents local volume storage type
	BackupStorageTypeLocal BackupStorageType = "local"
	// BackupStorageTypeUnknown represents the unknown storage type
	BackupStorageTypeUnknown BackupStorageType = "unknown"
)

type BackupType

type BackupType string

BackupType represents the backup type. +k8s:openapi-gen=true

const (
	// BackupTypeFull represents the full backup of tidb cluster.
	BackupTypeFull BackupType = "full"
	// BackupTypeRaw represents the raw backup of tidb cluster.
	BackupTypeRaw BackupType = "raw"
	// BackupTypeDB represents the backup of one DB for the tidb cluster.
	BackupTypeDB BackupType = "db"
	// BackupTypeTable represents the backup of one table for the tidb cluster.
	BackupTypeTable BackupType = "table"
	// BackupTypeTiFlashReplica represents restoring the tiflash replica removed by a failed restore of the older version BR
	BackupTypeTiFlashReplica BackupType = "tiflash-replica"
)

type BasicAuth

type BasicAuth struct {
	// The secret in the service monitor namespace that contains the username
	// for authentication.
	Username corev1.SecretKeySelector `json:"username,omitempty"`
	// The secret in the service monitor namespace that contains the password
	// for authentication.
	Password corev1.SecretKeySelector `json:"password,omitempty"`
}

BasicAuth allow an endpoint to authenticate over basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints +k8s:openapi-gen=true

func (*BasicAuth) DeepCopy

func (in *BasicAuth) DeepCopy() *BasicAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth.

func (*BasicAuth) DeepCopyInto

func (in *BasicAuth) DeepCopyInto(out *BasicAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BasicAutoScalerSpec

type BasicAutoScalerSpec struct {
	// Rules defines the rules for auto-scaling with PD API
	Rules map[corev1.ResourceName]AutoRule `json:"rules,omitempty"`

	// ScaleInIntervalSeconds represents the duration seconds between each auto-scaling-in
	// If not set, the default ScaleInIntervalSeconds will be set to 500
	// +optional
	ScaleInIntervalSeconds *int32 `json:"scaleInIntervalSeconds,omitempty"`

	// ScaleOutIntervalSeconds represents the duration seconds between each auto-scaling-out
	// If not set, the default ScaleOutIntervalSeconds will be set to 300
	// +optional
	ScaleOutIntervalSeconds *int32 `json:"scaleOutIntervalSeconds,omitempty"`

	// External makes the auto-scaler controller able to query the external service
	// to fetch the recommended replicas for TiKV/TiDB
	// +optional
	External *ExternalConfig `json:"external,omitempty"`

	// Resources represent the resource type definitions that can be used for TiDB/TiKV
	// The key is resource_type name of the resource
	// +optional
	Resources map[string]AutoResource `json:"resources,omitempty"`
}

+k8s:openapi-gen=true BasicAutoScalerSpec describes the basic spec for auto-scaling

func (*BasicAutoScalerSpec) DeepCopy

func (in *BasicAutoScalerSpec) DeepCopy() *BasicAutoScalerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAutoScalerSpec.

func (*BasicAutoScalerSpec) DeepCopyInto

func (in *BasicAutoScalerSpec) DeepCopyInto(out *BasicAutoScalerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BasicAutoScalerStatus

type BasicAutoScalerStatus struct {
	// LastAutoScalingTimestamp describes the last auto-scaling timestamp for the component(tidb/tikv)
	// +optional
	LastAutoScalingTimestamp *metav1.Time `json:"lastAutoScalingTimestamp,omitempty"`
}

+k8s:openapi-gen=true BasicAutoScalerStatus describe the basic auto-scaling status

func (*BasicAutoScalerStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAutoScalerStatus.

func (*BasicAutoScalerStatus) DeepCopyInto

func (in *BasicAutoScalerStatus) DeepCopyInto(out *BasicAutoScalerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BatchDeleteOption

type BatchDeleteOption struct {
	// DisableBatchConcurrency disables the batch deletions with S3 API and the deletion will be done by goroutines.
	DisableBatchConcurrency bool `json:"disableBatchConcurrency,omitempty"`
	// BatchConcurrency represents the number of batch deletions in parallel.
	// It is used when the storage provider supports the batch delete API, currently, S3 only.
	// default is 10
	BatchConcurrency uint32 `json:"batchConcurrency,omitempty"`
	// RoutineConcurrency represents the number of goroutines that used to delete objects
	// default is 100
	RoutineConcurrency uint32 `json:"routineConcurrency,omitempty"`
}

BatchDeleteOption controls the options to delete the objects in batches during the cleanup of backups

+k8s:openapi-gen=true

func (*BatchDeleteOption) DeepCopy

func (in *BatchDeleteOption) DeepCopy() *BatchDeleteOption

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BatchDeleteOption.

func (*BatchDeleteOption) DeepCopyInto

func (in *BatchDeleteOption) DeepCopyInto(out *BatchDeleteOption)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Binlog

type Binlog struct {
	// optional
	Enable *bool `toml:"enable,omitempty" json:"enable,omitempty"`
	// Optional: Defaults to 15s
	// +optional
	WriteTimeout *string `toml:"write-timeout,omitempty" json:"write-timeout,omitempty"`
	// If IgnoreError is true, when writing binlog meets error, TiDB would
	// ignore the error.
	// +optional
	IgnoreError *bool `toml:"ignore-error,omitempty" json:"ignore-error,omitempty"`
	// Use socket file to write binlog, for compatible with kafka version tidb-binlog.
	// +optional
	BinlogSocket *string `toml:"binlog-socket,omitempty" json:"binlog-socket,omitempty"`
	// The strategy for sending binlog to pump, value can be "range,omitempty" or "hash,omitempty" now.
	// Optional: Defaults to range
	// +optional
	Strategy *string `toml:"strategy,omitempty" json:"strategy,omitempty"`
}

Binlog is the config for binlog. +k8s:openapi-gen=true

func (*Binlog) DeepCopy

func (in *Binlog) DeepCopy() *Binlog

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Binlog.

func (*Binlog) DeepCopyInto

func (in *Binlog) DeepCopyInto(out *Binlog)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CDCConfigWraper

type CDCConfigWraper struct {
	*config.GenericConfig `json:",inline"`
}

CDCConfigWraper simply wrapps a GenericConfig

func NewCDCConfig

func NewCDCConfig() *CDCConfigWraper

NewCDCConfig returns an empty config structure

func (*CDCConfigWraper) DeepCopy

func (in *CDCConfigWraper) DeepCopy() *CDCConfigWraper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDCConfigWraper.

func (*CDCConfigWraper) DeepCopyInto

func (in *CDCConfigWraper) DeepCopyInto(out *CDCConfigWraper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CDCConfigWraper) MarshalJSON

func (c *CDCConfigWraper) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler interface.

func (*CDCConfigWraper) MarshalTOML

func (c *CDCConfigWraper) MarshalTOML() ([]byte, error)

func (*CDCConfigWraper) OnlyOldItems

func (c *CDCConfigWraper) OnlyOldItems() bool

func (*CDCConfigWraper) UnmarshalJSON

func (c *CDCConfigWraper) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler interface. If the data is a object, we must use the Deprecated TiCDCConfig to Unmarshal for compatibility, if we use a map[string]interface{} to Unmarshal directly, we can not distinct the type between integer and float for toml.

type CleanOption

type CleanOption struct {
	// PageSize represents the number of objects to clean at a time.
	// default is 10000
	PageSize uint64 `json:"pageSize,omitempty"`
	// RetryCount represents the number of retries in pod when the cleanup fails.
	// +kubebuilder:default=5
	RetryCount int `json:"retryCount,omitempty"`
	// BackoffEnabled represents whether to enable the backoff when a deletion API fails.
	// It is useful when the deletion API is rate limited.
	BackoffEnabled bool `json:"backoffEnabled,omitempty"`

	BatchDeleteOption `json:",inline"`

	// SnapshotsDeleteRatio represents the number of snapshots deleted per second
	// +kubebuilder:default=1
	SnapshotsDeleteRatio float64 `json:"snapshotsDeleteRatio,omitempty"`
}

CleanOption defines the configuration for cleanup backup

+k8s:openapi-gen=true

func (*CleanOption) DeepCopy

func (in *CleanOption) DeepCopy() *CleanOption

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanOption.

func (*CleanOption) DeepCopyInto

func (in *CleanOption) DeepCopyInto(out *CleanOption)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CleanPolicyType

type CleanPolicyType string

+k8s:openapi-gen=true CleanPolicyType represents the clean policy of backup data in remote storage

const (
	// CleanPolicyTypeRetain represents that the backup data in remote storage will be retained when the Backup CR is deleted
	CleanPolicyTypeRetain CleanPolicyType = "Retain"
	// CleanPolicyTypeOnFailure represents that the backup data in remote storage will be cleaned only for the failed backups when the Backup CR is deleted
	CleanPolicyTypeOnFailure CleanPolicyType = "OnFailure"
	// CleanPolicyTypeDelete represents that the backup data in remote storage will be cleaned when the Backup CR is deleted
	CleanPolicyTypeDelete CleanPolicyType = "Delete"
)

type Cluster added in v1.3.7

type Cluster interface {
	metav1.Object

	// AllComponentSpec return all component specs
	AllComponentSpec() []ComponentAccessor
	// AllComponentStatus return all component status
	AllComponentStatus() []ComponentStatus
	// ComponentSpec return a component spec, return nil if not exist
	ComponentSpec(typ MemberType) ComponentAccessor
	// ComponentStatus return a component status, return nil if not exist
	ComponentStatus(typ MemberType) ComponentStatus
	// ComponentIsSuspending return true if the component's phase is `Suspend`
	ComponentIsSuspending(typ MemberType) bool
	// ComponentIsSuspended return true if the component's phase is `Suspend` and all resources is suspended
	ComponentIsSuspended(typ MemberType) bool
	// ComponentIsNormal return true if the component's phase is `Normal`
	ComponentIsNormal(typ MemberType) bool
}

type ClusterRef

type ClusterRef TidbClusterRef

+k8s:openapi-gen=true ClusterRef reference to a TidbCluster

func (*ClusterRef) DeepCopy

func (in *ClusterRef) DeepCopy() *ClusterRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRef.

func (*ClusterRef) DeepCopyInto

func (in *ClusterRef) DeepCopyInto(out *ClusterRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CommonConfig

type CommonConfig struct {
	// Optional: Defaults to "/data0/tmp"
	// +optional
	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 "/data0/db"
	// +optional
	// +k8s:openapi-gen=false
	FlashDataPath *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 9000
	// +optional
	// +k8s:openapi-gen=false
	TCPPortSecure *int32 `json:"tcp_port_secure,omitempty" toml:"tcp_port_secure,omitempty"`
	// Optional: Defaults to 8123
	// +optional
	// +k8s:openapi-gen=false
	HTTPSPort *int32 `json:"https_port,omitempty" toml:"https_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:"logger,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"`
	// +optional
	// +k8s:openapi-gen=false
	Security *FlashSecurity `json:"security,omitempty" toml:"security,omitempty"`
}

CommonConfig is the configuration of TiFlash process. +k8s:openapi-gen=true

func (*CommonConfig) DeepCopy

func (in *CommonConfig) DeepCopy() *CommonConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonConfig.

func (*CommonConfig) DeepCopyInto

func (in *CommonConfig) DeepCopyInto(out *CommonConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ComponentAccessor

type ComponentAccessor interface {
	MemberType() MemberType
	ImagePullPolicy() corev1.PullPolicy
	ImagePullSecrets() []corev1.LocalObjectReference
	HostNetwork() bool
	Affinity() *corev1.Affinity
	PriorityClassName() *string
	NodeSelector() map[string]string
	Labels() map[string]string
	Annotations() map[string]string
	Tolerations() []corev1.Toleration
	PodSecurityContext() *corev1.PodSecurityContext
	SchedulerName() string
	DnsPolicy() corev1.DNSPolicy
	ConfigUpdateStrategy() ConfigUpdateStrategy
	BuildPodSpec() corev1.PodSpec
	Env() []corev1.EnvVar
	EnvFrom() []corev1.EnvFromSource
	AdditionalContainers() []corev1.Container
	InitContainers() []corev1.Container
	AdditionalVolumes() []corev1.Volume
	AdditionalVolumeMounts() []corev1.VolumeMount
	TerminationGracePeriodSeconds() *int64
	StatefulSetUpdateStrategy() apps.StatefulSetUpdateStrategyType
	PodManagementPolicy() apps.PodManagementPolicyType
	TopologySpreadConstraints() []corev1.TopologySpreadConstraint
	SuspendAction() *SuspendAction
}

ComponentAccessor is the interface to access component details, which respects the cluster-level properties and component-level overrides

type ComponentSpec

type ComponentSpec struct {
	// (Deprecated) Image of the component
	// Use `baseImage` and `version` instead
	// +k8s:openapi-gen=false
	Image string `json:"image,omitempty"`

	// Version of the component. Override the cluster-level version if non-empty
	// Optional: Defaults to cluster-level setting
	// +optional
	Version *string `json:"version,omitempty"`

	// ImagePullPolicy of the component. Override the cluster-level imagePullPolicy if present
	// Optional: Defaults to cluster-level setting
	// +optional
	ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// Whether Hostnetwork of the component is enabled. Override the cluster-level setting if present
	// Optional: Defaults to cluster-level setting
	// +optional
	HostNetwork *bool `json:"hostNetwork,omitempty"`

	// Affinity of the component. Override the cluster-level setting if present.
	// Optional: Defaults to cluster-level setting
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// PriorityClassName of the component. Override the cluster-level one if present
	// Optional: Defaults to cluster-level setting
	// +optional
	PriorityClassName *string `json:"priorityClassName,omitempty"`

	// SchedulerName of the component. Override the cluster-level one if present
	// Optional: Defaults to cluster-level setting
	// +optional
	SchedulerName *string `json:"schedulerName,omitempty"`

	// NodeSelector of the component. Merged into the cluster-level nodeSelector if non-empty
	// Optional: Defaults to cluster-level setting
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Annotations for the component. Merge into the cluster-level annotations if non-empty
	// Optional: Defaults to cluster-level setting
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Labels for the component. Merge into the cluster-level labels if non-empty
	// Optional: Defaults to cluster-level setting
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// Tolerations of the component. Override the cluster-level tolerations if non-empty
	// Optional: Defaults to cluster-level setting
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// PodSecurityContext of the component
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// ConfigUpdateStrategy of the component. Override the cluster-level updateStrategy if present
	// Optional: Defaults to cluster-level setting
	// +optional
	ConfigUpdateStrategy *ConfigUpdateStrategy `json:"configUpdateStrategy,omitempty"`

	// List of environment variables to set in the container, like v1.Container.Env.
	// Note that the following env names cannot be used and will be overridden by TiDB Operator builtin envs
	// - NAMESPACE
	// - TZ
	// - SERVICE_NAME
	// - PEER_SERVICE_NAME
	// - HEADLESS_SERVICE_NAME
	// - SET_NAME
	// - HOSTNAME
	// - CLUSTER_NAME
	// - POD_NAME
	// - BINLOG_ENABLED
	// - SLOW_LOG_FILE
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`

	// Extend the use scenarios for env
	// +optional
	EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`

	// Init containers of the components
	// +optional
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// Additional containers of the component.
	// If the container names in this field match with the ones generated by
	// TiDB Operator, the container configurations will be merged into the
	// containers generated by TiDB Operator via strategic merge patch.
	// If the container names in this field do not match with the ones
	// generated by TiDB Operator, the container configurations will be
	// appended to the Pod container spec directly.
	// +optional
	AdditionalContainers []corev1.Container `json:"additionalContainers,omitempty"`

	// Additional volumes of component pod.
	// +optional
	AdditionalVolumes []corev1.Volume `json:"additionalVolumes,omitempty"`

	// Additional volume mounts of component pod.
	AdditionalVolumeMounts []corev1.VolumeMount `json:"additionalVolumeMounts,omitempty"`

	// DNSConfig Specifies the DNS parameters of a pod.
	// +optional
	DNSConfig *corev1.PodDNSConfig `json:"dnsConfig,omitempty"`

	// DNSPolicy Specifies the DNSPolicy parameters of a pod.
	// +optional
	DNSPolicy corev1.DNSPolicy `json:"dnsPolicy,omitempty"`

	// Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request.
	// Value must be non-negative integer. The value zero indicates delete immediately.
	// If this value is nil, the default grace period will be used instead.
	// The grace period is the duration in seconds after the processes running in the pod are sent
	// a termination signal and the time when the processes are forcibly halted with a kill signal.
	// Set this value longer than the expected cleanup time for your process.
	// Defaults to 30 seconds.
	// +optional
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`

	// StatefulSetUpdateStrategy indicates the StatefulSetUpdateStrategy that will be
	// employed to update Pods in the StatefulSet when a revision is made to
	// Template.
	// +optional
	StatefulSetUpdateStrategy apps.StatefulSetUpdateStrategyType `json:"statefulSetUpdateStrategy,omitempty"`

	// PodManagementPolicy of TiDB cluster StatefulSets
	// +optional
	PodManagementPolicy apps.PodManagementPolicyType `json:"podManagementPolicy,omitempty"`

	// TopologySpreadConstraints describes how a group of pods ought to spread across topology
	// domains. Scheduler will schedule pods in a way which abides by the constraints.
	// This field is is only honored by clusters that enables the EvenPodsSpread feature.
	// All topologySpreadConstraints are ANDed.
	// +optional
	// +listType=map
	// +listMapKey=topologyKey
	TopologySpreadConstraints []TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`

	// SuspendAction defines the suspend actions for all component.
	// +optional
	SuspendAction *SuspendAction `json:"suspendAction,omitempty"`

	// ReadinessProbe describes actions that probe the components' readiness.
	// the default behavior is like setting type as "tcp"
	// +optional
	ReadinessProbe *Probe `json:"readinessProbe,omitempty"`
}

ComponentSpec is the base spec of each component, the fields should always accessed by the Basic<Component>Spec() method to respect the cluster-level properties +k8s:openapi-gen=true

func (*ComponentSpec) DeepCopy

func (in *ComponentSpec) DeepCopy() *ComponentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentSpec.

func (*ComponentSpec) DeepCopyInto

func (in *ComponentSpec) DeepCopyInto(out *ComponentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ComponentStatus added in v1.3.6

type ComponentStatus interface {
	MemberType() MemberType
	// GetSynced returns `status.synced`
	//
	// For tidb and pump, it is always true.
	GetSynced() bool
	// GetPhase returns `status.phase`
	GetPhase() MemberPhase
	// GetVolumes return `status.volumes`
	//
	// NOTE: change the map will modify the status.
	GetVolumes() map[StorageVolumeName]*StorageVolumeStatus
	// GetConditions returns `status.conditions`
	//
	// If need to change the condition, please use `SetCondition`
	GetConditions() []metav1.Condition
	// GetStatefulSet returns `status.statefulset`
	//
	// NOTE: change the return will modify the status.
	GetStatefulSet() *appsv1.StatefulSetStatus
	// GetVolReplaceInProgress gets the status.VolReplaceInProgress
	GetVolReplaceInProgress() bool

	// SetSynced set the `status.synced` field of the component
	//
	// Not supported for tidb and pump
	SetSynced(bool)
	// SetPhase sets the phase of the component.
	SetPhase(phase MemberPhase)
	// SetVolumes sets the `status.volumes`
	SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)
	// SetCondition sets the corresponding condition in conditions to newCondition.
	// 1. if the condition of the specified type already exists (all fields of the existing condition are updated to
	//    newCondition, LastTransitionTime is set to now if the new status differs from the old status)
	// 2. if a condition of the specified type does not exist (LastTransitionTime is set to now() if unset, and newCondition is appended)
	SetCondition(condition metav1.Condition)
	// RemoveCondition removes the corresponding conditionType from conditions.
	RemoveCondition(conditionType string)
	// SetStatefulSet sets the `status.statefulset`
	SetStatefulSet(sts *appsv1.StatefulSetStatus)
	// SetVolReplaceInProgress sets the status.VolReplaceInProgress
	SetVolReplaceInProgress(status bool)
}

type ConfigMapRef

type ConfigMapRef struct {
	Name string `json:"name,omitempty"`

	// +optional
	// if the namespace is omitted, the operator controller would use the Tidbmonitor's namespace instead.
	Namespace *string `json:"namespace,omitempty"`
}

ConfigMapRef is the external configMap +k8s:openapi-gen=true

func (*ConfigMapRef) DeepCopy

func (in *ConfigMapRef) DeepCopy() *ConfigMapRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapRef.

func (*ConfigMapRef) DeepCopyInto

func (in *ConfigMapRef) DeepCopyInto(out *ConfigMapRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConfigUpdateStrategy

type ConfigUpdateStrategy string

ConfigUpdateStrategy represents the strategy to update configuration

const (
	// ConfigUpdateStrategyInPlace update the configmap without changing the name
	ConfigUpdateStrategyInPlace ConfigUpdateStrategy = "InPlace"
	// ConfigUpdateStrategyRollingUpdate generate different configmap on configuration update and
	// try to rolling-update the pod controller (e.g. statefulset) to apply updates.
	ConfigUpdateStrategyRollingUpdate ConfigUpdateStrategy = "RollingUpdate"
)

type ContainerName added in v1.3.7

type ContainerName string
const (
	ContainerSlowLogTailer    ContainerName = "slowlog"
	ContainerRocksDBLogTailer ContainerName = "rocksdblog"
	ContainerRaftLogTailer    ContainerName = "raftlog"
)

func (ContainerName) String added in v1.3.7

func (c ContainerName) String() string

type CoprocessorCache

type CoprocessorCache struct {
	// Whether to enable the copr cache. The copr cache saves the result from TiKV Coprocessor in the memory and
	// reuses the result when corresponding data in TiKV is unchanged, on a region basis.
	// +optional
	Enabled *bool `toml:"enable,omitempty" json:"enable,omitempty"`
	// The capacity in MB of the cache.
	// +optional
	CapacityMB *float64 `toml:"capacity-mb,omitempty" json:"capacity-mb,omitempty"`
	// Only cache requests whose result set is small.
	// +optional
	AdmissionMaxResultMB *float64 `toml:"admission-max-result-mb,omitempty" json:"admission-max-result-mb,omitempty"`
	// Only cache requests takes notable time to process.
	// +optional
	AdmissionMinProcessMs *uint64 `toml:"admission-min-process-ms,omitempty" json:"admission-min-process-ms,omitempty"`
}

CoprocessorCache is the config for coprocessor cache.

func (*CoprocessorCache) DeepCopy

func (in *CoprocessorCache) DeepCopy() *CoprocessorCache

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CoprocessorCache.

func (*CoprocessorCache) DeepCopyInto

func (in *CoprocessorCache) DeepCopyInto(out *CoprocessorCache)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CrdKind

type CrdKind struct {
	Kind                    string
	Plural                  string
	SpecName                string
	ShortNames              []string
	AdditionalPrinterColums []extensionsobj.CustomResourceColumnDefinition
}

func (*CrdKind) DeepCopy

func (in *CrdKind) DeepCopy() *CrdKind

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrdKind.

func (*CrdKind) DeepCopyInto

func (in *CrdKind) DeepCopyInto(out *CrdKind)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CrdKinds

type CrdKinds struct {
	KindsString           string
	TiDBCluster           CrdKind
	DMCluster             CrdKind
	Backup                CrdKind
	Restore               CrdKind
	BackupSchedule        CrdKind
	TiDBMonitor           CrdKind
	TiDBInitializer       CrdKind
	TidbClusterAutoScaler CrdKind
	TiDBNGMonitoring      CrdKind
}

func (*CrdKinds) DeepCopy

func (in *CrdKinds) DeepCopy() *CrdKinds

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrdKinds.

func (*CrdKinds) DeepCopyInto

func (in *CrdKinds) DeepCopyInto(out *CrdKinds)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CustomizedProbe added in v1.6.0

type CustomizedProbe struct {
	// Image is the image of the probe binary.
	// +required
	Image string `json:"image"`
	// BinaryName is the name of the probe binary.
	// +required
	BinaryName string `json:"binaryName"`
	// Args is the arguments of the probe binary.
	// +optional
	Args []string `json:"args"`
	// Number of seconds after the container has started before liveness probes are initiated.
	// +optional
	InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
	// Number of seconds after which the probe times out.
	// Defaults to 1 second. Minimum value is 1.
	// +optional
	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
	// How often (in seconds) to perform the probe.
	// Default to 10 seconds. Minimum value is 1.
	// +optional
	PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
	// Minimum consecutive successes for the probe to be considered successful after having failed.
	// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
	// +optional
	SuccessThreshold *int32 `json:"successThreshold,omitempty"`
	// Minimum consecutive failures for the probe to be considered failed after having succeeded.
	// Defaults to 3. Minimum value is 1.
	// +optional
	FailureThreshold *int32 `json:"failureThreshold,omitempty"`
}

func (*CustomizedProbe) DeepCopy added in v1.6.0

func (in *CustomizedProbe) DeepCopy() *CustomizedProbe

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomizedProbe.

func (*CustomizedProbe) DeepCopyInto added in v1.6.0

func (in *CustomizedProbe) DeepCopyInto(out *CustomizedProbe)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DMCluster

type DMCluster struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata"`

	// Spec defines the behavior of a dm cluster
	Spec DMClusterSpec `json:"spec"`

	// +k8s:openapi-gen=false
	// Most recently observed status of the dm cluster
	Status DMClusterStatus `json:"status,omitempty"`
}

DMCluster is the control script's spec

+k8s:openapi-gen=true +kubebuilder:resource:shortName="dc" +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` +kubebuilder:printcolumn:name="Master",type=string,JSONPath=`.status.master.image`,description="The image for dm-master cluster" +kubebuilder:printcolumn:name="Storage",type=string,JSONPath=`.spec.master.storageSize`,description="The storage size specified for dm-master node" +kubebuilder:printcolumn:name="Ready",type=integer,JSONPath=`.status.master.statefulSet.readyReplicas`,description="The ready replicas number of dm-master cluster" +kubebuilder:printcolumn:name="Desire",type=integer,JSONPath=`.spec.master.replicas`,description="The desired replicas number of dm-master cluster" +kubebuilder:printcolumn:name="Worker",type=string,JSONPath=`.status.worker.image`,description="The image for dm-master cluster" +kubebuilder:printcolumn:name="Storage",type=string,JSONPath=`.spec.worker.storageSize`,description="The storage size specified for dm-worker node" +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.worker.statefulSet.readyReplicas`,description="The ready replicas number of dm-worker cluster" +kubebuilder:printcolumn:name="Desire",type=integer,JSONPath=`.spec.worker.replicas`,description="The desired replicas number of dm-worker cluster" +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].message`,priority=1 +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*DMCluster) AllComponentSpec added in v1.3.7

func (dc *DMCluster) AllComponentSpec() []ComponentAccessor

func (*DMCluster) AllComponentStatus added in v1.3.7

func (dc *DMCluster) AllComponentStatus() []ComponentStatus

func (*DMCluster) BaseDiscoverySpec

func (dc *DMCluster) BaseDiscoverySpec() ComponentAccessor

func (*DMCluster) BaseMasterSpec

func (dc *DMCluster) BaseMasterSpec() ComponentAccessor

func (*DMCluster) BaseWorkerSpec

func (dc *DMCluster) BaseWorkerSpec() ComponentAccessor

func (*DMCluster) ComponentIsNormal added in v1.3.7

func (dc *DMCluster) ComponentIsNormal(typ MemberType) bool

func (*DMCluster) ComponentIsSuspended added in v1.3.7

func (dc *DMCluster) ComponentIsSuspended(typ MemberType) bool

ComponentIsSuspended return true if the component's phase is `Suspend` and all resources is suspended

func (*DMCluster) ComponentIsSuspending added in v1.3.7

func (dc *DMCluster) ComponentIsSuspending(typ MemberType) bool

ComponentIsSuspending return true if the component's phase is `Suspend`

func (*DMCluster) ComponentSpec added in v1.3.7

func (dc *DMCluster) ComponentSpec(typ MemberType) ComponentAccessor

func (*DMCluster) ComponentStatus added in v1.3.7

func (dc *DMCluster) ComponentStatus(typ MemberType) ComponentStatus

func (*DMCluster) DeepCopy

func (in *DMCluster) DeepCopy() *DMCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DMCluster.

func (*DMCluster) DeepCopyInto

func (in *DMCluster) DeepCopyInto(out *DMCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DMCluster) DeepCopyObject

func (in *DMCluster) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*DMCluster) GetInstanceName

func (dc *DMCluster) GetInstanceName() string

func (*DMCluster) GetWorkerRecoverByUID

func (dc *DMCluster) GetWorkerRecoverByUID() types.UID

func (*DMCluster) IsPVReclaimEnabled

func (dc *DMCluster) IsPVReclaimEnabled() bool

func (*DMCluster) IsTLSClusterEnabled

func (dc *DMCluster) IsTLSClusterEnabled() bool

func (*DMCluster) MasterAllMembersReady

func (dc *DMCluster) MasterAllMembersReady() bool

func (*DMCluster) MasterAllPodsStarted

func (dc *DMCluster) MasterAllPodsStarted() bool

func (*DMCluster) MasterAutoFailovering

func (dc *DMCluster) MasterAutoFailovering() bool

func (*DMCluster) MasterImage

func (dc *DMCluster) MasterImage() string

func (*DMCluster) MasterIsAvailable

func (dc *DMCluster) MasterIsAvailable() bool

func (*DMCluster) MasterScaling

func (dc *DMCluster) MasterScaling() bool

func (*DMCluster) MasterStsActualReplicas

func (dc *DMCluster) MasterStsActualReplicas() int32

func (*DMCluster) MasterStsDesiredOrdinals

func (dc *DMCluster) MasterStsDesiredOrdinals(excludeFailover bool) sets.Int32

func (*DMCluster) MasterStsDesiredReplicas

func (dc *DMCluster) MasterStsDesiredReplicas() int32

func (*DMCluster) MasterUpgrading

func (dc *DMCluster) MasterUpgrading() bool

func (*DMCluster) MasterVersion

func (dc *DMCluster) MasterVersion() string

func (*DMCluster) Scheme

func (dc *DMCluster) Scheme() string

func (*DMCluster) Timezone

func (dc *DMCluster) Timezone() string

func (*DMCluster) WorkerAllMembersReady

func (dc *DMCluster) WorkerAllMembersReady() bool

func (*DMCluster) WorkerAllPodsStarted

func (dc *DMCluster) WorkerAllPodsStarted() bool

func (*DMCluster) WorkerImage

func (dc *DMCluster) WorkerImage() string

func (*DMCluster) WorkerStsActualReplicas

func (dc *DMCluster) WorkerStsActualReplicas() int32

func (*DMCluster) WorkerStsDesiredOrdinals

func (dc *DMCluster) WorkerStsDesiredOrdinals(excludeFailover bool) sets.Int32

func (*DMCluster) WorkerStsDesiredReplicas

func (dc *DMCluster) WorkerStsDesiredReplicas() int32

type DMClusterCondition

type DMClusterCondition struct {
	// Type of the condition.
	Type DMClusterConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status"`
	// The last time this condition was updated.
	// +nullable
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
	// Last time the condition transitioned from one status to another.
	// +nullable
	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// The reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`
	// A human readable message indicating details about the transition.
	// +optional
	Message string `json:"message,omitempty"`
}

DMClusterCondition is dm cluster condition

func (*DMClusterCondition) DeepCopy

func (in *DMClusterCondition) DeepCopy() *DMClusterCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DMClusterCondition.

func (*DMClusterCondition) DeepCopyInto

func (in *DMClusterCondition) DeepCopyInto(out *DMClusterCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DMClusterConditionType

type DMClusterConditionType string

DMClusterConditionType represents a dm cluster condition value.

const (
	// DMClusterReady indicates that the dm cluster is ready or not.
	// This is defined as:
	// - All statefulsets are up to date (currentRevision == updateRevision).
	// - All Master members are healthy.
	// - All Worker pods are up.
	DMClusterReady DMClusterConditionType = "Ready"
)

type DMClusterList

type DMClusterList struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ListMeta `json:"metadata"`

	Items []DMCluster `json:"items"`
}

+k8s:openapi-gen=true DMClusterList is DMCluster list

func (*DMClusterList) DeepCopy

func (in *DMClusterList) DeepCopy() *DMClusterList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DMClusterList.

func (*DMClusterList) DeepCopyInto

func (in *DMClusterList) DeepCopyInto(out *DMClusterList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DMClusterList) DeepCopyObject

func (in *DMClusterList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DMClusterSpec

type DMClusterSpec struct {
	// Discovery spec
	Discovery DMDiscoverySpec `json:"discovery,omitempty"`

	// dm-master cluster spec
	// +optional
	Master MasterSpec `json:"master"`

	// dm-worker cluster spec
	// +optional
	Worker *WorkerSpec `json:"worker,omitempty"`

	// Indicates that the dm cluster is paused and will not be processed by
	// the controller.
	// +optional
	Paused bool `json:"paused,omitempty"`

	// dm cluster version
	// +optional
	Version string `json:"version"`

	// SchedulerName of DM cluster Pods
	SchedulerName string `json:"schedulerName,omitempty"`

	// Persistent volume reclaim policy applied to the PVs that consumed by DM cluster
	// +kubebuilder:default=Retain
	PVReclaimPolicy *corev1.PersistentVolumeReclaimPolicy `json:"pvReclaimPolicy,omitempty"`

	// ImagePullPolicy of DM cluster Pods
	// +kubebuilder:default=IfNotPresent
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// ConfigUpdateStrategy determines how the configuration change is applied to the cluster.
	// UpdateStrategyInPlace will update the ConfigMap of configuration in-place and an extra rolling-update of the
	// cluster component is needed to reload the configuration change.
	// UpdateStrategyRollingUpdate will create a new ConfigMap with the new configuration and rolling-update the
	// related components to use the new ConfigMap, that is, the new configuration will be applied automatically.
	ConfigUpdateStrategy ConfigUpdateStrategy `json:"configUpdateStrategy,omitempty"`

	// Whether enable PVC reclaim for orphan PVC left by statefulset scale-in
	// Optional: Defaults to false
	// +optional
	EnablePVReclaim *bool `json:"enablePVReclaim,omitempty"`

	// Whether enable the TLS connection between DM server components
	// Optional: Defaults to nil
	// +optional
	TLSCluster *TLSCluster `json:"tlsCluster,omitempty"`

	// TLSClientSecretNames are the names of secrets which stores mysql/tidb server client certificates
	// that used by dm-master and dm-worker.
	// +optional
	TLSClientSecretNames []string `json:"tlsClientSecretNames,omitempty"`

	// Whether Hostnetwork is enabled for DM cluster Pods
	// Optional: Defaults to false
	// +optional
	HostNetwork *bool `json:"hostNetwork,omitempty"`

	// Affinity of DM cluster Pods
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// PriorityClassName of DM cluster Pods
	// Optional: Defaults to omitted
	// +optional
	PriorityClassName *string `json:"priorityClassName,omitempty"`

	// Base node selectors of DM cluster Pods, components may add or override selectors upon this respectively
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Additional annotations for the dm cluster
	// Can be overrode by annotations in master spec or worker spec
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Additional labels for the dm cluster
	// Can be overrode by labels in master spec or worker spec
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// Time zone of DM cluster Pods
	// Optional: Defaults to UTC
	// +optional
	Timezone string `json:"timezone,omitempty"`

	// Base tolerations of DM cluster Pods, components may add more tolerations upon this respectively
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// DNSConfig Specifies the DNS parameters of a pod.
	// +optional
	DNSConfig *corev1.PodDNSConfig `json:"dnsConfig,omitempty"`

	// DNSPolicy Specifies the DNSPolicy parameters of a pod.
	// +optional
	DNSPolicy corev1.DNSPolicy `json:"dnsPolicy,omitempty"`

	// PodSecurityContext of the component
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// StatefulSetUpdateStrategy of DM cluster StatefulSets
	// +optional
	StatefulSetUpdateStrategy apps.StatefulSetUpdateStrategyType `json:"statefulSetUpdateStrategy,omitempty"`

	// PodManagementPolicy of DM cluster StatefulSets
	// +optional
	PodManagementPolicy apps.PodManagementPolicyType `json:"podManagementPolicy,omitempty"`

	// TopologySpreadConstraints describes how a group of pods ought to spread across topology
	// domains. Scheduler will schedule pods in a way which abides by the constraints.
	// This field is is only honored by clusters that enables the EvenPodsSpread feature.
	// All topologySpreadConstraints are ANDed.
	// +optional
	// +listType=map
	// +listMapKey=topologyKey
	TopologySpreadConstraints []TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`

	// SuspendAction defines the suspend actions for all component.
	// +optional
	SuspendAction *SuspendAction `json:"suspendAction,omitempty"`

	// PreferIPv6 indicates whether to prefer IPv6 addresses for all components.
	PreferIPv6 bool `json:"preferIPv6,omitempty"`
}

+k8s:openapi-gen=true DMClusterSpec describes the attributes that a user creates on a dm cluster

func (*DMClusterSpec) DeepCopy

func (in *DMClusterSpec) DeepCopy() *DMClusterSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DMClusterSpec.

func (*DMClusterSpec) DeepCopyInto

func (in *DMClusterSpec) DeepCopyInto(out *DMClusterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DMClusterStatus

type DMClusterStatus struct {
	Master MasterStatus `json:"master,omitempty"`
	Worker WorkerStatus `json:"worker,omitempty"`

	// Represents the latest available observations of a dm cluster's state.
	// +optional
	// +nullable
	Conditions []DMClusterCondition `json:"conditions,omitempty"`
}

DMClusterStatus represents the current status of a dm cluster.

func (*DMClusterStatus) DeepCopy

func (in *DMClusterStatus) DeepCopy() *DMClusterStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DMClusterStatus.

func (*DMClusterStatus) DeepCopyInto

func (in *DMClusterStatus) DeepCopyInto(out *DMClusterStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DMDiscoverySpec

type DMDiscoverySpec struct {
	*ComponentSpec              `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// LivenessProbe describes actions that probe the discovery's liveness.
	// the default behavior is like setting type as "tcp"
	// NOTE: only used for TiDB Operator discovery now,
	// for other components, the auto failover feature may be used instead.
	// +optional
	LivenessProbe *Probe `json:"livenessProbe,omitempty"`

	// (Deprecated) Address indicates the existed TiDB discovery address
	// +k8s:openapi-gen=false
	Address string `json:"address,omitempty"`
}

+k8s:openapi-gen=true DMDiscoverySpec contains details of Discovery members for dm

func (*DMDiscoverySpec) DeepCopy

func (in *DMDiscoverySpec) DeepCopy() *DMDiscoverySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DMDiscoverySpec.

func (*DMDiscoverySpec) DeepCopyInto

func (in *DMDiscoverySpec) DeepCopyInto(out *DMDiscoverySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DMExperimental

type DMExperimental struct {
	// OpenAPI was introduced in DM V5.3.0
	OpenAPI bool `toml:"openapi,omitempty" json:"openapi,omitempty" yaml:"openapi,omitempty"`
}

DM experimental config +k8s:openapi-gen=true

func (*DMExperimental) DeepCopy

func (in *DMExperimental) DeepCopy() *DMExperimental

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DMExperimental.

func (*DMExperimental) DeepCopyInto

func (in *DMExperimental) DeepCopyInto(out *DMExperimental)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DMMonitorSpec

type DMMonitorSpec struct {
	Clusters    []ClusterRef    `json:"clusters"`
	Initializer InitializerSpec `json:"initializer"`
}

func (*DMMonitorSpec) DeepCopy

func (in *DMMonitorSpec) DeepCopy() *DMMonitorSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DMMonitorSpec.

func (*DMMonitorSpec) DeepCopyInto

func (in *DMMonitorSpec) DeepCopyInto(out *DMMonitorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DMSecurityConfig

type DMSecurityConfig struct {
	// SSLCA is the path of file that contains list of trusted SSL CAs.
	// +optional
	SSLCA *string `toml:"ssl-ca,omitempty" json:"ssl-ca,omitempty" yaml:"ssl-ca,omitempty"`
	// SSLCert is the path of file that contains X509 certificate in PEM format.
	// +optional
	SSLCert *string `toml:"ssl-cert,omitempty" json:"ssl-cert,omitempty" yaml:"ssl-cert,omitempty"`
	// SSLKey is the path of file that contains X509 key in PEM format.
	// +optional
	SSLKey *string `toml:"ssl-key,omitempty" json:"ssl-key,omitempty" yaml:"ssl-key,omitempty"`
	// CertAllowedCN is the Common Name that allowed
	// +optional
	CertAllowedCN []string `toml:"cert-allowed-cn,omitempty" json:"cert-allowed-cn,omitempty" yaml:"cert-allowed-cn,omitempty"`
}

DM common security config

func (*DMSecurityConfig) DeepCopy

func (in *DMSecurityConfig) DeepCopy() *DMSecurityConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DMSecurityConfig.

func (*DMSecurityConfig) DeepCopyInto

func (in *DMSecurityConfig) DeepCopyInto(out *DMSecurityConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DashboardConfig

type DashboardConfig struct {
	// +optional
	TiDBCAPath *string `toml:"tidb-cacert-path,omitempty" json:"tidb-cacert-path,omitempty"`
	// +optional
	TiDBCertPath *string `toml:"tidb-cert-path,omitempty" json:"tidb-cert-path,omitempty"`
	// +optional
	TiDBKeyPath *string `toml:"tidb-key-path,omitempty" json:"tidb-key-path,omitempty"`
	// +optional
	PublicPathPrefix *string `toml:"public-path-prefix,omitempty" json:"public-path-prefix,omitempty"`
	// +optional
	InternalProxy *bool `toml:"internal-proxy,omitempty" json:"internal-proxy,omitempty"`
	// When not disabled, usage data will be sent to PingCAP for improving user experience.
	// Optional: Defaults to false
	// +optional
	//+k8s:openapi-gen=false
	// Deprecated in PD v4.0.3, use EnableTelemetry instead
	DisableTelemetry *bool `toml:"disable-telemetry,omitempty" json:"disable-telemetry,omitempty"`
	// When enabled, usage data will be sent to PingCAP for improving user experience.
	// Optional: Defaults to true
	// +optional
	EnableTelemetry *bool `toml:"enable-telemetry,omitempty" json:"enable-telemetry,omitempty" default:"true"`
	// When enabled, experimental TiDB Dashboard features will be available.
	// These features are incomplete or not well tested. Suggest not to enable in
	// production.
	// Optional: Defaults to false
	// +optional
	EnableExperimental *bool `toml:"enable-experimental,omitempty" json:"enable-experimental,omitempty"`
}

DashboardConfig is the configuration for tidb-dashboard. +k8s:openapi-gen=true

func (*DashboardConfig) DeepCopy

func (in *DashboardConfig) DeepCopy() *DashboardConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DashboardConfig.

func (*DashboardConfig) DeepCopyInto

func (in *DashboardConfig) DeepCopyInto(out *DashboardConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DataResource

type DataResource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`

	Data []byte `json:"data"`
}

+k8s:openapi-gen=false DataResource is a generic custom resource for storing custom data

func (*DataResource) DeepCopy

func (in *DataResource) DeepCopy() *DataResource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataResource.

func (*DataResource) DeepCopyInto

func (in *DataResource) DeepCopyInto(out *DataResource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DataResource) DeepCopyObject

func (in *DataResource) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DataResourceList

type DataResourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []DataResource `json:"items"`
}

+k8s:openapi-gen=false DataResourceList contains a list of DataResource

func (*DataResourceList) DeepCopy

func (in *DataResourceList) DeepCopy() *DataResourceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataResourceList.

func (*DataResourceList) DeepCopyInto

func (in *DataResourceList) DeepCopyInto(out *DataResourceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DataResourceList) DeepCopyObject

func (in *DataResourceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DeploymentStorageStatus

type DeploymentStorageStatus struct {
	// PV name
	PvName string `json:"pvName,omitempty"`
}

DeploymentStorageStatus is the storage information of the deployment

func (*DeploymentStorageStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentStorageStatus.

func (*DeploymentStorageStatus) DeepCopyInto

func (in *DeploymentStorageStatus) DeepCopyInto(out *DeploymentStorageStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DiscoverySpec

type DiscoverySpec struct {
	*ComponentSpec              `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// LivenessProbe describes actions that probe the discovery's liveness.
	// the default behavior is like setting type as "tcp"
	// NOTE: only used for TiDB Operator discovery now,
	// for other components, the auto failover feature may be used instead.
	// +optional
	LivenessProbe *Probe `json:"livenessProbe,omitempty"`
}

+k8s:openapi-gen=true DiscoverySpec contains details of Discovery members

func (*DiscoverySpec) DeepCopy

func (in *DiscoverySpec) DeepCopy() *DiscoverySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoverySpec.

func (*DiscoverySpec) DeepCopyInto

func (in *DiscoverySpec) DeepCopyInto(out *DiscoverySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DumplingConfig

type DumplingConfig struct {
	// Options means options for backup data to remote storage with dumpling.
	Options []string `json:"options,omitempty"`
	// Deprecated. Please use `Spec.TableFilter` instead. TableFilter means Table filter expression for 'db.table' matching
	TableFilter []string `json:"tableFilter,omitempty"`
}

+k8s:openapi-gen=true DumplingConfig contains config for dumpling

func (*DumplingConfig) DeepCopy

func (in *DumplingConfig) DeepCopy() *DumplingConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DumplingConfig.

func (*DumplingConfig) DeepCopyInto

func (in *DumplingConfig) DeepCopyInto(out *DumplingConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EmptyStruct

type EmptyStruct struct{}

EmptyStruct is defined to delight controller-gen tools Only named struct is allowed by controller-gen

func (*EmptyStruct) DeepCopy

func (in *EmptyStruct) DeepCopy() *EmptyStruct

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmptyStruct.

func (*EmptyStruct) DeepCopyInto

func (in *EmptyStruct) DeepCopyInto(out *EmptyStruct)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EvictLeaderStatus

type EvictLeaderStatus struct {
	PodCreateTime metav1.Time `json:"podCreateTime,omitempty"`
	BeginTime     metav1.Time `json:"beginTime,omitempty"`
	Value         string      `json:"value,omitempty"`
}

func (*EvictLeaderStatus) DeepCopy

func (in *EvictLeaderStatus) DeepCopy() *EvictLeaderStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictLeaderStatus.

func (*EvictLeaderStatus) DeepCopyInto

func (in *EvictLeaderStatus) DeepCopyInto(out *EvictLeaderStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Experimental

type Experimental struct {
	// Whether enable the syntax like `auto_random(3)` on the primary key column.
	// Imported from TiDB v3.1.0.
	// Deprecated in TiDB v4.0.3, please check detail in https://docs.pingcap.com/tidb/dev/release-4.0.3#improvements.
	// +optional
	AllowAutoRandom *bool `toml:"allow-auto-random,omitempty" json:"allow-auto-random,omitempty"`
	// Whether enable creating expression index.
	// +optional
	AllowsExpressionIndex *bool `toml:"allow-expression-index,omitempty" json:"allow-expression-index,omitempty"`
}

Experimental controls the features that are still experimental: their semantics, interfaces are subject to change. Using these features in the production environment is not recommended. +k8s:openapi-gen=true

func (*Experimental) DeepCopy

func (in *Experimental) DeepCopy() *Experimental

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Experimental.

func (*Experimental) DeepCopyInto

func (in *Experimental) DeepCopyInto(out *Experimental)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExternalConfig

type ExternalConfig struct {
	// ExternalEndpoint makes the auto-scaler controller able to query the
	// external service to fetch the recommended replicas for TiKV/TiDB
	// +optional
	Endpoint ExternalEndpoint `json:"endpoint"`
	// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale out.
	MaxReplicas int32 `json:"maxReplicas"`
}

+k8s:openapi-gen=true ExternalConfig represents the external config.

func (*ExternalConfig) DeepCopy

func (in *ExternalConfig) DeepCopy() *ExternalConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalConfig.

func (*ExternalConfig) DeepCopyInto

func (in *ExternalConfig) DeepCopyInto(out *ExternalConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExternalEndpoint

type ExternalEndpoint struct {
	// Host indicates the external service's host
	Host string `json:"host"`
	// Port indicates the external service's port
	Port int32 `json:"port"`
	// Path indicates the external service's path
	Path string `json:"path"`
	// TLSSecret indicates the Secret which stores the TLS configuration. If set, the operator will use https
	// to communicate to the external service
	// +optional
	TLSSecret *SecretRef `json:"tlsSecret,omitempty"`
}

+k8s:openapi-gen=true ExternalEndpoint describes the external service endpoint which provides the ability to get the tikv/tidb auto-scaling recommended replicas

func (*ExternalEndpoint) DeepCopy

func (in *ExternalEndpoint) DeepCopy() *ExternalEndpoint

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalEndpoint.

func (*ExternalEndpoint) DeepCopyInto

func (in *ExternalEndpoint) DeepCopyInto(out *ExternalEndpoint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Failover

type Failover struct {
	// RecoverByUID indicates that TiDB Operator will recover the failover by this UID,
	// it takes effect only when set `spec.recoverFailover=false`
	// +optional
	RecoverByUID types.UID `json:"recoverByUID,omitempty"`
}

Failover contains the failover specification. +k8s:openapi-gen=true

func (*Failover) DeepCopy

func (in *Failover) DeepCopy() *Failover

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Failover.

func (*Failover) DeepCopyInto

func (in *Failover) DeepCopyInto(out *Failover)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FederalVolumeBackupPhase added in v1.5.0

type FederalVolumeBackupPhase string

FederalVolumeBackupPhase represents a phase to execute in federal volume backup

const (
	// FederalVolumeBackupInitialize means we should stop GC and PD schedule
	FederalVolumeBackupInitialize FederalVolumeBackupPhase = "initialize"
	// FederalVolumeBackupExecute means we should take volume snapshots for TiKV
	FederalVolumeBackupExecute FederalVolumeBackupPhase = "execute"
	// FederalVolumeBackupTeardown means we should resume GC and PD schedule
	FederalVolumeBackupTeardown FederalVolumeBackupPhase = "teardown"
)

type FederalVolumeRestorePhase added in v1.5.0

type FederalVolumeRestorePhase string

FederalVolumeRestorePhase represents a phase to execute in federal volume restore

const (
	// FederalVolumeRestoreVolume means restore volumes of TiKV and start TiKV
	FederalVolumeRestoreVolume FederalVolumeRestorePhase = "restore-volume"
	// FederalVolumeRestoreData means restore data of TiKV to resolved TS
	FederalVolumeRestoreData FederalVolumeRestorePhase = "restore-data"
	// FederalVolumeRestoreFinish means restart TiKV and set recoveryMode true
	FederalVolumeRestoreFinish FederalVolumeRestorePhase = "restore-finish"
)

type FileLogConfig

type FileLogConfig struct {
	// Log filename, leave empty to disable file log.
	// +optional
	Filename *string `toml:"filename,omitempty" json:"filename,omitempty"`
	// Deprecated in v4.0.0
	// Is log rotate enabled.
	// +optional
	LogRotate *bool `toml:"log-rotate,omitempty" json:"log-rotate,omitempty"`
	// Max size for a single file, in MB.
	// +optional
	MaxSize *int `toml:"max-size,omitempty" json:"max-size,omitempty"`
	// Max log keep days, default is never deleting.
	// +optional
	MaxDays *int `toml:"max-days,omitempty" json:"max-days,omitempty"`
	// Maximum number of old log files to retain.
	// +optional
	MaxBackups *int `toml:"max-backups,omitempty" json:"max-backups,omitempty"`
}

+k8s:openapi-gen=true

func (*FileLogConfig) DeepCopy

func (in *FileLogConfig) DeepCopy() *FileLogConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileLogConfig.

func (*FileLogConfig) DeepCopyInto

func (in *FileLogConfig) DeepCopyInto(out *FileLogConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Flash

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
	FlashProxy *FlashProxy `json:"proxy,omitempty" toml:"proxy,omitempty"`
}

Flash is the configuration of [flash] section. +k8s:openapi-gen=true

func (*Flash) DeepCopy

func (in *Flash) DeepCopy() *Flash

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Flash.

func (*Flash) DeepCopyInto

func (in *Flash) DeepCopyInto(out *Flash)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashApplication

type FlashApplication struct {
	// Optional: Defaults to true
	// +optional
	RunAsDaemon *bool `json:"runAsDaemon,omitempty" toml:"runAsDaemon,omitempty"`
}

FlashApplication is the configuration of [application] section. +k8s:openapi-gen=false

func (*FlashApplication) DeepCopy

func (in *FlashApplication) DeepCopy() *FlashApplication

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashApplication.

func (*FlashApplication) DeepCopyInto

func (in *FlashApplication) DeepCopyInto(out *FlashApplication)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashCluster

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 /data0/logs/flash_cluster_manager.log
	// +optional
	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"`
}

FlashCluster is the configuration of [flash.flash_cluster] section. +k8s:openapi-gen=true

func (*FlashCluster) DeepCopy

func (in *FlashCluster) DeepCopy() *FlashCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashCluster.

func (*FlashCluster) DeepCopyInto

func (in *FlashCluster) DeepCopyInto(out *FlashCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashLogger

type FlashLogger struct {
	// Optional: Defaults to /data0/logs/error.log
	// +optional
	ErrorLog *string `json:"errorlog,omitempty" toml:"errorlog,omitempty"`
	// Optional: Defaults to 100M
	// +optional
	Size *string `json:"size,omitempty" toml:"size,omitempty"`
	// Optional: Defaults to /data0/logs/server.log
	// +optional
	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"`
}

FlashLogger is the configuration of [logger] section. +k8s:openapi-gen=true

func (*FlashLogger) DeepCopy

func (in *FlashLogger) DeepCopy() *FlashLogger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashLogger.

func (*FlashLogger) DeepCopyInto

func (in *FlashLogger) DeepCopyInto(out *FlashLogger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashProfile

type FlashProfile struct {
	// +optional
	Readonly *Profile `json:"readonly,omitempty" toml:"readonly,omitempty"`
	// +optional
	Default *Profile `json:"default,omitempty" toml:"default,omitempty"`
}

FlashProfile is the configuration of [profiles] section. +k8s:openapi-gen=false

func (*FlashProfile) DeepCopy

func (in *FlashProfile) DeepCopy() *FlashProfile

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashProfile.

func (*FlashProfile) DeepCopyInto

func (in *FlashProfile) DeepCopyInto(out *FlashProfile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashProxy

type FlashProxy struct {
	// Optional: Defaults to 0.0.0.0:20170
	// +optional
	Addr *string `json:"addr,omitempty" toml:"addr,omitempty"`
	// Optional: Defaults to {clusterName}-tiflash-POD_NUM.{clusterName}-tiflash-peer.{namespace}:20170
	// +optional
	AdvertiseAddr *string `json:"advertise-addr,omitempty" toml:"advertise-addr,omitempty"`
	// Optional: Defaults to /data0/proxy
	// +optional
	DataDir *string `json:"data-dir,omitempty" toml:"data-dir,omitempty"`
	// Optional: Defaults to /data0/proxy.toml
	// +optional
	Config *string `json:"config,omitempty" toml:"config,omitempty"`
	// Optional: Defaults to /data0/logs/proxy.log
	// +optional
	LogFile *string `json:"log-file,omitempty" toml:"log-file,omitempty"`
}

FlashProxy is the configuration of [flash.proxy] section. +k8s:openapi-gen=true

func (*FlashProxy) DeepCopy

func (in *FlashProxy) DeepCopy() *FlashProxy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashProxy.

func (*FlashProxy) DeepCopyInto

func (in *FlashProxy) DeepCopyInto(out *FlashProxy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashQuota

type FlashQuota struct {
	// +optional
	Default *Quota `json:"default,omitempty" toml:"default,omitempty"`
}

FlashQuota is the configuration of [quotas] section. +k8s:openapi-gen=false

func (*FlashQuota) DeepCopy

func (in *FlashQuota) DeepCopy() *FlashQuota

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashQuota.

func (*FlashQuota) DeepCopyInto

func (in *FlashQuota) DeepCopyInto(out *FlashQuota)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashRaft

type FlashRaft struct {
	// +optional
	PDAddr *string `json:"pd_addr,omitempty" toml:"pd_addr,omitempty"`
	// Optional: Defaults to /data0/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"`
}

FlashRaft is the configuration of [raft] section. +k8s:openapi-gen=false

func (*FlashRaft) DeepCopy

func (in *FlashRaft) DeepCopy() *FlashRaft

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashRaft.

func (*FlashRaft) DeepCopyInto

func (in *FlashRaft) DeepCopyInto(out *FlashRaft)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashSecurity

type FlashSecurity struct {
	// +k8s:openapi-gen=false
	// Be set automatically by Operator
	// +optional
	CAPath *string `json:"ca_path,omitempty" toml:"ca_path,omitempty"`
	// +k8s:openapi-gen=false
	// Be set automatically by Operator
	// +optional
	CertPath *string `json:"cert_path,omitempty" toml:"cert_path,omitempty"`
	// +k8s:openapi-gen=false
	// Be set automatically by Operator
	// +optional
	KeyPath *string `json:"key_path,omitempty" toml:"key_path,omitempty"`
	// CertAllowedCN is the Common Name that allowed
	// +optional
	CertAllowedCN []string `json:"cert_allowed_cn,omitempty" toml:"cert_allowed_cn,omitempty"`
}

+k8s:openapi-gen=true

func (*FlashSecurity) DeepCopy

func (in *FlashSecurity) DeepCopy() *FlashSecurity

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashSecurity.

func (*FlashSecurity) DeepCopyInto

func (in *FlashSecurity) DeepCopyInto(out *FlashSecurity)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashServerConfig

type FlashServerConfig struct {
	// Default to {clusterName}-tiflash-POD_NUM.{clusterName}-tiflash-peer.{namespace}:3930
	// +optional
	EngineAddr *string `json:"engine-addr,omitempty" toml:"engine-addr,omitempty"`
	// Default to 0.0.0.0:20292
	// +optional
	StatusAddr *string `json:"status-addr,omitempty" toml:"status-addr,omitempty"`
	// Default to {clusterName}-tiflash-POD_NUM.{clusterName}-tiflash-peer.{namespace}:20292
	// +optional
	AdvertiseStatusAddr *string `json:"advertise-status-addr,omitempty" toml:"advertise-status-addr,omitempty"`
	TiKVServerConfig    `json:",inline"`
}

FlashServerConfig is the configuration of Proxy server. +k8s:openapi-gen=true

func (*FlashServerConfig) DeepCopy

func (in *FlashServerConfig) DeepCopy() *FlashServerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashServerConfig.

func (*FlashServerConfig) DeepCopyInto

func (in *FlashServerConfig) DeepCopyInto(out *FlashServerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashStatus

type FlashStatus struct {
	// Optional: Defaults to 8234
	// +optional
	MetricsPort *int32 `json:"metrics_port,omitempty" toml:"metrics_port,omitempty"`
}

FlashStatus is the configuration of [status] section. +k8s:openapi-gen=false

func (*FlashStatus) DeepCopy

func (in *FlashStatus) DeepCopy() *FlashStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashStatus.

func (*FlashStatus) DeepCopyInto

func (in *FlashStatus) DeepCopyInto(out *FlashStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FlashUser

type FlashUser struct {
	// +optional
	Readonly *User `json:"readonly,omitempty" toml:"readonly,omitempty"`
	Default  *User `json:"default,omitempty" toml:"default,omitempty"`
}

FlashUser is the configuration of [users] section. +k8s:openapi-gen=false

func (*FlashUser) DeepCopy

func (in *FlashUser) DeepCopy() *FlashUser

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlashUser.

func (*FlashUser) DeepCopyInto

func (in *FlashUser) DeepCopyInto(out *FlashUser)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GcsStorageProvider

type GcsStorageProvider struct {
	// ProjectId represents the project that organizes all your Google Cloud Platform resources
	ProjectId string `json:"projectId"`
	// Location in which the gcs bucket is located.
	Location string `json:"location,omitempty"`
	// Path is the full path where the backup is saved.
	// The format of the path must be: "<bucket-name>/<path-to-backup-file>"
	Path string `json:"path,omitempty"`
	// Bucket in which to store the backup data.
	Bucket string `json:"bucket,omitempty"`
	// StorageClass represents the storage class
	StorageClass string `json:"storageClass,omitempty"`
	// ObjectAcl represents the access control list for new objects
	ObjectAcl string `json:"objectAcl,omitempty"`
	// BucketAcl represents the access control list for new buckets
	BucketAcl string `json:"bucketAcl,omitempty"`
	// SecretName is the name of secret which stores the
	// gcs service account credentials JSON.
	SecretName string `json:"secretName,omitempty"`
	// Prefix of the data path.
	Prefix string `json:"prefix,omitempty"`
}

+k8s:openapi-gen=true GcsStorageProvider represents the google cloud storage for storing backups.

func (*GcsStorageProvider) DeepCopy

func (in *GcsStorageProvider) DeepCopy() *GcsStorageProvider

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GcsStorageProvider.

func (*GcsStorageProvider) DeepCopyInto

func (in *GcsStorageProvider) DeepCopyInto(out *GcsStorageProvider)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GrafanaSpec

type GrafanaSpec struct {
	MonitorContainer `json:",inline"`

	// Grafana log level
	LogLevel string `json:"logLevel,omitempty"`

	// Service defines a Kubernetes service of Grafana.
	Service ServiceSpec `json:"service,omitempty"`

	// +optional
	// if `UsernameSecret` is not set, `username` will be used.
	UsernameSecret *corev1.SecretKeySelector `json:"usernameSecret,omitempty"`

	// +optional
	// if `passwordSecret` is not set, `password` will be used.
	PasswordSecret *corev1.SecretKeySelector `json:"passwordSecret,omitempty"`

	// +optional
	// Deprecated in v1.3.0 for security concerns, planned for removal in v1.4.0. Use `usernameSecret` instead.
	// +k8s:openapi-gen=false
	Username string `json:"username,omitempty"`

	// +optional
	// Deprecated in v1.3.0 for security concerns, planned for removal in v1.4.0. Use `passwordSecret` instead.
	// +k8s:openapi-gen=false
	Password string `json:"password,omitempty"`

	// +optional
	Envs map[string]string `json:"envs,omitempty"`

	// Ingress configuration of Prometheus
	// +optional
	Ingress *IngressSpec `json:"ingress,omitempty"`

	// Additional volume mounts of grafana pod.
	AdditionalVolumeMounts []corev1.VolumeMount `json:"additionalVolumeMounts,omitempty"`
}

GrafanaSpec is the desired state of grafana

func (*GrafanaSpec) DeepCopy

func (in *GrafanaSpec) DeepCopy() *GrafanaSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaSpec.

func (*GrafanaSpec) DeepCopyInto

func (in *GrafanaSpec) DeepCopyInto(out *GrafanaSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HelperSpec

type HelperSpec struct {
	// 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. Recommended to set to 1.34.1 for new installations.
	// +optional
	Image *string `json:"image,omitempty"`

	// ImagePullPolicy of the component. Override the cluster-level imagePullPolicy if present
	// Optional: Defaults to the cluster-level setting
	// +optional
	ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

HelperSpec contains details of helper component +k8s:openapi-gen=true

func (*HelperSpec) DeepCopy

func (in *HelperSpec) DeepCopy() *HelperSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelperSpec.

func (*HelperSpec) DeepCopyInto

func (in *HelperSpec) DeepCopyInto(out *HelperSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IngressSpec

type IngressSpec struct {
	// Hosts describe the hosts for the ingress
	Hosts []string `json:"hosts"`
	// Annotations describe the desired annotations for the ingress
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// TLS configuration. Currently the Ingress only supports a single TLS
	// port, 443. If multiple members of this list specify different hosts, they
	// will be multiplexed on the same port according to the hostname specified
	// through the SNI TLS extension, if the ingress controller fulfilling the
	// ingress supports SNI.
	// +optional
	TLS []networkingv1.IngressTLS `json:"tls,omitempty"`
}

+k8s:openapi-gen=true IngressSpec describe the ingress desired state for the target component

func (*IngressSpec) DeepCopy

func (in *IngressSpec) DeepCopy() *IngressSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressSpec.

func (*IngressSpec) DeepCopyInto

func (in *IngressSpec) DeepCopyInto(out *IngressSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InitContainerSpec

type InitContainerSpec struct {
	corev1.ResourceRequirements `json:",inline"`
}

InitContainerSpec contains basic spec about a init container

+k8s:openapi-gen=true

func (*InitContainerSpec) DeepCopy

func (in *InitContainerSpec) DeepCopy() *InitContainerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitContainerSpec.

func (*InitContainerSpec) DeepCopyInto

func (in *InitContainerSpec) DeepCopyInto(out *InitContainerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InitializePhase

type InitializePhase string
const (
	// InitializePhasePending indicates that the initialization is still pending waiting the cluster to appear
	InitializePhasePending InitializePhase = "Pending"
	// InitializePhaseRunning indicates the the initialization is in progress
	InitializePhaseRunning InitializePhase = "Running"
	// InitializePhaseCompleted indicates the initialization is completed,
	// that is, the target tidb-cluster is fully initialized
	InitializePhaseCompleted InitializePhase = "Completed"
	// InitializePhaseFailed indicates the initialization is failed and need manual intervention
	InitializePhaseFailed InitializePhase = "Failed"
)

type InitializerSpec

type InitializerSpec struct {
	MonitorContainer `json:",inline"`
	// +optional
	Envs map[string]string `json:"envs,omitempty"`
}

InitializerSpec is the desired state of initializer

func (*InitializerSpec) DeepCopy

func (in *InitializerSpec) DeepCopy() *InitializerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitializerSpec.

func (*InitializerSpec) DeepCopyInto

func (in *InitializerSpec) DeepCopyInto(out *InitializerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Interval

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"`
}

Interval is the configuration of [quotas.default.interval] section. +k8s:openapi-gen=false

func (*Interval) DeepCopy

func (in *Interval) DeepCopy() *Interval

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Interval.

func (*Interval) DeepCopyInto

func (in *Interval) DeepCopyInto(out *Interval)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IsolationRead

type IsolationRead struct {
	// Engines filters tidb-server access paths by engine type.
	// imported from v3.1.0
	// +optional
	Engines []string `toml:"engines,omitempty" json:"engines,omitempty"`
}

IsolationRead is the config for isolation read. +k8s:openapi-gen=true

func (*IsolationRead) DeepCopy

func (in *IsolationRead) DeepCopy() *IsolationRead

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IsolationRead.

func (*IsolationRead) DeepCopyInto

func (in *IsolationRead) DeepCopyInto(out *IsolationRead)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalStorageProvider

type LocalStorageProvider struct {
	Volume      corev1.Volume      `json:"volume"`
	VolumeMount corev1.VolumeMount `json:"volumeMount"`
	Prefix      string             `json:"prefix,omitempty"`
}

LocalStorageProvider defines local storage options, which can be any k8s supported mounted volume

func (*LocalStorageProvider) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalStorageProvider.

func (*LocalStorageProvider) DeepCopyInto

func (in *LocalStorageProvider) DeepCopyInto(out *LocalStorageProvider)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Log

type Log struct {
	// Log level.
	// Optional: Defaults to info
	// +optional
	Level *string `toml:"level,omitempty" json:"level,omitempty"`
	// Log format. one of json, text, or console.
	// Optional: Defaults to text
	// +optional
	Format *string `toml:"format,omitempty" json:"format,omitempty"`
	// Deprecated in v3.0.5. Use EnableTimestamp instead
	// Disable automatic timestamps in output.
	// +optional
	DisableTimestamp *bool `toml:"disable-timestamp,omitempty" json:"disable-timestamp,omitempty"`
	// EnableTimestamp enables automatic timestamps in log output.
	// +optional
	EnableTimestamp *bool `toml:"enable-timestamp,omitempty" json:"enable-timestamp,omitempty"`
	// EnableErrorStack enables annotating logs with the full stack error
	// message.
	// +optional
	EnableErrorStack *bool `toml:"enable-error-stack,omitempty" json:"enable-error-stack,omitempty"`
	// File log config.
	// +optional
	File *FileLogConfig `toml:"file,omitempty" json:"file,omitempty"`
	// +optional
	EnableSlowLog *bool `toml:"enable-slow-log,omitempty" json:"enable-slow-log,omitempty"`
	// +optional
	SlowQueryFile *string `toml:"slow-query-file,omitempty" json:"slow-query-file,omitempty"`
	// Optional: Defaults to 300
	// +optional
	SlowThreshold *uint64 `toml:"slow-threshold,omitempty" json:"slow-threshold,omitempty"`
	// Optional: Defaults to 10000
	// +optional
	ExpensiveThreshold *uint `toml:"expensive-threshold,omitempty" json:"expensive-threshold,omitempty"`
	// Optional: Defaults to 2048
	// +optional
	QueryLogMaxLen *uint64 `toml:"query-log-max-len,omitempty" json:"query-log-max-len,omitempty"`
	// Optional: Defaults to 1
	// +optional
	RecordPlanInSlowLog *uint32 `toml:"record-plan-in-slow-log,omitempty" json:"record-plan-in-slow-log,omitempty"`
}

Log is the log section of config. +k8s:openapi-gen=true

func (*Log) DeepCopy

func (in *Log) DeepCopy() *Log

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Log.

func (*Log) DeepCopyInto

func (in *Log) DeepCopyInto(out *Log)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogSubCommandStatus added in v1.4.0

type LogSubCommandStatus struct {
	// Command is the log backup subcommand.
	Command LogSubCommandType `json:"command,omitempty"`
	// TimeStarted is the time at which the command was started.
	// TODO: remove nullable, https://github.com/kubernetes/kubernetes/issues/86811
	// +nullable
	TimeStarted metav1.Time `json:"timeStarted,omitempty"`
	// TimeCompleted is the time at which the command was completed.
	// TODO: remove nullable, https://github.com/kubernetes/kubernetes/issues/86811
	// +nullable
	TimeCompleted metav1.Time `json:"timeCompleted,omitempty"`
	// LogTruncatingUntil is log backup truncate until timestamp which is used to mark the truncate command.
	LogTruncatingUntil string `json:"logTruncatingUntil,omitempty"`
	// Phase is the command current phase.
	Phase BackupConditionType `json:"phase,omitempty"`
	// +nullable
	Conditions []BackupCondition `json:"conditions,omitempty"`
}

LogSubCommandStatus is the log backup subcommand's status.

func (*LogSubCommandStatus) DeepCopy added in v1.4.0

func (in *LogSubCommandStatus) DeepCopy() *LogSubCommandStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogSubCommandStatus.

func (*LogSubCommandStatus) DeepCopyInto added in v1.4.0

func (in *LogSubCommandStatus) DeepCopyInto(out *LogSubCommandStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogSubCommandType added in v1.4.0

type LogSubCommandType string

LogSubCommandType is the log backup subcommand type.

const (
	// LogStartCommand is the start command of log backup.
	LogStartCommand LogSubCommandType = "log-start"
	// LogTruncateCommand is the truncate command of log backup.
	LogTruncateCommand LogSubCommandType = "log-truncate"
	// LogStopCommand is the stop command of log backup.
	LogStopCommand LogSubCommandType = "log-stop"
)

func ParseLogBackupSubcommand added in v1.4.0

func ParseLogBackupSubcommand(backup *Backup) LogSubCommandType

ParseLogBackupSubcommand parse the log backup subcommand from cr. The parse priority of the command is stop > truncate > start.

type LogTailerSpec

type LogTailerSpec struct {
	corev1.ResourceRequirements `json:",inline"`
}

LogTailerSpec represents an optional log tailer sidecar container +k8s:openapi-gen=true

func (*LogTailerSpec) DeepCopy

func (in *LogTailerSpec) DeepCopy() *LogTailerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogTailerSpec.

func (*LogTailerSpec) DeepCopyInto

func (in *LogTailerSpec) DeepCopyInto(out *LogTailerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MasterConfig

type MasterConfig struct {
	// Log level.
	// Optional: Defaults to info
	// +optional
	LogLevel *string `toml:"log-level,omitempty" json:"log-level,omitempty"`
	// File log config.
	// +optional
	LogFile *string `toml:"log-file,omitempty" json:"log-file,omitempty"`
	// Log format. one of json or text.
	// +optional
	LogFormat *string `toml:"log-format,omitempty" json:"log-format,omitempty"`

	// RPC timeout when dm-master request to dm-worker
	// Optional: Defaults to 30s
	// +optional
	RPCTimeoutStr *string `toml:"rpc-timeout,omitempty" json:"rpc-timeout,omitempty"`
	// RPC agent rate limit when dm-master request to dm-worker
	// Optional: Defaults to 10
	// +optional
	RPCRateLimit *float64 `toml:"rpc-rate-limit,omitempty" json:"rpc-rate-limit,omitempty"`
	// RPC agent rate burst when dm-master request to dm-worker
	// Optional: Defaults to 40
	// +optional
	RPCRateBurst *int `toml:"rpc-rate-burst,omitempty" json:"rpc-rate-burst,omitempty"`
	// dm-master's security config
	// +optional
	// +k8s:openapi-gen=false
	DMSecurityConfig `toml:",inline" json:",inline"`

	// dm-master's experimental config
	// +optional
	Experimental *DMExperimental `toml:"experimental,omitempty" json:"experimental,omitempty"`
}

MasterConfig is the configuration of dm-master-server +k8s:openapi-gen=true

func (*MasterConfig) DeepCopy

func (in *MasterConfig) DeepCopy() *MasterConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterConfig.

func (*MasterConfig) DeepCopyInto

func (in *MasterConfig) DeepCopyInto(out *MasterConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MasterConfigWraper

type MasterConfigWraper struct {
	*config.GenericConfig `json:",inline"`
}

func NewMasterConfig

func NewMasterConfig() *MasterConfigWraper

func (*MasterConfigWraper) DeepCopy

func (in *MasterConfigWraper) DeepCopy() *MasterConfigWraper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterConfigWraper.

func (*MasterConfigWraper) DeepCopyInto

func (in *MasterConfigWraper) DeepCopyInto(out *MasterConfigWraper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MasterConfigWraper) MarshalJSON

func (c *MasterConfigWraper) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler interface.

func (*MasterConfigWraper) MarshalTOML

func (c *MasterConfigWraper) MarshalTOML() ([]byte, error)

func (*MasterConfigWraper) UnmarshalJSON

func (c *MasterConfigWraper) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler interface. If the data is a object, we must use the Deprecated MasterConfig to Unmarshal for compatibility, if we use a map[string]interface{} to Unmarshal directly, we can not distinct the type between integer and float for toml.

type MasterFailureMember

type MasterFailureMember struct {
	PodName       string    `json:"podName,omitempty"`
	MemberID      string    `json:"memberID,omitempty"`
	PVCUID        types.UID `json:"pvcUID,omitempty"`
	MemberDeleted bool      `json:"memberDeleted,omitempty"`
	// +nullable
	CreatedAt metav1.Time `json:"createdAt,omitempty"`
}

MasterFailureMember is the dm-master failure member information

func (*MasterFailureMember) DeepCopy

func (in *MasterFailureMember) DeepCopy() *MasterFailureMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterFailureMember.

func (*MasterFailureMember) DeepCopyInto

func (in *MasterFailureMember) DeepCopyInto(out *MasterFailureMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MasterKeyFileConfig

type MasterKeyFileConfig struct {
	// Encrypyion method, use master key encryption data key
	// Possible values: plaintext, aes128-ctr, aes192-ctr, aes256-ctr
	// Optional: Default to plaintext
	// optional
	Method *string `json:"method,omitempty" toml:"method,omitempty"`

	// Text file containing the key in hex form, end with '\n'
	Path *string `json:"path" toml:"path"`
}

+k8s:openapi-gen=true

func (*MasterKeyFileConfig) DeepCopy

func (in *MasterKeyFileConfig) DeepCopy() *MasterKeyFileConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterKeyFileConfig.

func (*MasterKeyFileConfig) DeepCopyInto

func (in *MasterKeyFileConfig) DeepCopyInto(out *MasterKeyFileConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MasterKeyKMSConfig

type MasterKeyKMSConfig struct {
	// AWS CMK key-id it can be find in AWS Console or use aws cli
	// This field is required
	KeyID *string `json:"key-id" toml:"key-id"`

	// AccessKey of AWS user, leave empty if using other authrization method
	// optional
	AccessKey *string `json:"access-key,omitempty" toml:"access-key,omitempty"`

	// SecretKey of AWS user, leave empty if using other authrization method
	// optional
	SecretKey *string `json:"secret-access-key,omitempty" toml:"secret-access-key,omitempty"`

	// Region of this KMS key
	// Optional: Default to us-east-1
	// optional
	Region *string `json:"region,omitempty" toml:"region,omitempty"`

	// Used for KMS compatible KMS, such as Ceph, minio, If use AWS, leave empty
	// optional
	Endpoint *string `json:"endpoint,omitempty" toml:"endpoint,omitempty"`
}

+k8s:openapi-gen=true

func (*MasterKeyKMSConfig) DeepCopy

func (in *MasterKeyKMSConfig) DeepCopy() *MasterKeyKMSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterKeyKMSConfig.

func (*MasterKeyKMSConfig) DeepCopyInto

func (in *MasterKeyKMSConfig) DeepCopyInto(out *MasterKeyKMSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MasterMember

type MasterMember struct {
	Name string `json:"name"`
	// 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
	ID        string `json:"id"`
	ClientURL string `json:"clientURL"`
	Health    bool   `json:"health"`
	// Last time the health transitioned from one to another.
	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}

MasterMember is dm-master member status

func (*MasterMember) DeepCopy

func (in *MasterMember) DeepCopy() *MasterMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterMember.

func (*MasterMember) DeepCopyInto

func (in *MasterMember) DeepCopyInto(out *MasterMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MasterServiceSpec

type MasterServiceSpec struct {
	ServiceSpec `json:",inline"`

	// ExternalTrafficPolicy of the service
	// Optional: Defaults to omitted
	// +optional
	ExternalTrafficPolicy *corev1.ServiceExternalTrafficPolicyType `json:"externalTrafficPolicy,omitempty"` // Expose the tidb cluster mysql port to MySQLNodePort

	// Optional: Defaults to 0
	// +optional
	MasterNodePort *int `json:"masterNodePort,omitempty"`
}

func (*MasterServiceSpec) DeepCopy

func (in *MasterServiceSpec) DeepCopy() *MasterServiceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterServiceSpec.

func (*MasterServiceSpec) DeepCopyInto

func (in *MasterServiceSpec) DeepCopyInto(out *MasterServiceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MasterServiceSpec) GetMasterNodePort

func (masterSvc *MasterServiceSpec) GetMasterNodePort() int32

type MasterSpec

type MasterSpec struct {
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// The desired ready replicas
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// Base image of the component, image tag is now allowed during validation
	// +kubebuilder:default=pingcap/dm
	// +optional
	BaseImage string `json:"baseImage,omitempty"`

	// Service defines a Kubernetes service of Master cluster.
	// Optional: Defaults to `.spec.services` in favor of backward compatibility
	// +optional
	Service *MasterServiceSpec `json:"service,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 storageClassName of the persistent volume for dm-master data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`

	// StorageSize is the request storage size for dm-master.
	// Defaults to "10Gi".
	// +optional
	StorageSize string `json:"storageSize,omitempty"`

	// Subdirectory within the volume to store dm-master Data. By default, the data
	// is stored in the root directory of volume which is mounted at
	// /var/lib/dm-master.
	// Specifying this will change the data directory to a subdirectory, e.g.
	// /var/lib/dm-master/data if you set the value to "data".
	// It's dangerous to change this value for a running cluster as it will
	// upgrade your cluster to use a new storage directory.
	// Defaults to "" (volume's root).
	// +optional
	DataSubDir string `json:"dataSubDir,omitempty"`

	// Config is the Configuration of dm-master-servers
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Config *MasterConfigWraper `json:"config,omitempty"`

	// Start up script version
	// +optional
	// +kubebuilder:validation:Enum:="";"v1"
	StartUpScriptVersion string `json:"startUpScriptVersion,omitempty"`
}

+k8s:openapi-gen=true MasterSpec contains details of dm-master members

func (*MasterSpec) DeepCopy

func (in *MasterSpec) DeepCopy() *MasterSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterSpec.

func (*MasterSpec) DeepCopyInto

func (in *MasterSpec) DeepCopyInto(out *MasterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MasterStatus

type MasterStatus struct {
	Synced          bool                           `json:"synced,omitempty"`
	Phase           MemberPhase                    `json:"phase,omitempty"`
	StatefulSet     *apps.StatefulSetStatus        `json:"statefulSet,omitempty"`
	Members         map[string]MasterMember        `json:"members,omitempty"`
	Leader          MasterMember                   `json:"leader,omitempty"`
	FailureMembers  map[string]MasterFailureMember `json:"failureMembers,omitempty"`
	UnjoinedMembers map[string]UnjoinedMember      `json:"unjoinedMembers,omitempty"`
	Image           string                         `json:"image,omitempty"`
	// Volumes contains the status of all volumes.
	Volumes map[StorageVolumeName]*StorageVolumeStatus `json:"volumes,omitempty"`
	// Represents the latest available observations of a component's state.
	// +optional
	// +nullable
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

MasterStatus is dm-master status

func (*MasterStatus) DeepCopy

func (in *MasterStatus) DeepCopy() *MasterStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterStatus.

func (*MasterStatus) DeepCopyInto

func (in *MasterStatus) DeepCopyInto(out *MasterStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MasterStatus) GetConditions added in v1.3.6

func (s *MasterStatus) GetConditions() []metav1.Condition

func (*MasterStatus) GetPhase added in v1.3.6

func (s *MasterStatus) GetPhase() MemberPhase

func (*MasterStatus) GetStatefulSet added in v1.3.7

func (s *MasterStatus) GetStatefulSet() *appsv1.StatefulSetStatus

func (*MasterStatus) GetSynced added in v1.3.6

func (s *MasterStatus) GetSynced() bool

func (*MasterStatus) GetVolReplaceInProgress added in v1.5.1

func (s *MasterStatus) GetVolReplaceInProgress() bool

func (*MasterStatus) GetVolumes added in v1.3.6

func (s *MasterStatus) GetVolumes() map[StorageVolumeName]*StorageVolumeStatus

func (*MasterStatus) MemberType added in v1.3.7

func (s *MasterStatus) MemberType() MemberType

func (*MasterStatus) RemoveCondition added in v1.3.6

func (s *MasterStatus) RemoveCondition(conditionType string)

func (*MasterStatus) SetCondition added in v1.3.6

func (s *MasterStatus) SetCondition(newCondition metav1.Condition)

func (*MasterStatus) SetPhase added in v1.3.7

func (s *MasterStatus) SetPhase(phase MemberPhase)

func (*MasterStatus) SetStatefulSet added in v1.3.7

func (s *MasterStatus) SetStatefulSet(sts *appsv1.StatefulSetStatus)

func (*MasterStatus) SetSynced added in v1.3.7

func (s *MasterStatus) SetSynced(synced bool)

func (*MasterStatus) SetVolReplaceInProgress added in v1.5.1

func (s *MasterStatus) SetVolReplaceInProgress(status bool)

func (*MasterStatus) SetVolumes added in v1.4.0

func (s *MasterStatus) SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)

type MemberPhase

type MemberPhase string

MemberPhase is the current state of member

const (
	// NormalPhase represents normal state of TiDB cluster.
	NormalPhase MemberPhase = "Normal"
	// UpgradePhase represents the upgrade state of TiDB cluster.
	UpgradePhase MemberPhase = "Upgrade"
	// ScalePhase represents the scaling state of TiDB cluster.
	ScalePhase MemberPhase = "Scale"
	// SuspendPhase represents the suspend state of TiDB cluster.
	SuspendPhase MemberPhase = "Suspend"
)

type MemberType

type MemberType string

MemberType represents member type

const (
	// DiscoveryMemberType is discovery member type
	DiscoveryMemberType MemberType = "discovery"
	// PDMemberType is pd member type
	PDMemberType MemberType = "pd"
	// PDMSTSOMemberType is pd microservice tso member type
	PDMSTSOMemberType MemberType = "tso"
	// PDMSSchedulingMemberType is pd microservice scheduling member type
	PDMSSchedulingMemberType MemberType = "scheduling"
	// TiDBMemberType is tidb member type
	TiDBMemberType MemberType = "tidb"
	// TiKVMemberType is tikv member type
	TiKVMemberType MemberType = "tikv"
	// TiFlashMemberType is tiflash member type
	TiFlashMemberType MemberType = "tiflash"
	// TiCDCMemberType is ticdc member type
	TiCDCMemberType MemberType = "ticdc"
	// TiProxyMemberType is ticdc member type
	TiProxyMemberType MemberType = "tiproxy"
	// PumpMemberType is pump member type
	PumpMemberType MemberType = "pump"

	// DMDiscoveryMemberType is discovery member type
	DMDiscoveryMemberType MemberType = "dm-discovery"
	// DMMasterMemberType is dm-master member type
	DMMasterMemberType MemberType = "dm-master"
	// DMWorkerMemberType is dm-worker member type
	DMWorkerMemberType MemberType = "dm-worker"

	// TidbMonitorMemberType is tidbmonitor member type
	TidbMonitorMemberType MemberType = "tidbmonitor"

	// NGMonitoringMemberType is ng monitoring member type
	NGMonitoringMemberType MemberType = "ng-monitoring"

	// TiDBDashboardMemberType is tidb-dashboard member type
	TiDBDashboardMemberType MemberType = "tidb-dashboard"

	// UnknownMemberType is unknown member type
	UnknownMemberType MemberType = "unknown"
)

func PDMSMemberType added in v1.6.0

func PDMSMemberType(name string) MemberType

func (MemberType) String

func (mt MemberType) String() string

type MetadataConfig added in v1.4.0

type MetadataConfig struct {
	// Whether metric metadata is sent to remote storage or not.
	Send bool `json:"send,omitempty"`
	// How frequently metric metadata is sent to remote storage.
	SendInterval string `json:"sendInterval,omitempty"`
}

Configures the sending of series metadata to remote storage. +k8s:openapi-gen=true

func (*MetadataConfig) DeepCopy added in v1.4.0

func (in *MetadataConfig) DeepCopy() *MetadataConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetadataConfig.

func (*MetadataConfig) DeepCopyInto added in v1.4.0

func (in *MetadataConfig) DeepCopyInto(out *MetadataConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MonitorComponentAccessor

type MonitorComponentAccessor interface {
	PortName() *string
	ServiceType() corev1.ServiceType
	ImagePullPolicy() *corev1.PullPolicy
}

type MonitorContainer

type MonitorContainer struct {
	corev1.ResourceRequirements `json:",inline"`

	BaseImage string `json:"baseImage,omitempty"`
	Version   string `json:"version,omitempty"`
	// +optional
	ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

+k8s:openapi-gen=true MonitorContainer is the common attributes of the container of monitoring

func (*MonitorContainer) DeepCopy

func (in *MonitorContainer) DeepCopy() *MonitorContainer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitorContainer.

func (*MonitorContainer) DeepCopyInto

func (in *MonitorContainer) DeepCopyInto(out *MonitorContainer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NGMonitoringSpec

type NGMonitoringSpec struct {
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// Base image of the component, image tag is now allowed during validation
	//
	// +kubebuilder:default=pingcap/ng-monitoring
	BaseImage string `json:"baseImage,omitempty"`

	// StorageClassName is the persistent volume for ng monitoring.
	// Defaults to Kubernetes default storage class.
	StorageClassName *string `json:"storageClassName,omitempty"`

	// StorageVolumes configures additional storage for NG Monitoring pods.
	StorageVolumes []StorageVolume `json:"storageVolumes,omitempty"`

	// Config is the configuration of ng monitoring
	//
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Config *config.GenericConfig `json:"config,omitempty"`
}

NGMonitoringSpec is spec of ng monitoring

+k8s:openapi-gen=true

func (*NGMonitoringSpec) DeepCopy

func (in *NGMonitoringSpec) DeepCopy() *NGMonitoringSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NGMonitoringSpec.

func (*NGMonitoringSpec) DeepCopyInto

func (in *NGMonitoringSpec) DeepCopyInto(out *NGMonitoringSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NGMonitoringStatus

type NGMonitoringStatus struct {
	Synced bool        `json:"synced,omitempty"`
	Phase  MemberPhase `json:"phase,omitempty"`

	StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"`
}

NGMonitoringStatus is latest status of ng monitoring

func (*NGMonitoringStatus) DeepCopy

func (in *NGMonitoringStatus) DeepCopy() *NGMonitoringStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NGMonitoringStatus.

func (*NGMonitoringStatus) DeepCopyInto

func (in *NGMonitoringStatus) DeepCopyInto(out *NGMonitoringStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Networks

type Networks struct {
	// +optional
	IP *string `json:"ip,omitempty" toml:"ip,omitempty"`
}

Networks is the configuration of [users.readonly.networks] section. +k8s:openapi-gen=false

func (*Networks) DeepCopy

func (in *Networks) DeepCopy() *Networks

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Networks.

func (*Networks) DeepCopyInto

func (in *Networks) DeepCopyInto(out *Networks)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ObservedStorageVolumeStatus added in v1.3.4

type ObservedStorageVolumeStatus struct {
	// BoundCount is the count of bound volumes.
	// +optional
	BoundCount int `json:"boundCount"`
	// CurrentCount is the count of volumes whose capacity is equal to `currentCapacity`.
	// +optional
	CurrentCount int `json:"currentCount"`
	// ModifiedCount is the count of modified volumes.
	// +optional
	ModifiedCount int `json:"modifiedCount"`
	// CurrentCapacity is the current capacity of the volume.
	// If any volume is resizing, it is the capacity before resizing.
	// If all volumes are resized, it is the resized capacity and same as desired capacity.
	// +optional
	CurrentCapacity resource.Quantity `json:"currentCapacity"`
	// ModifiedCapacity is the modified capacity of the volume.
	// +optional
	ModifiedCapacity resource.Quantity `json:"modifiedCapacity"`
	// CurrentStorageClass is the modified capacity of the volume.
	// +optional
	CurrentStorageClass string `json:"currentStorageClass"`
	// ModifiedStorageClass is the modified storage calss of the volume.
	// +optional
	ModifiedStorageClass string `json:"modifiedStorageClass"`

	// (Deprecated) ResizedCapacity is the desired capacity of the volume.
	// +optional
	ResizedCapacity resource.Quantity `json:"resizedCapacity"`
	// (Deprecated) ResizedCount is the count of volumes whose capacity is equal to `resizedCapacity`.
	// +optional
	ResizedCount int `json:"resizedCount"`
}

func (*ObservedStorageVolumeStatus) DeepCopy added in v1.3.4

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObservedStorageVolumeStatus.

func (*ObservedStorageVolumeStatus) DeepCopyInto added in v1.3.4

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OpenTracing

type OpenTracing struct {
	// Optional: Defaults to false
	// +optional
	Enable *bool `toml:"enable,omitempty" json:"enable,omitempty"`
	// +optional
	Sampler *OpenTracingSampler `toml:"sampler,omitempty" json:"sampler,omitempty"`
	// +optional
	Reporter *OpenTracingReporter `toml:"reporter,omitempty" json:"reporter,omitempty"`
	// +optional
	RPCMetrics *bool `toml:"rpc-metrics,omitempty" json:"rpc-metrics,omitempty"`
}

OpenTracing is the opentracing section of the config. +k8s:openapi-gen=true

func (*OpenTracing) DeepCopy

func (in *OpenTracing) DeepCopy() *OpenTracing

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenTracing.

func (*OpenTracing) DeepCopyInto

func (in *OpenTracing) DeepCopyInto(out *OpenTracing)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OpenTracingReporter

type OpenTracingReporter struct {
	// +optional
	QueueSize *int `toml:"queue-size,omitempty" json:"queue-size,omitempty"`
	// +optional
	BufferFlushInterval *time.Duration `toml:"buffer-flush-interval,omitempty" json:"buffer-flush-interval,omitempty"`
	// +optional
	LogSpans *bool `toml:"log-spans,omitempty" json:"log-spans,omitempty"`
	// +optional
	LocalAgentHostPort *string `toml:"local-agent-host-port,omitempty" json:"local-agent-host-port,omitempty"`
}

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

func (*OpenTracingReporter) DeepCopy

func (in *OpenTracingReporter) DeepCopy() *OpenTracingReporter

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenTracingReporter.

func (*OpenTracingReporter) DeepCopyInto

func (in *OpenTracingReporter) DeepCopyInto(out *OpenTracingReporter)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OpenTracingSampler

type OpenTracingSampler struct {
	// +optional
	Type *string `toml:"type,omitempty" json:"type,omitempty"`
	// +optional
	Param *float64 `toml:"param,omitempty" json:"param,omitempty"`
	// +optional
	SamplingServerURL *string `toml:"sampling-server-url,omitempty" json:"sampling-server-url,omitempty"`
	// +optional
	MaxOperations *int `toml:"max-operations,omitempty" json:"max-operations,omitempty"`
	// +optional
	SamplingRefreshInterval *time.Duration `toml:"sampling-refresh-interval,omitempty" json:"sampling-refresh-interval,omitempty"`
}

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

func (*OpenTracingSampler) DeepCopy

func (in *OpenTracingSampler) DeepCopy() *OpenTracingSampler

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenTracingSampler.

func (*OpenTracingSampler) DeepCopyInto

func (in *OpenTracingSampler) DeepCopyInto(out *OpenTracingSampler)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDConfig

type PDConfig struct {
	// +optional
	ForceNewCluster *bool `json:"force-new-cluster,omitempty"`
	// Optional: Defaults to true
	// +optional
	EnableGRPCGateway *bool `json:"enable-grpc-gateway,omitempty"`

	// set different tokens to prevent communication between PDs in different clusters.
	// +optional
	InitialClusterToken *string `toml:"initial-cluster-token,omitempty" json:"initial-cluster-token,omitempty"`

	// 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
	// +optional
	LeaderLease *int64 `toml:"lease,omitempty" json:"lease,omitempty"`

	// Log related config.
	// +optional
	Log *PDLogConfig `toml:"log,omitempty" json:"log,omitempty"`

	// Backward compatibility.
	// +optional
	LogFileDeprecated *string `toml:"log-file,omitempty" json:"log-file,omitempty"`
	// +optional
	LogLevelDeprecated *string `toml:"log-level,omitempty" json:"log-level,omitempty"`

	// TsoSaveInterval is the interval to save timestamp.
	// Optional: Defaults to 3s
	// +optional
	TsoSaveInterval *string `toml:"tso-save-interval,omitempty" json:"tso-save-interval,omitempty"`

	// +optional
	Metric *PDMetricConfig `toml:"metric,omitempty" json:"metric,omitempty"`

	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	Schedule *PDScheduleConfig `toml:"schedule,omitempty" json:"schedule,omitempty"`

	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	Replication *PDReplicationConfig `toml:"replication,omitempty" json:"replication,omitempty"`

	// +optional
	Namespace map[string]PDNamespaceConfig `toml:"namespace,omitempty" json:"namespace,omitempty"`

	// +optional
	PDServerCfg *PDServerConfig `toml:"pd-server,omitempty" json:"pd-server,omitempty"`

	// +optional
	ClusterVersion *string `toml:"cluster-version,omitempty" json:"cluster-version,omitempty"`

	// 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.
	// +optional
	QuotaBackendBytes *string `toml:"quota-backend-bytes,omitempty" json:"quota-backend-bytes,omitempty"`
	// AutoCompactionMode is either 'periodic' or 'revision'. The default value is 'periodic'.
	// +optional
	AutoCompactionMode *string `toml:"auto-compaction-mode,omitempty" json:"auto-compaction-mode,omitempty"`
	// 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.
	// +optional
	AutoCompactionRetention *string `toml:"auto-compaction-retention,omitempty" json:"auto-compaction-retention-v2,omitempty"`

	// TickInterval is the interval for etcd Raft tick.
	// +optional
	TickInterval *string `toml:"tick-interval,omitempty" json:"tikv-interval,omitempty"`
	// ElectionInterval is the interval for etcd Raft election.
	// +optional
	ElectionInterval *string `toml:"election-interval,omitempty" json:"election-interval,omitempty"`
	// 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
	PreVote *bool `toml:"enable-prevote,omitempty" json:"enable-prevote,omitempty"`

	// +optional
	Security *PDSecurityConfig `toml:"security,omitempty" json:"security,omitempty"`

	// +optional
	LabelProperty PDLabelPropertyConfig `toml:"label-property,omitempty" json:"label-property,omitempty"`

	// Deprecated in v4.0.0
	// NamespaceClassifier is for classifying stores/regions into different
	// namespaces.
	// Optional: Defaults to true
	// +optional
	NamespaceClassifier *string `toml:"namespace-classifier,omitempty" json:"namespace-classifier,omitempty"`

	// +optional
	Dashboard *DashboardConfig `toml:"dashboard,omitempty" json:"dashboard,omitempty"`
}

PDConfig is the configuration of pd-server +k8s:openapi-gen=true

func (*PDConfig) DeepCopy

func (in *PDConfig) DeepCopy() *PDConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDConfig.

func (*PDConfig) DeepCopyInto

func (in *PDConfig) DeepCopyInto(out *PDConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDConfigWraper

type PDConfigWraper struct {
	*config.GenericConfig `json:",inline"`
}

func NewPDConfig

func NewPDConfig() *PDConfigWraper

func (*PDConfigWraper) DeepCopy

func (in *PDConfigWraper) DeepCopy() *PDConfigWraper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDConfigWraper.

func (*PDConfigWraper) DeepCopyInto

func (in *PDConfigWraper) DeepCopyInto(out *PDConfigWraper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PDConfigWraper) MarshalJSON

func (c *PDConfigWraper) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler interface.

func (*PDConfigWraper) MarshalTOML

func (c *PDConfigWraper) MarshalTOML() ([]byte, error)

func (*PDConfigWraper) UnmarshalJSON

func (c *PDConfigWraper) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler interface. If the data is a object, we must use the Deprecated PDConfig to Unmarshal for compatibility, if we use a map[string]interface{} to Unmarshal directly, we can not distinct the type between integer and float for toml.

type PDFailureMember

type PDFailureMember struct {
	PodName       string                    `json:"podName,omitempty"`
	MemberID      string                    `json:"memberID,omitempty"`
	PVCUID        types.UID                 `json:"pvcUID,omitempty"`
	PVCUIDSet     map[types.UID]EmptyStruct `json:"pvcUIDSet,omitempty"`
	MemberDeleted bool                      `json:"memberDeleted,omitempty"`
	HostDown      bool                      `json:"hostDown,omitempty"`
	// +nullable
	CreatedAt metav1.Time `json:"createdAt,omitempty"`
}

PDFailureMember is the pd failure member information

func (*PDFailureMember) DeepCopy

func (in *PDFailureMember) DeepCopy() *PDFailureMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDFailureMember.

func (*PDFailureMember) DeepCopyInto

func (in *PDFailureMember) DeepCopyInto(out *PDFailureMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDLabelPropertyConfig

type PDLabelPropertyConfig map[string]PDStoreLabels

func (PDLabelPropertyConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDLabelPropertyConfig.

func (PDLabelPropertyConfig) DeepCopyInto

func (in PDLabelPropertyConfig) DeepCopyInto(out *PDLabelPropertyConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDLogConfig

type PDLogConfig struct {
	// Log level.
	// Optional: Defaults to info
	// +optional
	Level *string `toml:"level,omitempty" json:"level,omitempty"`
	// Log format. one of json, text, or console.
	// +optional
	Format *string `toml:"format,omitempty" json:"format,omitempty"`
	// Disable automatic timestamps in output.
	// +optional
	DisableTimestamp *bool `toml:"disable-timestamp,omitempty" json:"disable-timestamp,omitempty"`
	// File log config.
	// +optional
	File *FileLogConfig `toml:"file,omitempty" json:"file,omitempty"`
	// Development puts the logger in development mode, which changes the
	// behavior of DPanicLevel and takes stacktraces more liberally.
	// +optional
	Development *bool `toml:"development,omitempty" json:"development,omitempty"`
	// DisableCaller stops annotating logs with the calling function's file
	// name and line number. By default, all logs are annotated.
	// +optional
	DisableCaller *bool `toml:"disable-caller,omitempty" json:"disable-caller,omitempty"`
	// 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
	DisableStacktrace *bool `toml:"disable-stacktrace,omitempty" json:"disable-stacktrace,omitempty"`
	// DisableErrorVerbose stops annotating logs with the full verbose error
	// message.
	// +optional
	DisableErrorVerbose *bool `toml:"disable-error-verbose,omitempty" json:"disable-error-verbose,omitempty"`
}

PDLogConfig serializes log related config in toml/json. +k8s:openapi-gen=true

func (*PDLogConfig) DeepCopy

func (in *PDLogConfig) DeepCopy() *PDLogConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDLogConfig.

func (*PDLogConfig) DeepCopyInto

func (in *PDLogConfig) DeepCopyInto(out *PDLogConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDMSSpec added in v1.6.0

type PDMSSpec struct {
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// Name of the PD Micro Service
	// +kubebuilder:validation:Enum:="tso";"scheduling"
	Name string `json:"name"`

	// Specify a Service Account for pd ms
	ServiceAccount string `json:"serviceAccount,omitempty"`

	// The desired ready replicas
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// Base image of the component, image tag is now allowed during validation
	// +kubebuilder:default=pingcap/pd
	// +optional
	BaseImage *string `json:"baseImage"`

	// Service defines a Kubernetes service of PD Micro Service cluster.
	// Optional: Defaults to `.spec.services` in favor of backward compatibility
	// +optional
	Service *ServiceSpec `json:"service,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"`

	// Config is the Configuration of pd Micro Service servers
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Config *PDConfigWraper `json:"config,omitempty"`

	// TLSClientSecretName is the name of secret which stores tidb server client certificate
	// which used by Dashboard.
	// +optional
	TLSClientSecretName *string `json:"tlsClientSecretName,omitempty"`

	// MountClusterClientSecret indicates whether to mount `cluster-client-secret` to the Pod
	// +optional
	MountClusterClientSecret *bool `json:"mountClusterClientSecret,omitempty"`

	// Start up script version
	// +optional
	// +kubebuilder:validation:Enum:="";"v1"
	StartUpScriptVersion string `json:"startUpScriptVersion,omitempty"`

	// The storageClassName of the persistent volume for PD Micro Service log storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`

	// StorageVolumes configure additional storage for PD Micro Service pods.
	// +optional
	StorageVolumes []StorageVolume `json:"storageVolumes,omitempty"`

	// Timeout threshold when pd get started
	// +kubebuilder:default=30
	StartTimeout int `json:"startTimeout,omitempty"`
}

+k8s:openapi-gen=true PDMSSpec contains details of PD Micro Service

func (*PDMSSpec) DeepCopy added in v1.6.0

func (in *PDMSSpec) DeepCopy() *PDMSSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDMSSpec.

func (*PDMSSpec) DeepCopyInto added in v1.6.0

func (in *PDMSSpec) DeepCopyInto(out *PDMSSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDMSStatus added in v1.6.0

type PDMSStatus struct {
	Name string `json:"name,omitempty"`
	// +optional
	Synced      bool                    `json:"synced"`
	Phase       MemberPhase             `json:"phase,omitempty"`
	StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"`
	// Volumes contains the status of all volumes.
	Volumes map[StorageVolumeName]*StorageVolumeStatus `json:"volumes,omitempty"`
	// Members contains other service in current TidbCluster
	Members []string `json:"members,omitempty"`
	Image   string   `json:"image,omitempty"`
	// Represents the latest available observations of a component's state.
	// +optional
	// +nullable
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

PDMSStatus is PD Micro Service Status

func (*PDMSStatus) DeepCopy added in v1.6.0

func (in *PDMSStatus) DeepCopy() *PDMSStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDMSStatus.

func (*PDMSStatus) DeepCopyInto added in v1.6.0

func (in *PDMSStatus) DeepCopyInto(out *PDMSStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PDMSStatus) GetConditions added in v1.6.0

func (s *PDMSStatus) GetConditions() []metav1.Condition

func (*PDMSStatus) GetPhase added in v1.6.0

func (s *PDMSStatus) GetPhase() MemberPhase

func (*PDMSStatus) GetStatefulSet added in v1.6.0

func (s *PDMSStatus) GetStatefulSet() *appsv1.StatefulSetStatus

func (*PDMSStatus) GetSynced added in v1.6.0

func (s *PDMSStatus) GetSynced() bool

func (*PDMSStatus) GetVolReplaceInProgress added in v1.6.0

func (s *PDMSStatus) GetVolReplaceInProgress() bool

func (*PDMSStatus) GetVolumes added in v1.6.0

func (s *PDMSStatus) GetVolumes() map[StorageVolumeName]*StorageVolumeStatus

func (*PDMSStatus) MemberType added in v1.6.0

func (s *PDMSStatus) MemberType() MemberType

func (*PDMSStatus) RemoveCondition added in v1.6.0

func (s *PDMSStatus) RemoveCondition(conditionType string)

func (*PDMSStatus) SetCondition added in v1.6.0

func (s *PDMSStatus) SetCondition(newCondition metav1.Condition)

func (*PDMSStatus) SetPhase added in v1.6.0

func (s *PDMSStatus) SetPhase(phase MemberPhase)

func (*PDMSStatus) SetStatefulSet added in v1.6.0

func (s *PDMSStatus) SetStatefulSet(sts *appsv1.StatefulSetStatus)

func (*PDMSStatus) SetSynced added in v1.6.0

func (s *PDMSStatus) SetSynced(synced bool)

func (*PDMSStatus) SetVolReplaceInProgress added in v1.6.0

func (s *PDMSStatus) SetVolReplaceInProgress(status bool)

func (*PDMSStatus) SetVolumes added in v1.6.0

func (s *PDMSStatus) SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)

type PDMember

type PDMember struct {
	Name string `json:"name"`
	// 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
	ID        string `json:"id"`
	ClientURL string `json:"clientURL"`
	Health    bool   `json:"health"`
	// Last time the health transitioned from one to another.
	// TODO: remove nullable, https://github.com/kubernetes/kubernetes/issues/86811
	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}

PDMember is PD member

func (*PDMember) DeepCopy

func (in *PDMember) DeepCopy() *PDMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDMember.

func (*PDMember) DeepCopyInto

func (in *PDMember) DeepCopyInto(out *PDMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDMetricConfig

type PDMetricConfig struct {
	// +optional
	PushJob *string `toml:"job,omitempty" json:"job,omitempty"`
	// +optional
	PushAddress *string `toml:"address,omitempty" json:"address,omitempty"`
	// +optional
	PushInterval *string `toml:"interval,omitempty" json:"interval,omitempty"`
}

+k8s:openapi-gen=true

func (*PDMetricConfig) DeepCopy

func (in *PDMetricConfig) DeepCopy() *PDMetricConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDMetricConfig.

func (*PDMetricConfig) DeepCopyInto

func (in *PDMetricConfig) DeepCopyInto(out *PDMetricConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDNamespaceConfig

type PDNamespaceConfig struct {
	// LeaderScheduleLimit is the max coexist leader schedules.
	// +optional
	LeaderScheduleLimit *uint64 `json:"leader-schedule-limit,omitempty" toml:"leader-schedule-limit,omitempty"`
	// RegionScheduleLimit is the max coexist region schedules.
	// +optional
	RegionScheduleLimit *uint64 `json:"region-schedule-limit,omitempty" toml:"region-schedule-limit,omitempty"`
	// ReplicaScheduleLimit is the max coexist replica schedules.
	// +optional
	ReplicaScheduleLimit *uint64 `json:"replica-schedule-limit,omitempty" toml:"replica-schedule-limit,omitempty"`
	// MergeScheduleLimit is the max coexist merge schedules.
	// +optional
	MergeScheduleLimit *uint64 `json:"merge-schedule-limit,omitempty" toml:"merge-schedule-limit,omitempty"`
	// HotRegionScheduleLimit is the max coexist hot region schedules.
	// +optional
	HotRegionScheduleLimit *uint64 `json:"hot-region-schedule-limit,omitempty" toml:"hot-region-schedule-limit,omitempty"`
	// MaxReplicas is the number of replicas for each region.
	// +optional
	MaxReplicas *uint64 `json:"max-replicas,omitempty" toml:"max-replicas,omitempty"`
}

PDNamespaceConfig is to overwrite the global setting for specific namespace +k8s:openapi-gen=true

func (*PDNamespaceConfig) DeepCopy

func (in *PDNamespaceConfig) DeepCopy() *PDNamespaceConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDNamespaceConfig.

func (*PDNamespaceConfig) DeepCopyInto

func (in *PDNamespaceConfig) DeepCopyInto(out *PDNamespaceConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDReplicationConfig

type PDReplicationConfig struct {
	// MaxReplicas is the number of replicas for each region.
	// Immutable, change should be made through pd-ctl after cluster creation
	// Optional: Defaults to 3
	// +optional
	MaxReplicas *uint64 `toml:"max-replicas,omitempty" json:"max-replicas,omitempty"`

	// 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
	// +k8s:openapi-gen=false
	// +optional
	LocationLabels []string `toml:"location-labels,omitempty" json:"location-labels,omitempty"`
	// 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
	// +optional
	StrictlyMatchLabel *bool `toml:"strictly-match-label,omitempty" json:"strictly-match-label,omitempty"`

	// When PlacementRules feature is enabled. MaxReplicas and LocationLabels are not used anymore.
	// +optional
	EnablePlacementRules *bool `toml:"enable-placement-rules" json:"enable-placement-rules,omitempty"`
}

PDReplicationConfig is the replication configuration. +k8s:openapi-gen=true

func (*PDReplicationConfig) DeepCopy

func (in *PDReplicationConfig) DeepCopy() *PDReplicationConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDReplicationConfig.

func (*PDReplicationConfig) DeepCopyInto

func (in *PDReplicationConfig) DeepCopyInto(out *PDReplicationConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDScheduleConfig

type PDScheduleConfig struct {
	// 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
	// +optional
	MaxSnapshotCount *uint64 `toml:"max-snapshot-count,omitempty" json:"max-snapshot-count,omitempty"`
	// Immutable, change should be made through pd-ctl after cluster creation
	// Optional: Defaults to 16
	// +optional
	MaxPendingPeerCount *uint64 `toml:"max-pending-peer-count,omitempty" json:"max-pending-peer-count,omitempty"`
	// 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
	// +optional
	MaxMergeRegionSize *uint64 `toml:"max-merge-region-size,omitempty" json:"max-merge-region-size,omitempty"`
	// Immutable, change should be made through pd-ctl after cluster creation
	// Optional: Defaults to 200000
	// +optional
	MaxMergeRegionKeys *uint64 `toml:"max-merge-region-keys,omitempty" json:"max-merge-region-keys,omitempty"`
	// 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
	// +optional
	SplitMergeInterval *string `toml:"split-merge-interval,omitempty" json:"split-merge-interval,omitempty"`
	// PatrolRegionInterval is the interval for scanning region during patrol.
	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	PatrolRegionInterval *string `toml:"patrol-region-interval,omitempty" json:"patrol-region-interval,omitempty"`
	// 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
	// +optional
	MaxStoreDownTime *string `toml:"max-store-down-time,omitempty" json:"max-store-down-time,omitempty"`
	// 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
	// +optional
	LeaderScheduleLimit *uint64 `toml:"leader-schedule-limit,omitempty" json:"leader-schedule-limit,omitempty"`
	// RegionScheduleLimit is the max coexist region schedules.
	// Immutable, change should be made through pd-ctl after cluster creation
	// Optional: Defaults to 2048
	// +optional
	RegionScheduleLimit *uint64 `toml:"region-schedule-limit,omitempty" json:"region-schedule-limit,omitempty"`
	// ReplicaScheduleLimit is the max coexist replica schedules.
	// Immutable, change should be made through pd-ctl after cluster creation
	// Optional: Defaults to 64
	// +optional
	ReplicaScheduleLimit *uint64 `toml:"replica-schedule-limit,omitempty" json:"replica-schedule-limit,omitempty"`
	// MergeScheduleLimit is the max coexist merge schedules.
	// Immutable, change should be made through pd-ctl after cluster creation
	// Optional: Defaults to 8
	// +optional
	MergeScheduleLimit *uint64 `toml:"merge-schedule-limit,omitempty" json:"merge-schedule-limit,omitempty"`
	// HotRegionScheduleLimit is the max coexist hot region schedules.
	// Immutable, change should be made through pd-ctl after cluster creation
	// Optional: Defaults to 4
	// +optional
	HotRegionScheduleLimit *uint64 `toml:"hot-region-schedule-limit,omitempty" json:"hot-region-schedule-limit,omitempty"`
	// 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
	// +optional
	HotRegionCacheHitsThreshold *uint64 `toml:"hot-region-cache-hits-threshold,omitempty" json:"hot-region-cache-hits-threshold,omitempty"`
	// 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
	// +optional
	TolerantSizeRatio *float64 `toml:"tolerant-size-ratio,omitempty" json:"tolerant-size-ratio,omitempty"`
	//
	//      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
	// +optional
	LowSpaceRatio *float64 `toml:"low-space-ratio,omitempty" json:"low-space-ratio,omitempty"`
	// 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
	// +optional
	HighSpaceRatio *float64 `toml:"high-space-ratio,omitempty" json:"high-space-ratio,omitempty"`
	// DisableLearner is the option to disable using AddLearnerNode instead of AddNode
	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	DisableLearner *bool `toml:"disable-raft-learner,omitempty" json:"disable-raft-learner,omitempty"`

	// DisableRemoveDownReplica is the option to prevent replica checker from
	// removing down replicas.
	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	DisableRemoveDownReplica *bool `toml:"disable-remove-down-replica,omitempty" json:"disable-remove-down-replica,omitempty"`
	// DisableReplaceOfflineReplica is the option to prevent replica checker from
	// repalcing offline replicas.
	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	DisableReplaceOfflineReplica *bool `toml:"disable-replace-offline-replica,omitempty" json:"disable-replace-offline-replica,omitempty"`
	// 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
	// +optional
	DisableMakeUpReplica *bool `toml:"disable-make-up-replica,omitempty" json:"disable-make-up-replica,omitempty"`
	// DisableRemoveExtraReplica is the option to prevent replica checker from
	// removing extra replicas.
	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	DisableRemoveExtraReplica *bool `toml:"disable-remove-extra-replica,omitempty" json:"disable-remove-extra-replica,omitempty"`
	// 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
	// +optional
	DisableLocationReplacement *bool `toml:"disable-location-replacement,omitempty" json:"disable-location-replacement,omitempty"`
	// 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
	// +optional
	DisableNamespaceRelocation *bool `toml:"disable-namespace-relocation,omitempty" json:"disable-namespace-relocation,omitempty"`

	// Schedulers support for loding customized schedulers
	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	Schedulers PDSchedulerConfigs `toml:"schedulers,omitempty" json:"schedulers-v2,omitempty"` // json v2 is for the sake of compatible upgrade

	// Only used to display
	// +optional
	SchedulersPayload map[string]string `toml:"schedulers-payload,omitempty" json:"schedulers-payload,omitempty"`

	// 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
	// +optional
	EnableOneWayMerge *bool `toml:"enable-one-way-merge,omitempty" json:"enable-one-way-merge,omitempty"`
	// 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
	// +optional
	EnableCrossTableMerge *bool `toml:"enable-cross-table-merge,omitempty" json:"enable-cross-table-merge,omitempty"`
}

ScheduleConfig is the schedule configuration. +k8s:openapi-gen=true

func (*PDScheduleConfig) DeepCopy

func (in *PDScheduleConfig) DeepCopy() *PDScheduleConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDScheduleConfig.

func (*PDScheduleConfig) DeepCopyInto

func (in *PDScheduleConfig) DeepCopyInto(out *PDScheduleConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDSchedulerConfig

type PDSchedulerConfig struct {
	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	Type *string `toml:"type,omitempty" json:"type,omitempty"`
	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	Args []string `toml:"args,omitempty" json:"args,omitempty"`
	// Immutable, change should be made through pd-ctl after cluster creation
	// +optional
	Disable *bool `toml:"disable,omitempty" json:"disable,omitempty"`
}

PDSchedulerConfig is customized scheduler configuration +k8s:openapi-gen=true

func (*PDSchedulerConfig) DeepCopy

func (in *PDSchedulerConfig) DeepCopy() *PDSchedulerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDSchedulerConfig.

func (*PDSchedulerConfig) DeepCopyInto

func (in *PDSchedulerConfig) DeepCopyInto(out *PDSchedulerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDSchedulerConfigs

type PDSchedulerConfigs []PDSchedulerConfig

func (PDSchedulerConfigs) DeepCopy

func (in PDSchedulerConfigs) DeepCopy() PDSchedulerConfigs

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDSchedulerConfigs.

func (PDSchedulerConfigs) DeepCopyInto

func (in PDSchedulerConfigs) DeepCopyInto(out *PDSchedulerConfigs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDSecurityConfig

type PDSecurityConfig struct {
	// CAPath is the path of file that contains list of trusted SSL CAs.
	// +optional
	CAPath *string `toml:"cacert-path,omitempty" json:"cacert-path,omitempty"`
	// CertPath is the path of file that contains X509 certificate in PEM format.
	// +optional
	CertPath *string `toml:"cert-path,omitempty" json:"cert-path,omitempty"`
	// KeyPath is the path of file that contains X509 key in PEM format.
	// +optional
	KeyPath *string `toml:"key-path,omitempty" json:"key-path,omitempty"`
	// CertAllowedCN is the Common Name that allowed
	// +optional
	// +k8s:openapi-gen=false
	CertAllowedCN []string `toml:"cert-allowed-cn,omitempty" json:"cert-allowed-cn,omitempty"`
}

PDSecurityConfig is the configuration for supporting tls. +k8s:openapi-gen=true

func (*PDSecurityConfig) DeepCopy

func (in *PDSecurityConfig) DeepCopy() *PDSecurityConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDSecurityConfig.

func (*PDSecurityConfig) DeepCopyInto

func (in *PDSecurityConfig) DeepCopyInto(out *PDSecurityConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDServerConfig

type PDServerConfig struct {
	// UseRegionStorage enables the independent region storage.
	// +optional
	UseRegionStorage *bool `toml:"use-region-storage,omitempty" json:"use-region-storage,omitempty"`
	// 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
	MetricStorage *string `toml:"metric-storage,omitempty" json:"metric-storage,omitempty"`
}

PDServerConfig is the configuration for pd server. +k8s:openapi-gen=true

func (*PDServerConfig) DeepCopy

func (in *PDServerConfig) DeepCopy() *PDServerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDServerConfig.

func (*PDServerConfig) DeepCopyInto

func (in *PDServerConfig) DeepCopyInto(out *PDServerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDSpec

type PDSpec struct {
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// Specify a Service Account for pd
	ServiceAccount string `json:"serviceAccount,omitempty"`

	// The desired ready replicas
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// Base image of the component, image tag is now allowed during validation
	// +kubebuilder:default=pingcap/pd
	// +optional
	BaseImage string `json:"baseImage"`

	// Service defines a Kubernetes service of PD cluster.
	// Optional: Defaults to `.spec.services` in favor of backward compatibility
	// +optional
	Service *ServiceSpec `json:"service,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 storageClassName of the persistent volume for PD data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`

	// StorageVolumes configure additional storage for PD pods.
	// +optional
	StorageVolumes []StorageVolume `json:"storageVolumes,omitempty"`

	// Subdirectory within the volume to store PD Data. By default, the data
	// is stored in the root directory of volume which is mounted at
	// /var/lib/pd.
	// Specifying this will change the data directory to a subdirectory, e.g.
	// /var/lib/pd/data if you set the value to "data".
	// It's dangerous to change this value for a running cluster as it will
	// upgrade your cluster to use a new storage directory.
	// Defaults to "" (volume's root).
	// +optional
	DataSubDir string `json:"dataSubDir,omitempty"`

	// Config is the Configuration of pd-servers
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Config *PDConfigWraper `json:"config,omitempty"`

	// TLSClientSecretName is the name of secret which stores tidb server client certificate
	// which used by Dashboard.
	// +optional
	TLSClientSecretName *string `json:"tlsClientSecretName,omitempty"`

	// (Deprecated) EnableDashboardInternalProxy would directly set `internal-proxy` in the `PdConfig`.
	// Note that this is deprecated, we should just set `dashboard.internal-proxy` in `pd.config`.
	// +optional
	EnableDashboardInternalProxy *bool `json:"enableDashboardInternalProxy,omitempty"`

	// MountClusterClientSecret indicates whether to mount `cluster-client-secret` to the Pod
	// +optional
	MountClusterClientSecret *bool `json:"mountClusterClientSecret,omitempty"`

	// Start up script version
	// +optional
	// +kubebuilder:validation:Enum:="";"v1"
	StartUpScriptVersion string `json:"startUpScriptVersion,omitempty"`

	// Timeout threshold when pd get started
	// +kubebuilder:default=30
	StartTimeout int `json:"startTimeout,omitempty"`

	// Mode is the mode of PD cluster
	// +optional
	// +kubebuilder:validation:Enum:="";"ms"
	Mode string `json:"mode,omitempty"`
}

+k8s:openapi-gen=true PDSpec contains details of PD members

func (*PDSpec) DeepCopy

func (in *PDSpec) DeepCopy() *PDSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDSpec.

func (*PDSpec) DeepCopyInto

func (in *PDSpec) DeepCopyInto(out *PDSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDStatus

type PDStatus struct {
	// +optional
	Synced      bool                    `json:"synced"`
	Phase       MemberPhase             `json:"phase,omitempty"`
	StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"`
	// Members contains PDs in current TidbCluster
	Members map[string]PDMember `json:"members,omitempty"`
	// PeerMembers contains PDs NOT in current TidbCluster
	PeerMembers     map[string]PDMember        `json:"peerMembers,omitempty"`
	Leader          PDMember                   `json:"leader,omitempty"`
	FailureMembers  map[string]PDFailureMember `json:"failureMembers,omitempty"`
	UnjoinedMembers map[string]UnjoinedMember  `json:"unjoinedMembers,omitempty"`
	Image           string                     `json:"image,omitempty"`
	// Volumes contains the status of all volumes.
	Volumes map[StorageVolumeName]*StorageVolumeStatus `json:"volumes,omitempty"`
	// Represents the latest available observations of a component's state.
	// +optional
	// +nullable
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// Indicates that a Volume replace using VolumeReplacing feature is in progress.
	VolReplaceInProgress bool `json:"volReplaceInProgress,omitempty"`
}

PDStatus is PD status

func (*PDStatus) DeepCopy

func (in *PDStatus) DeepCopy() *PDStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDStatus.

func (*PDStatus) DeepCopyInto

func (in *PDStatus) DeepCopyInto(out *PDStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PDStatus) GetConditions added in v1.3.6

func (s *PDStatus) GetConditions() []metav1.Condition

func (*PDStatus) GetPhase added in v1.3.6

func (s *PDStatus) GetPhase() MemberPhase

func (*PDStatus) GetStatefulSet added in v1.3.7

func (s *PDStatus) GetStatefulSet() *appsv1.StatefulSetStatus

func (*PDStatus) GetSynced added in v1.3.6

func (s *PDStatus) GetSynced() bool

func (*PDStatus) GetVolReplaceInProgress added in v1.5.1

func (s *PDStatus) GetVolReplaceInProgress() bool

func (*PDStatus) GetVolumes added in v1.3.6

func (s *PDStatus) GetVolumes() map[StorageVolumeName]*StorageVolumeStatus

func (*PDStatus) MemberType added in v1.3.7

func (s *PDStatus) MemberType() MemberType

func (*PDStatus) RemoveCondition added in v1.3.6

func (s *PDStatus) RemoveCondition(conditionType string)

func (*PDStatus) SetCondition added in v1.3.6

func (s *PDStatus) SetCondition(newCondition metav1.Condition)

func (*PDStatus) SetPhase added in v1.3.7

func (s *PDStatus) SetPhase(phase MemberPhase)

func (*PDStatus) SetStatefulSet added in v1.3.7

func (s *PDStatus) SetStatefulSet(sts *appsv1.StatefulSetStatus)

func (*PDStatus) SetSynced added in v1.3.7

func (s *PDStatus) SetSynced(synced bool)

func (*PDStatus) SetVolReplaceInProgress added in v1.5.1

func (s *PDStatus) SetVolReplaceInProgress(status bool)

func (*PDStatus) SetVolumes added in v1.4.0

func (s *PDStatus) SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)

type PDStoreLabel

type PDStoreLabel struct {
	// +optional
	Key *string `toml:"key,omitempty" json:"key,omitempty"`
	// +optional
	Value *string `toml:"value,omitempty" json:"value,omitempty"`
}

PDStoreLabel is the config item of LabelPropertyConfig. +k8s:openapi-gen=true

func (*PDStoreLabel) DeepCopy

func (in *PDStoreLabel) DeepCopy() *PDStoreLabel

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDStoreLabel.

func (*PDStoreLabel) DeepCopyInto

func (in *PDStoreLabel) DeepCopyInto(out *PDStoreLabel)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PDStoreLabels

type PDStoreLabels []PDStoreLabel

func (PDStoreLabels) DeepCopy

func (in PDStoreLabels) DeepCopy() PDStoreLabels

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDStoreLabels.

func (PDStoreLabels) DeepCopyInto

func (in PDStoreLabels) DeepCopyInto(out *PDStoreLabels)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Performance

type Performance struct {
	// +optional
	MaxProcs *uint `toml:"max-procs,omitempty" json:"max-procs,omitempty"`
	// Optional: Defaults to 0
	// +optional
	MaxMemory *uint64 `toml:"max-memory,omitempty" json:"max-memory,omitempty"`
	// Optional: Defaults to 3s
	// +optional
	StatsLease *string `toml:"stats-lease,omitempty" json:"stats-lease,omitempty"`
	// Optional: Defaults to 5000
	// +optional
	StmtCountLimit *uint `toml:"stmt-count-limit,omitempty" json:"stmt-count-limit,omitempty"`
	// Optional: Defaults to 0.05
	// +optional
	FeedbackProbability *float64 `toml:"feedback-probability,omitempty" json:"feedback-probability,omitempty"`
	// Optional: Defaults to 512
	// +optional
	QueryFeedbackLimit *uint `toml:"query-feedback-limit,omitempty" json:"query-feedback-limit,omitempty"`
	// Optional: Defaults to 0.8
	// +optional
	PseudoEstimateRatio *float64 `toml:"pseudo-estimate-ratio,omitempty" json:"pseudo-estimate-ratio,omitempty"`
	// Optional: Defaults to NO_PRIORITY
	// +optional
	ForcePriority *string `toml:"force-priority,omitempty" json:"force-priority,omitempty"`
	// Optional: Defaults to 3s
	// +optional
	BindInfoLease *string `toml:"bind-info-lease,omitempty" json:"bind-info-lease,omitempty"`
	// Optional: Defaults to 104857600
	// +optional
	TxnTotalSizeLimit *uint64 `toml:"txn-total-size-limit,omitempty" json:"txn-total-size-limit,omitempty"`
	// Optional: Defaults to true
	// +optional
	TCPKeepAlive *bool `toml:"tcp-keep-alive,omitempty" json:"tcp-keep-alive,omitempty"`
	// Optional: Defaults to true
	// +optional
	CrossJoin *bool `toml:"cross-join,omitempty" json:"cross-join,omitempty"`
	// Optional: Defaults to true
	// +optional
	RunAutoAnalyze *bool `toml:"run-auto-analyze,omitempty" json:"run-auto-analyze,omitempty"`
	// +optional
	DistinctAggPushDown *bool `toml:"distinct-agg-push-down,omitempty" json:"agg-push-down-join,omitempty"`
	// +optional
	CommitterConcurrency *int `toml:"committer-concurrency,omitempty" json:"committer-concurrency,omitempty"`
	// +optional
	MaxTxnTTL *uint64 `toml:"max-txn-ttl,omitempty" json:"max-txn-ttl,omitempty"`
	// Deprecated in v4.0.0
	// Optional: Defaults to 300000
	// +optional
	TxnEntryCountLimit *uint64 `toml:"txn-entry-count-limit,omitempty" json:"txn-entry-count-limit,omitempty"`
}

Performance is the performance section of the config. +k8s:openapi-gen=true

func (*Performance) DeepCopy

func (in *Performance) DeepCopy() *Performance

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Performance.

func (*Performance) DeepCopyInto

func (in *Performance) DeepCopyInto(out *Performance)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PessimisticTxn

type PessimisticTxn struct {
	// Enable must be true for 'begin lock' or session variable to start a pessimistic transaction.
	// Optional: Defaults to true
	// +optional
	Enable *bool `toml:"enable,omitempty" json:"enable,omitempty"`
	// The max count of retry for a single statement in a pessimistic transaction.
	// Optional: Defaults to 256
	// +optional
	MaxRetryCount *uint `toml:"max-retry-count,omitempty" json:"max-retry-count,omitempty"`
}

PessimisticTxn is the config for pessimistic transaction. +k8s:openapi-gen=true

func (*PessimisticTxn) DeepCopy

func (in *PessimisticTxn) DeepCopy() *PessimisticTxn

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PessimisticTxn.

func (*PessimisticTxn) DeepCopyInto

func (in *PessimisticTxn) DeepCopyInto(out *PessimisticTxn)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PlanCache

type PlanCache struct {
	// +optional
	Enabled *bool `toml:"enabled,omitempty" json:"enabled,omitempty"`
	// +optional
	Capacity *uint `toml:"capacity,omitempty" json:"capacity,omitempty"`
	// +optional
	Shards *uint `toml:"shards,omitempty" json:"shards,omitempty"`
}

PlanCache is the PlanCache section of the config. +k8s:openapi-gen=true

func (*PlanCache) DeepCopy

func (in *PlanCache) DeepCopy() *PlanCache

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanCache.

func (*PlanCache) DeepCopyInto

func (in *PlanCache) DeepCopyInto(out *PlanCache)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Plugin

type Plugin struct {
	// +optional
	Dir *string `toml:"dir,omitempty" json:"dir,omitempty"`
	// +optional
	Load *string `toml:"load,omitempty" json:"load,omitempty"`
}

Plugin is the config for plugin +k8s:openapi-gen=true

func (*Plugin) DeepCopy

func (in *Plugin) DeepCopy() *Plugin

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plugin.

func (*Plugin) DeepCopyInto

func (in *Plugin) DeepCopyInto(out *Plugin)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PreparedPlanCache

type PreparedPlanCache struct {
	// Optional: Defaults to false
	// +optional
	Enabled *bool `toml:"enabled,omitempty" json:"enabled,omitempty"`
	// Optional: Defaults to 100
	// +optional
	Capacity *uint `toml:"capacity,omitempty" json:"capacity,omitempty"`
	// Optional: Defaults to 0.1
	// +optional
	MemoryGuardRatio *float64 `toml:"memory-guard-ratio,omitempty" json:"memory-guard-ratio,omitempty"`
}

PreparedPlanCache is the PreparedPlanCache section of the config. +k8s:openapi-gen=true

func (*PreparedPlanCache) DeepCopy

func (in *PreparedPlanCache) DeepCopy() *PreparedPlanCache

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreparedPlanCache.

func (*PreparedPlanCache) DeepCopyInto

func (in *PreparedPlanCache) DeepCopyInto(out *PreparedPlanCache)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Probe added in v1.4.0

type Probe struct {
	// "tcp" will use TCP socket to connect component port.
	//
	// "command" will probe the status api of tidb.
	// This will use curl command to request tidb, before v4.0.9 there is no curl in the image,
	// So do not use this before v4.0.9.
	// +kubebuilder:validation:Enum=tcp;command
	// +optional
	Type *string `json:"type,omitempty"` // tcp or command
	// Number of seconds after the container has started before liveness probes are initiated.
	// Default to 10 seconds.
	// +kubebuilder:validation:Minimum=0
	// +optional
	InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
	// How often (in seconds) to perform the probe.
	// Default to Kubernetes default (10 seconds). Minimum value is 1.
	// +kubebuilder:validation:Minimum=1
	// +optional
	PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
}

Probe contains details of probing tidb. +k8s:openapi-gen=true default probe by TCPPort on tidb 4000 / tikv 20160 / pd 2349.

func (*Probe) DeepCopy added in v1.4.0

func (in *Probe) DeepCopy() *Probe

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Probe.

func (*Probe) DeepCopyInto added in v1.4.0

func (in *Probe) DeepCopyInto(out *Probe)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Profile

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"`
}

Profile is the configuration profiles. +k8s:openapi-gen=false

func (*Profile) DeepCopy

func (in *Profile) DeepCopy() *Profile

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Profile.

func (*Profile) DeepCopyInto

func (in *Profile) DeepCopyInto(out *Profile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Progress added in v1.4.0

type Progress struct {
	// Step is the step name of progress
	Step string `json:"step,omitempty"`
	// Progress is the backup progress value
	Progress float64 `json:"progress,omitempty"`
	// LastTransitionTime is the update time
	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}

func (*Progress) DeepCopy added in v1.4.0

func (in *Progress) DeepCopy() *Progress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Progress.

func (*Progress) DeepCopyInto added in v1.4.0

func (in *Progress) DeepCopyInto(out *Progress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusConfiguration

type PrometheusConfiguration struct {

	// User can mount prometheus config with external configMap. The external configMap must contain `prometheus-config` key in data.
	ConfigMapRef *ConfigMapRef `json:"configMapRef,omitempty"`

	// user can  use it specify prometheus command options
	CommandOptions []string `json:"commandOptions,omitempty"`

	// User can mount prometheus rule config with external configMap. The external configMap must use the key with suffix `.rules.yml`.
	RuleConfigRef *ConfigMapRef `json:"ruleConfigRef,omitempty"`
}

+k8s:openapi-gen=true Config is the the desired state of Prometheus Configuration

func (*PrometheusConfiguration) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusConfiguration.

func (*PrometheusConfiguration) DeepCopyInto

func (in *PrometheusConfiguration) DeepCopyInto(out *PrometheusConfiguration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusReloaderSpec

type PrometheusReloaderSpec struct {
	MonitorContainer `json:",inline"`
}

PrometheusReloaderSpec is the desired state of prometheus configuration reloader

func (*PrometheusReloaderSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusReloaderSpec.

func (*PrometheusReloaderSpec) DeepCopyInto

func (in *PrometheusReloaderSpec) DeepCopyInto(out *PrometheusReloaderSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PrometheusSpec

type PrometheusSpec struct {
	MonitorContainer `json:",inline"`

	// Prometheus log level
	LogLevel string `json:"logLevel,omitempty"`

	// Service defines a Kubernetes service of Prometheus.
	Service ServiceSpec `json:"service,omitempty"`

	// ReserveDays defines Prometheus Configuration for `--storage.tsdb.retention.time` of units d.
	// reserveDays will be used if retentionTime not defined.
	// +optional
	ReserveDays int `json:"reserveDays,omitempty"`

	// Configuration for `--storage.tsdb.retention.time`, Units Supported: y, w, d, h, m, s, ms.
	// If set to non empty values, it will override the value of `ReserveDays`.
	// +optional
	RetentionTime *string `json:"retentionTime,omitempty"`

	// Ingress configuration of Prometheus
	// +optional
	Ingress *IngressSpec `json:"ingress,omitempty"`

	// Config is the Configuration of Prometheus include Prometheus config/Cli options/custom rules.
	// +optional
	Config *PrometheusConfiguration `json:"config,omitempty"`

	// Disable prometheus compaction.
	// Defaults to false.
	DisableCompaction bool `json:"disableCompaction,omitempty"`

	// If specified, the remote_write spec. This is an experimental feature, it may change in any upcoming release in a breaking way.
	RemoteWrite []*RemoteWriteSpec `json:"remoteWrite,omitempty"`

	// Additional volume mounts of prometheus pod.
	AdditionalVolumeMounts []corev1.VolumeMount `json:"additionalVolumeMounts,omitempty"`
}

PrometheusSpec is the desired state of prometheus

func (*PrometheusSpec) DeepCopy

func (in *PrometheusSpec) DeepCopy() *PrometheusSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusSpec.

func (*PrometheusSpec) DeepCopyInto

func (in *PrometheusSpec) DeepCopyInto(out *PrometheusSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProxyConfig

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"`
}

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=true

func (*ProxyConfig) DeepCopy

func (in *ProxyConfig) DeepCopy() *ProxyConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyConfig.

func (*ProxyConfig) DeepCopyInto

func (in *ProxyConfig) DeepCopyInto(out *ProxyConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProxyProtocol

type ProxyProtocol struct {
	// PROXY protocol acceptable client networks.
	// Empty *string means disable PROXY protocol,
	// * means all networks.
	// +optional
	Networks *string `toml:"networks,omitempty" json:"networks,omitempty"`
	// PROXY protocol header read timeout, Unit is second.
	// +optional
	HeaderTimeout *uint `toml:"header-timeout,omitempty" json:"header-timeout,omitempty"`
}

ProxyProtocol is the PROXY protocol section of the config. +k8s:openapi-gen=true

func (*ProxyProtocol) DeepCopy

func (in *ProxyProtocol) DeepCopy() *ProxyProtocol

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyProtocol.

func (*ProxyProtocol) DeepCopyInto

func (in *ProxyProtocol) DeepCopyInto(out *ProxyProtocol)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PumpNodeStatus

type PumpNodeStatus struct {
	NodeID string `json:"nodeId"`
	Host   string `json:"host"`
	State  string `json:"state"`
}

PumpNodeStatus represents the status saved in etcd.

func (*PumpNodeStatus) DeepCopy

func (in *PumpNodeStatus) DeepCopy() *PumpNodeStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PumpNodeStatus.

func (*PumpNodeStatus) DeepCopyInto

func (in *PumpNodeStatus) DeepCopyInto(out *PumpNodeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PumpSpec

type PumpSpec struct {
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// Specify a Service Account for pump
	ServiceAccount string `json:"serviceAccount,omitempty"`

	// The desired ready replicas
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// Base image of the component, image tag is now allowed during validation
	// +kubebuilder:default=pingcap/tidb-binlog
	// +optional
	BaseImage string `json:"baseImage"`

	// The storageClassName of the persistent volume for Pump data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`

	// The configuration of Pump cluster.
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Config *config.GenericConfig `json:"config,omitempty"`

	// +k8s:openapi-gen=false
	// For backward compatibility with helm chart
	SetTimeZone *bool `json:"setTimeZone,omitempty"`
}

PumpSpec contains details of Pump members +k8s:openapi-gen=true

func (*PumpSpec) DeepCopy

func (in *PumpSpec) DeepCopy() *PumpSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PumpSpec.

func (*PumpSpec) DeepCopyInto

func (in *PumpSpec) DeepCopyInto(out *PumpSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PumpStatus

type PumpStatus struct {
	Phase       MemberPhase             `json:"phase,omitempty"`
	StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"`
	Members     []*PumpNodeStatus       `json:"members,omitempty"`
	// Volumes contains the status of all volumes.
	Volumes map[StorageVolumeName]*StorageVolumeStatus `json:"volumes,omitempty"`
	// Represents the latest available observations of a component's state.
	// +optional
	// +nullable
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

PumpStatus is Pump status

func (*PumpStatus) DeepCopy

func (in *PumpStatus) DeepCopy() *PumpStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PumpStatus.

func (*PumpStatus) DeepCopyInto

func (in *PumpStatus) DeepCopyInto(out *PumpStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PumpStatus) GetConditions added in v1.3.6

func (s *PumpStatus) GetConditions() []metav1.Condition

func (*PumpStatus) GetPhase added in v1.3.6

func (s *PumpStatus) GetPhase() MemberPhase

func (*PumpStatus) GetStatefulSet added in v1.3.7

func (s *PumpStatus) GetStatefulSet() *appsv1.StatefulSetStatus

func (*PumpStatus) GetSynced added in v1.3.6

func (s *PumpStatus) GetSynced() bool

func (*PumpStatus) GetVolReplaceInProgress added in v1.5.1

func (s *PumpStatus) GetVolReplaceInProgress() bool

func (*PumpStatus) GetVolumes added in v1.3.6

func (s *PumpStatus) GetVolumes() map[StorageVolumeName]*StorageVolumeStatus

func (*PumpStatus) MemberType added in v1.3.7

func (s *PumpStatus) MemberType() MemberType

func (*PumpStatus) RemoveCondition added in v1.3.6

func (s *PumpStatus) RemoveCondition(conditionType string)

func (*PumpStatus) SetCondition added in v1.3.6

func (s *PumpStatus) SetCondition(newCondition metav1.Condition)

func (*PumpStatus) SetPhase added in v1.3.7

func (s *PumpStatus) SetPhase(phase MemberPhase)

func (*PumpStatus) SetStatefulSet added in v1.3.7

func (s *PumpStatus) SetStatefulSet(sts *appsv1.StatefulSetStatus)

func (*PumpStatus) SetSynced added in v1.3.7

func (s *PumpStatus) SetSynced(synced bool)

func (*PumpStatus) SetVolReplaceInProgress added in v1.5.1

func (s *PumpStatus) SetVolReplaceInProgress(status bool)

func (*PumpStatus) SetVolumes added in v1.4.0

func (s *PumpStatus) SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)

type QueueConfig

type QueueConfig struct {
	// Number of samples to buffer per shard before we start dropping them.
	Capacity int `json:"capacity,omitempty"`

	// MinShards is the minimum number of shards, i.e. amount of concurrency.
	// Only valid in Prometheus versions 2.6.0 and newer.
	MinShards int `json:"minShards,omitempty"`

	// Max number of shards, i.e. amount of concurrency.
	MaxShards int `json:"maxShards,omitempty"`

	// Maximum number of samples per send.
	MaxSamplesPerSend int `json:"maxSamplesPerSend,omitempty"`

	// Maximum time sample will wait in buffer.
	BatchSendDeadline *time.Duration `json:"batchSendDeadline,omitempty"`

	// Max number of times to retry a batch on recoverable errors.
	MaxRetries int `json:"maxRetries,omitempty"`

	// On recoverable errors, backoff exponentially.
	MinBackoff *time.Duration `json:"minBackoff,omitempty"`
	MaxBackoff *time.Duration `json:"maxBackoff,omitempty"`
}

QueueConfig allows the tuning of remote_write queue_config parameters. This object is referenced in the RemoteWriteSpec object. +k8s:openapi-gen=true

func (*QueueConfig) DeepCopy

func (in *QueueConfig) DeepCopy() *QueueConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueueConfig.

func (*QueueConfig) DeepCopyInto

func (in *QueueConfig) DeepCopyInto(out *QueueConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Quota

type Quota struct {
	// +optional
	Interval *Interval `json:"interval,omitempty" toml:"interval,omitempty"`
}

Quota is the configuration of [quotas.default] section. +k8s:openapi-gen=false

func (*Quota) DeepCopy

func (in *Quota) DeepCopy() *Quota

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Quota.

func (*Quota) DeepCopyInto

func (in *Quota) DeepCopyInto(out *Quota)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RelabelConfig

type RelabelConfig struct {
	// A list of labels from which values are taken and concatenated
	// with the configured separator in order.
	SourceLabels model.LabelNames `json:"sourceLabels,omitempty"`
	// Separator is the string between concatenated values from the source labels.
	Separator string `json:"separator,omitempty"`
	//Regular expression against which the extracted value is matched. Default is '(.*)'
	Regex string `json:"regex,omitempty"`
	// Modulus to take of the hash of concatenated values from the source labels.
	Modulus uint64 `json:"modulus,omitempty"`
	// TargetLabel is the label to which the resulting string is written in a replacement.
	// Regexp interpolation is allowed for the replace action.
	TargetLabel string `json:"targetLabel,omitempty"`
	// Replacement is the regex replacement pattern to be used.
	Replacement string `json:"replacement,omitempty"`
	// Action is the action to be performed for the relabeling.
	Action relabel.Action `json:"action,omitempty"`
}

RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs +k8s:openapi-gen=true

func (*RelabelConfig) DeepCopy

func (in *RelabelConfig) DeepCopy() *RelabelConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RelabelConfig.

func (*RelabelConfig) DeepCopyInto

func (in *RelabelConfig) DeepCopyInto(out *RelabelConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReloaderSpec

type ReloaderSpec struct {
	MonitorContainer `json:",inline"`
	Service          ServiceSpec `json:"service,omitempty"`
}

ReloaderSpec is the desired state of reloader

func (*ReloaderSpec) DeepCopy

func (in *ReloaderSpec) DeepCopy() *ReloaderSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReloaderSpec.

func (*ReloaderSpec) DeepCopyInto

func (in *ReloaderSpec) DeepCopyInto(out *ReloaderSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RemoteWriteSpec

type RemoteWriteSpec struct {
	// The URL of the endpoint to send samples to.
	URL string `json:"url"`
	// The name of the remote write queue, must be unique if specified. The
	// name is used in metrics and logging in order to differentiate queues.
	// Only valid in Prometheus versions 2.15.0 and newer.
	// +optional
	Name string `json:"name,omitempty"`
	// +optional
	RemoteTimeout *model.Duration `json:"remoteTimeout,omitempty"`
	// The list of remote write relabel configurations.
	// +optional
	WriteRelabelConfigs []RelabelConfig `json:"writeRelabelConfigs,omitempty"`
	//BasicAuth for the URL.
	// +optional
	BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
	// File to read bearer token for remote write.
	// +optional
	BearerToken string `json:"bearerToken,omitempty"`
	// File to read bearer token for remote write.
	// +optional
	BearerTokenFile string `json:"bearerTokenFile,omitempty"`
	// TLS Config to use for remote write.
	// +optional
	TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`
	// Proxy url
	// +optional
	ProxyURL *string `json:"proxyUrl,omitempty"`
	// +optional
	QueueConfig *QueueConfig `json:"queueConfig,omitempty"`
	// MetadataConfig configures the sending of series metadata to remote storage.
	// Only valid in Prometheus versions 2.23.0 and newer.
	// +optional
	MetadataConfig *MetadataConfig `json:"metadataConfig,omitempty"`
	// Custom HTTP headers to be sent along with each remote write request.
	// Be aware that headers that are set by Prometheus itself can't be overwritten.
	// Only valid in Prometheus versions 2.25.0 and newer.
	Headers map[string]string `json:"headers,omitempty"`
}

RemoteWriteSpec defines the remote_write configuration for prometheus. +k8s:openapi-gen=true

func (*RemoteWriteSpec) DeepCopy

func (in *RemoteWriteSpec) DeepCopy() *RemoteWriteSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteWriteSpec.

func (*RemoteWriteSpec) DeepCopyInto

func (in *RemoteWriteSpec) DeepCopyInto(out *RemoteWriteSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Restore

type Restore struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata"`

	Spec RestoreSpec `json:"spec"`
	// +k8s:openapi-gen=false
	Status RestoreStatus `json:"status,omitempty"`
}

Restore represents the restoration of backup of a tidb cluster.

+k8s:openapi-gen=true +kubebuilder:resource:shortName="rt" +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`,description="The current status of the restore" +kubebuilder:printcolumn:name="Started",type=date,JSONPath=`.status.timeStarted`,description="The time at which the restore was started",priority=1 +kubebuilder:printcolumn:name="Completed",type=date,JSONPath=`.status.timeCompleted`,description="The time at which the restore was completed",priority=1 +kubebuilder:printcolumn:name="TimeTaken",type=string,JSONPath=`.status.timeTaken`,description="The time that the restore takes" +kubebuilder:printcolumn:name="CommitTS",type=string,JSONPath=`.status.commitTs`,description="The commit ts of tidb cluster restore" +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*Restore) DeepCopy

func (in *Restore) DeepCopy() *Restore

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Restore.

func (*Restore) DeepCopyInto

func (in *Restore) DeepCopyInto(out *Restore)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Restore) DeepCopyObject

func (in *Restore) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Restore) GetInstanceName

func (rs *Restore) GetInstanceName() string

GetInstanceName return the restore instance name

func (*Restore) GetRestoreJobName

func (rs *Restore) GetRestoreJobName() string

GetRestoreJobName return the restore job name

func (*Restore) GetRestorePVCName

func (rs *Restore) GetRestorePVCName() string

GetRestorePVCName return the restore pvc name

func (*Restore) GetTidbEndpointHash

func (rs *Restore) GetTidbEndpointHash() string

GetTidbEndpointHash return the hash string base on tidb cluster's host and port

type RestoreCondition

type RestoreCondition struct {
	Type   RestoreConditionType   `json:"type"`
	Status corev1.ConditionStatus `json:"status"`

	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	Reason             string      `json:"reason,omitempty"`
	Message            string      `json:"message,omitempty"`
}

RestoreCondition describes the observed state of a Restore at a certain point.

func GetRestoreCondition

func GetRestoreCondition(status *RestoreStatus, conditionType RestoreConditionType) (int, *RestoreCondition)

GetRestoreCondition get the specify type's RestoreCondition from the given RestoreStatus

func (*RestoreCondition) DeepCopy

func (in *RestoreCondition) DeepCopy() *RestoreCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreCondition.

func (*RestoreCondition) DeepCopyInto

func (in *RestoreCondition) DeepCopyInto(out *RestoreCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreConditionType

type RestoreConditionType string

RestoreConditionType represents a valid condition of a Restore.

const (
	// RestoreScheduled means the restore job has been created to do tidb cluster restore
	RestoreScheduled RestoreConditionType = "Scheduled"
	// RestoreRunning means the Restore is currently being executed.
	RestoreRunning RestoreConditionType = "Running"
	// RestoreVolumeComplete means the Restore has successfully executed part-1 and the
	// backup volumes have been rebuilded from the corresponding snapshot
	RestoreVolumeComplete RestoreConditionType = "VolumeComplete"
	// CleanVolumeComplete means volumes are cleaned successfully if restore volume failed
	CleanVolumeComplete RestoreConditionType = "CleanVolumeComplete"
	// RestoreWarmUpStarted means the Restore has successfully started warm up pods to
	// initialize volumes restored from snapshots
	RestoreWarmUpStarted RestoreConditionType = "WarmUpStarted"
	// RestoreWarmUpComplete means the Restore has successfully warmed up all TiKV volumes
	RestoreWarmUpComplete RestoreConditionType = "WarmUpComplete"
	// RestoreDataComplete means the Restore has successfully executed part-2 and the
	// data in restore volumes has been deal with consistency based on min_resolved_ts
	RestoreDataComplete RestoreConditionType = "DataComplete"
	// RestoreTiKVComplete means in volume restore, all TiKV instances are started and up
	RestoreTiKVComplete RestoreConditionType = "TikvComplete"
	// RestoreComplete means the Restore has successfully executed and the
	// backup data has been loaded into tidb cluster.
	RestoreComplete RestoreConditionType = "Complete"
	// RestoreFailed means the Restore has failed.
	RestoreFailed RestoreConditionType = "Failed"
	// RestoreRetryFailed means this failure can be retried
	RestoreRetryFailed RestoreConditionType = "RetryFailed"
	// RestoreInvalid means invalid restore CR.
	RestoreInvalid RestoreConditionType = "Invalid"
)

type RestoreList

type RestoreList struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ListMeta `json:"metadata"`

	Items []Restore `json:"items"`
}

+k8s:openapi-gen=true RestoreList contains a list of Restore.

func (*RestoreList) DeepCopy

func (in *RestoreList) DeepCopy() *RestoreList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreList.

func (*RestoreList) DeepCopyInto

func (in *RestoreList) DeepCopyInto(out *RestoreList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RestoreList) DeepCopyObject

func (in *RestoreList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RestoreMode added in v1.4.0

type RestoreMode string

RestoreMode represents the restore mode, such as snapshot or pitr. +k8s:openapi-gen=true

const (
	// RestoreModeSnapshot represents restore from a snapshot backup.
	RestoreModeSnapshot RestoreMode = "snapshot"
	// RestoreModePiTR represents PiTR restore which is from a snapshot backup and log backup.
	RestoreModePiTR RestoreMode = "pitr"
	// RestoreModeVolumeSnapshot represents restore from a volume snapshot backup.
	RestoreModeVolumeSnapshot RestoreMode = "volume-snapshot"
)

type RestoreSpec

type RestoreSpec struct {
	corev1.ResourceRequirements `json:"resources,omitempty"`
	// List of environment variables to set in the container, like v1.Container.Env.
	// Note that the following builtin env vars will be overwritten by values set here
	// - S3_PROVIDER
	// - S3_ENDPOINT
	// - AWS_REGION
	// - AWS_ACL
	// - AWS_STORAGE_CLASS
	// - AWS_DEFAULT_REGION
	// - AWS_ACCESS_KEY_ID
	// - AWS_SECRET_ACCESS_KEY
	// - GCS_PROJECT_ID
	// - GCS_OBJECT_ACL
	// - GCS_BUCKET_ACL
	// - GCS_LOCATION
	// - GCS_STORAGE_CLASS
	// - GCS_SERVICE_ACCOUNT_JSON_KEY
	// - BR_LOG_TO_TERM
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`
	// To is the tidb cluster that needs to restore.
	To *TiDBAccessConfig `json:"to,omitempty"`
	// Type is the backup type for tidb cluster and only used when Mode = snapshot, such as full, db, table.
	Type BackupType `json:"backupType,omitempty"`
	// Mode is the restore mode. such as snapshot or pitr.
	// +kubebuilder:default=snapshot
	Mode RestoreMode `json:"restoreMode,omitempty"`
	// PitrRestoredTs is the pitr restored ts.
	PitrRestoredTs string `json:"pitrRestoredTs,omitempty"`
	// LogRestoreStartTs is the start timestamp which log restore from and it will be used in the future.
	LogRestoreStartTs string `json:"logRestoreStartTs,omitempty"`
	// FederalVolumeRestorePhase indicates which phase to execute in federal volume restore
	// +optional
	FederalVolumeRestorePhase FederalVolumeRestorePhase `json:"federalVolumeRestorePhase,omitempty"`
	// VolumeAZ indicates which AZ the volume snapshots restore to.
	// it is only valid for mode of volume-snapshot
	// +optional
	VolumeAZ string `json:"volumeAZ,omitempty"`
	// TikvGCLifeTime is to specify the safe gc life time for restore.
	// The time limit during which data is retained for each GC, in the format of Go Duration.
	// When a GC happens, the current time minus this value is the safe point.
	TikvGCLifeTime *string `json:"tikvGCLifeTime,omitempty"`
	// StorageProvider configures where and how backups should be stored.
	StorageProvider `json:",inline"`
	// PitrFullBackupStorageProvider configures where and how pitr dependent full backup should be stored.
	PitrFullBackupStorageProvider StorageProvider `json:"pitrFullBackupStorageProvider,omitempty"`
	// The storageClassName of the persistent volume for Restore data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`
	// StorageSize is the request storage size for backup job
	StorageSize string `json:"storageSize,omitempty"`
	// BR is the configs for BR.
	BR *BRConfig `json:"br,omitempty"`
	// Base tolerations of restore Pods, components may add more tolerations upon this respectively
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
	// Affinity of restore Pods
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`
	// Use KMS to decrypt the secrets
	UseKMS bool `json:"useKMS,omitempty"`
	// Specify service account of restore
	ServiceAccount string `json:"serviceAccount,omitempty"`
	// ToolImage specifies the tool image used in `Restore`, which supports BR and TiDB Lightning images.
	// For examples `spec.toolImage: pingcap/br:v4.0.8` or `spec.toolImage: pingcap/tidb-lightning:v4.0.8`
	// For BR image, if it does not contain tag, Pod will use image 'ToolImage:${TiKV_Version}'.
	// +optional
	ToolImage string `json:"toolImage,omitempty"`
	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
	// TableFilter means Table filter expression for 'db.table' matching. BR supports this from v4.0.3.
	TableFilter []string `json:"tableFilter,omitempty"`
	// Warmup represents whether to initialize TiKV volumes after volume snapshot restore
	// +optional
	Warmup RestoreWarmupMode `json:"warmup,omitempty"`
	// WarmupImage represents using what image to initialize TiKV volumes
	// +optional
	WarmupImage string `json:"warmupImage,omitempty"`
	// WarmupStrategy
	// +kubebuilder:default=hybrid
	WarmupStrategy RestoreWarmupStrategy `json:"warmupStrategy,omitempty"`

	// PodSecurityContext of the component
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// PriorityClassName of Restore Job Pods
	PriorityClassName string `json:"priorityClassName,omitempty"`

	// Additional volumes of component pod.
	// +optional
	AdditionalVolumes []corev1.Volume `json:"additionalVolumes,omitempty"`
	// Additional volume mounts of component pod.
	// +optional
	AdditionalVolumeMounts []corev1.VolumeMount `json:"additionalVolumeMounts,omitempty"`
	// TolerateSingleTiKVOutage indicates whether to tolerate a single failure of a store without data loss
	// +kubebuilder:default=false
	TolerateSingleTiKVOutage bool `json:"tolerateSingleTiKVOutage,omitempty"`
}

+k8s:openapi-gen=true RestoreSpec contains the specification for a restore of a tidb cluster backup.

func (*RestoreSpec) DeepCopy

func (in *RestoreSpec) DeepCopy() *RestoreSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreSpec.

func (*RestoreSpec) DeepCopyInto

func (in *RestoreSpec) DeepCopyInto(out *RestoreSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreStatus

type RestoreStatus struct {
	// TimeStarted is the time at which the restore was started.
	// +nullable
	TimeStarted metav1.Time `json:"timeStarted,omitempty"`
	// TimeCompleted is the time at which the restore was completed.
	// +nullable
	TimeCompleted metav1.Time `json:"timeCompleted,omitempty"`
	// TimeTaken is the time that restore takes, it is TimeCompleted - TimeStarted
	TimeTaken string `json:"timeTaken,omitempty"`
	// CommitTs is the snapshot time point of tidb cluster.
	CommitTs string `json:"commitTs,omitempty"`
	// Phase is a user readable state inferred from the underlying Restore conditions
	Phase RestoreConditionType `json:"phase,omitempty"`
	// +nullable
	Conditions []RestoreCondition `json:"conditions,omitempty"`
	// Progresses is the progress of restore.
	// +nullable
	Progresses []Progress `json:"progresses,omitempty"`
}

RestoreStatus represents the current status of a tidb cluster restore.

func (*RestoreStatus) DeepCopy

func (in *RestoreStatus) DeepCopy() *RestoreStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreStatus.

func (*RestoreStatus) DeepCopyInto

func (in *RestoreStatus) DeepCopyInto(out *RestoreStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RestoreWarmupMode added in v1.5.1

type RestoreWarmupMode string

RestoreWarmupMode represents when to initialize TiKV volumes

const (
	// RestoreWarmupModeSync means initialize TiKV volumes before TiKV starts
	RestoreWarmupModeSync RestoreWarmupMode = "sync"
	// RestoreWarmupModeASync means initialize TiKV volumes after restore complete
	RestoreWarmupModeASync RestoreWarmupMode = "async"
)

type RestoreWarmupStrategy added in v1.5.1

type RestoreWarmupStrategy string

RestoreWarmupStrategy represents how to initialize TiKV volumes

const (
	// RestoreWarmupStrategyFio warms up all data block by block. (use fio)
	RestoreWarmupStrategyFio RestoreWarmupStrategy = "fio"
	// RestoreWarmupStrategyHybrid warms up data volume by read sst files one by one, other (e.g. WAL or Raft) will be warmed up via fio.
	RestoreWarmupStrategyHybrid RestoreWarmupStrategy = "hybrid"
	// RestoreWarmupStrategyFsr warms up data volume by enabling Fast Snapshot Restore, other (e.g. WAL or Raft) will be warmed up via fio.
	RestoreWarmupStrategyFsr RestoreWarmupStrategy = "fsr"
	// RestoreWarmupStrategyCheckOnly warm up none data volumes and check wal consistency
	RestoreWarmupStrategyCheckOnly RestoreWarmupStrategy = "check-wal-only"
)

type S3StorageProvider

type S3StorageProvider struct {
	// Provider represents the specific storage provider that implements the S3 interface
	Provider S3StorageProviderType `json:"provider"`
	// Region in which the S3 compatible bucket is located.
	Region string `json:"region,omitempty"`
	// Path is the full path where the backup is saved.
	// The format of the path must be: "<bucket-name>/<path-to-backup-file>"
	Path string `json:"path,omitempty"`
	// Bucket in which to store the backup data.
	Bucket string `json:"bucket,omitempty"`
	// Endpoint of S3 compatible storage service
	Endpoint string `json:"endpoint,omitempty"`
	// StorageClass represents the storage class
	StorageClass string `json:"storageClass,omitempty"`
	// Acl represents access control permissions for this bucket
	Acl string `json:"acl,omitempty"`
	// SecretName is the name of secret which stores
	// S3 compliant storage access key and secret key.
	SecretName string `json:"secretName,omitempty"`
	// Prefix of the data path.
	Prefix string `json:"prefix,omitempty"`
	// SSE Sever-Side Encryption.
	SSE string `json:"sse,omitempty"`
	// Options Rclone options for backup and restore with dumpling and lightning.
	Options []string `json:"options,omitempty"`
}

S3StorageProvider represents a S3 compliant storage for storing backups. +k8s:openapi-gen=true

func (*S3StorageProvider) DeepCopy

func (in *S3StorageProvider) DeepCopy() *S3StorageProvider

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3StorageProvider.

func (*S3StorageProvider) DeepCopyInto

func (in *S3StorageProvider) DeepCopyInto(out *S3StorageProvider)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type S3StorageProviderType

type S3StorageProviderType string

+k8s:openapi-gen=true S3StorageProviderType represents the specific storage provider that implements the S3 interface

const (
	// S3StorageProviderTypeCeph represents the S3 compliant storage provider is ceph
	S3StorageProviderTypeCeph S3StorageProviderType = "ceph"
	// S3StorageProviderTypeAWS represents the S3 compliant storage provider is aws
	S3StorageProviderTypeAWS S3StorageProviderType = "aws"
)

type SafeTLSConfig

type SafeTLSConfig struct {
	// Struct containing the CA cert to use for the targets.
	CA SecretOrConfigMap `json:"ca,omitempty"`
	// Struct containing the client cert file for the targets.
	Cert SecretOrConfigMap `json:"cert,omitempty"`
	// Secret containing the client key file for the targets.
	KeySecret *corev1.SecretKeySelector `json:"keySecret,omitempty"`
	// Used to verify the hostname for the targets.
	ServerName string `json:"serverName,omitempty"`
	// Disable target certificate validation.
	InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
}

SafeTLSConfig specifies safe TLS configuration parameters. +k8s:openapi-gen=true

func (*SafeTLSConfig) DeepCopy

func (in *SafeTLSConfig) DeepCopy() *SafeTLSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SafeTLSConfig.

func (*SafeTLSConfig) DeepCopyInto

func (in *SafeTLSConfig) DeepCopyInto(out *SafeTLSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ScalePolicy added in v1.4.0

type ScalePolicy struct {
	// ScaleInParallelism configures max scale in replicas for TiKV stores.
	// +kubebuilder:default=1
	// +optional
	ScaleInParallelism *int32 `json:"scaleInParallelism,omitempty"`

	// ScaleOutParallelism configures max scale out replicas for TiKV stores.
	// +kubebuilder:default=1
	// +optional
	ScaleOutParallelism *int32 `json:"scaleOutParallelism,omitempty"`
}

func (*ScalePolicy) DeepCopy added in v1.4.0

func (in *ScalePolicy) DeepCopy() *ScalePolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScalePolicy.

func (*ScalePolicy) DeepCopyInto added in v1.4.0

func (in *ScalePolicy) DeepCopyInto(out *ScalePolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretOrConfigMap

type SecretOrConfigMap struct {
	// Secret containing data to use for the targets.
	Secret *corev1.SecretKeySelector `json:"secret,omitempty"`
	// ConfigMap containing data to use for the targets.
	ConfigMap *corev1.ConfigMapKeySelector `json:"configMap,omitempty"`
}

SecretOrConfigMap allows to specify data as a Secret or ConfigMap. Fields are mutually exclusive.

func (*SecretOrConfigMap) DeepCopy

func (in *SecretOrConfigMap) DeepCopy() *SecretOrConfigMap

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretOrConfigMap.

func (*SecretOrConfigMap) DeepCopyInto

func (in *SecretOrConfigMap) DeepCopyInto(out *SecretOrConfigMap)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretRef

type SecretRef struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

+k8s:openapi-gen=true SecretRef indicates to secret ref

func (*SecretRef) DeepCopy

func (in *SecretRef) DeepCopy() *SecretRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretRef.

func (*SecretRef) DeepCopyInto

func (in *SecretRef) DeepCopyInto(out *SecretRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Security

type Security struct {
	// +optional
	SkipGrantTable *bool `toml:"skip-grant-table,omitempty" json:"skip-grant-table,omitempty"`
	// +optional
	SSLCA *string `toml:"ssl-ca,omitempty" json:"ssl-ca,omitempty"`
	// +optional
	SSLCert *string `toml:"ssl-cert,omitempty" json:"ssl-cert,omitempty"`
	// +optional
	SSLKey *string `toml:"ssl-key,omitempty" json:"ssl-key,omitempty"`
	// +optional
	ClusterSSLCA *string `toml:"cluster-ssl-ca,omitempty" json:"cluster-ssl-ca,omitempty"`
	// +optional
	ClusterSSLCert *string `toml:"cluster-ssl-cert,omitempty" json:"cluster-ssl-cert,omitempty"`
	// +optional
	ClusterSSLKey *string `toml:"cluster-ssl-key,omitempty" json:"cluster-ssl-key,omitempty"`
	// ClusterVerifyCN is the Common Name that allowed
	// +optional
	// +k8s:openapi-gen=false
	ClusterVerifyCN []string `toml:"cluster-verify-cn,omitempty" json:"cluster-verify-cn,omitempty"`
}

Security is the security section of the config. +k8s:openapi-gen=true

func (*Security) DeepCopy

func (in *Security) DeepCopy() *Security

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Security.

func (*Security) DeepCopyInto

func (in *Security) DeepCopyInto(out *Security)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Service

type Service struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

(Deprecated) Service represent service type used in TidbCluster +k8s:openapi-gen=false

func (*Service) DeepCopy

func (in *Service) DeepCopy() *Service

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service.

func (*Service) DeepCopyInto

func (in *Service) DeepCopyInto(out *Service)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceSpec

type ServiceSpec struct {
	// Type of the real kubernetes service
	Type corev1.ServiceType `json:"type,omitempty"`

	// Additional annotations for the service
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Additional labels for the service
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// LoadBalancerIP is the loadBalancerIP of service
	// Optional: Defaults to omitted
	// +optional
	LoadBalancerIP *string `json:"loadBalancerIP,omitempty"`

	// ClusterIP is the clusterIP of service
	// +optional
	ClusterIP *string `json:"clusterIP,omitempty"`

	// PortName is the name of service port
	// +optional
	PortName *string `json:"portName,omitempty"`

	// The port that will be exposed by this service.
	//
	// NOTE: only used for TiDB
	//
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	// +optional
	Port *int32 `json:"port,omitempty"`

	// LoadBalancerSourceRanges is the loadBalancerSourceRanges of service
	// If specified and supported by the platform, this will restrict traffic through the cloud-provider
	// load-balancer will be restricted to the specified client IPs. This field will be ignored if the
	// cloud-provider does not support the feature."
	// More info: https://kubernetes.io/docs/concepts/services-networking/service/#aws-nlb-support
	// Optional: Defaults to omitted
	// +optional
	LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"`
}

ServiceSpec specifies the service object in k8s +k8s:openapi-gen=true

func (*ServiceSpec) DeepCopy

func (in *ServiceSpec) DeepCopy() *ServiceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSpec.

func (*ServiceSpec) DeepCopyInto

func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StartScriptV2FeatureFlag added in v1.5.2

type StartScriptV2FeatureFlag string

type StartScriptVersion added in v1.4.0

type StartScriptVersion string
const (
	StartScriptV1 StartScriptVersion = "v1"
	StartScriptV2 StartScriptVersion = "v2"
)

type Status

type Status struct {
	// +optional
	MetricsAddr *string `toml:"metrics-addr,omitempty" json:"metrics-addr,omitempty"`
	// Optional: Defaults to 15
	// +optional
	MetricsInterval *uint `toml:"metrics-interval,omitempty" json:"metrics-interval,omitempty"`
	// Optional: Defaults to true
	// +optional
	ReportStatus *bool `toml:"report-status,omitempty" json:"report-status,omitempty"`
	// Optional: Defaults to false
	// +optional
	RecordQPSbyDB *bool `toml:"record-db-qps,omitempty" json:"record-db-qps,omitempty"`
}

Status is the status section of the config. +k8s:openapi-gen=true

func (*Status) DeepCopy

func (in *Status) DeepCopy() *Status

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status.

func (*Status) DeepCopyInto

func (in *Status) DeepCopyInto(out *Status)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StmtSummary

type StmtSummary struct {
	// Enable statement summary or not.
	// +optional
	Enable *bool `toml:"enable,omitempty" json:"enable,omitempty"`
	// Enable summary internal query.
	// +optional
	EnableInternalQuery *bool `toml:"enable-internal-query,omitempty" json:"enable-internal-query,omitempty"`
	// The maximum number of statements kept in memory.
	// Optional: Defaults to 100
	// +optional
	MaxStmtCount *uint `toml:"max-stmt-count,omitempty" json:"max-stmt-count,omitempty"`
	// The maximum length of displayed normalized SQL and sample SQL.
	// Optional: Defaults to 4096
	// +optional
	MaxSQLLength *uint `toml:"max-sql-length,omitempty" json:"max-sql-length,omitempty"`
	// The refresh interval of statement summary.
	// +optional
	RefreshInterval *int `toml:"refresh-interval,omitempty" json:"refresh-interval,omitempty"`
	// The maximum history size of statement summary.
	// +optional
	HistorySize *int `toml:"history-size,omitempty" json:"history-size,omitempty"`
}

StmtSummary is the config for statement summary. +k8s:openapi-gen=true

func (*StmtSummary) DeepCopy

func (in *StmtSummary) DeepCopy() *StmtSummary

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StmtSummary.

func (*StmtSummary) DeepCopyInto

func (in *StmtSummary) DeepCopyInto(out *StmtSummary)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StorageClaim

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"`
}

StorageClaim contains details of TiFlash storages +k8s:openapi-gen=true

func (*StorageClaim) DeepCopy

func (in *StorageClaim) DeepCopy() *StorageClaim

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClaim.

func (*StorageClaim) DeepCopyInto

func (in *StorageClaim) DeepCopyInto(out *StorageClaim)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StorageProvider

type StorageProvider struct {
	S3     *S3StorageProvider     `json:"s3,omitempty"`
	Gcs    *GcsStorageProvider    `json:"gcs,omitempty"`
	Azblob *AzblobStorageProvider `json:"azblob,omitempty"`
	Local  *LocalStorageProvider  `json:"local,omitempty"`
}

StorageProvider defines the configuration for storing a backup in backend storage. +k8s:openapi-gen=true

func (*StorageProvider) DeepCopy

func (in *StorageProvider) DeepCopy() *StorageProvider

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageProvider.

func (*StorageProvider) DeepCopyInto

func (in *StorageProvider) DeepCopyInto(out *StorageProvider)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StorageVolume

type StorageVolume struct {
	Name             string  `json:"name"`
	StorageClassName *string `json:"storageClassName,omitempty"`
	StorageSize      string  `json:"storageSize"`
	MountPath        string  `json:"mountPath,omitempty"`
}

StorageVolume configures additional PVC template for StatefulSets and volumeMount for pods that mount this PVC. Note: If `MountPath` is not set, volumeMount will not be generated. (You may not want to set this field when you inject volumeMount in somewhere else such as Mutating Admission Webhook) If `StorageClassName` is not set, default to the `spec.${component}.storageClassName`

func (*StorageVolume) DeepCopy

func (in *StorageVolume) DeepCopy() *StorageVolume

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageVolume.

func (*StorageVolume) DeepCopyInto

func (in *StorageVolume) DeepCopyInto(out *StorageVolume)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StorageVolumeName added in v1.3.4

type StorageVolumeName string

StorageVolumeName is the volume name which is same as `volumes.name` in Pod spec.

func GetStorageVolumeName added in v1.3.4

func GetStorageVolumeName(storageVolumeName string, memberType MemberType) StorageVolumeName

GetStorageVolumeName return the storage volume name for a component's storage volume (not support TiFlash).

When storageVolumeName is empty, it indicate volume is base data volume which have special name. When storageVolumeName is not empty, it indicate volume is additional volume which is declaired in `spec.storageVolumes`.

func GetStorageVolumeNameForTiFlash added in v1.3.4

func GetStorageVolumeNameForTiFlash(index int) StorageVolumeName

GetStorageVolumeNameForTiFlash return the PVC template name for a TiFlash's data volume

type StorageVolumeStatus added in v1.3.4

type StorageVolumeStatus struct {
	ObservedStorageVolumeStatus `json:",inline"`
	// Name is the volume name which is same as `volumes.name` in Pod spec.
	Name StorageVolumeName `json:"name"`
}

StorageVolumeStatus is the actual status for a storage

func (*StorageVolumeStatus) DeepCopy added in v1.3.4

func (in *StorageVolumeStatus) DeepCopy() *StorageVolumeStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageVolumeStatus.

func (*StorageVolumeStatus) DeepCopyInto added in v1.3.4

func (in *StorageVolumeStatus) DeepCopyInto(out *StorageVolumeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SuspendAction added in v1.3.7

type SuspendAction struct {
	SuspendStatefulSet bool `json:"suspendStatefulSet,omitempty"`
}

SuspendAction defines the suspend actions for a component.

+k8s:openapi-gen=true

func (*SuspendAction) DeepCopy added in v1.3.7

func (in *SuspendAction) DeepCopy() *SuspendAction

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SuspendAction.

func (*SuspendAction) DeepCopyInto added in v1.3.7

func (in *SuspendAction) DeepCopyInto(out *SuspendAction)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TLSCluster

type TLSCluster struct {
	// Enable mutual TLS connection between TiDB cluster components
	// Once enabled, the mutual authentication applies to all components,
	// and it does not support applying to only part of the components.
	// The steps to enable this feature:
	//   1. Generate TiDB cluster components certificates and a client-side certifiacete for them.
	//      There are multiple ways to generate these certificates:
	//        - user-provided certificates: https://pingcap.com/docs/stable/how-to/secure/generate-self-signed-certificates/
	//        - use the K8s built-in certificate signing system signed certificates: https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/
	//        - or use cert-manager signed certificates: https://cert-manager.io/
	//   2. Create one secret object for one component which contains the certificates created above.
	//      The name of this Secret must be: <clusterName>-<componentName>-cluster-secret.
	//        For PD: kubectl create secret generic <clusterName>-pd-cluster-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
	//        For TiKV: kubectl create secret generic <clusterName>-tikv-cluster-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
	//        For TiDB: kubectl create secret generic <clusterName>-tidb-cluster-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
	//        For Client: kubectl create secret generic <clusterName>-cluster-client-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
	//        Same for other components.
	// +optional
	Enabled bool `json:"enabled,omitempty"`
}

TLSCluster can enable mutual TLS connection between TiDB cluster components https://pingcap.com/docs/stable/how-to/secure/enable-tls-between-components/

func (*TLSCluster) DeepCopy

func (in *TLSCluster) DeepCopy() *TLSCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSCluster.

func (*TLSCluster) DeepCopyInto

func (in *TLSCluster) DeepCopyInto(out *TLSCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TLSConfig

type TLSConfig struct {
	SafeTLSConfig `json:",inline"`
	// Path to the CA cert in the Prometheus container to use for the targets.
	CAFile string `json:"caFile,omitempty"`
	// Path to the client cert file in the Prometheus container for the targets.
	CertFile string `json:"certFile,omitempty"`
	// Path to the client key file in the Prometheus container for the targets.
	KeyFile string `json:"keyFile,omitempty"`
}

TLSConfig extends the safe TLS configuration with file parameters. +k8s:openapi-gen=true

func (*TLSConfig) DeepCopy

func (in *TLSConfig) DeepCopy() *TLSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig.

func (*TLSConfig) DeepCopyInto

func (in *TLSConfig) DeepCopyInto(out *TLSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ThanosSpec

type ThanosSpec struct {
	MonitorContainer `json:",inline"`
	// ObjectStorageConfig configures object storage in Thanos.
	// Alternative to ObjectStorageConfigFile, and lower order priority.
	ObjectStorageConfig *corev1.SecretKeySelector `json:"objectStorageConfig,omitempty"`
	// ObjectStorageConfigFile specifies the path of the object storage configuration file.
	// When used alongside with ObjectStorageConfig, ObjectStorageConfigFile takes precedence.
	ObjectStorageConfigFile *string `json:"objectStorageConfigFile,omitempty"`
	// ListenLocal makes the Thanos sidecar listen on loopback, so that it
	// does not bind against the Pod IP.
	ListenLocal bool `json:"listenLocal,omitempty"`
	// TracingConfig configures tracing in Thanos. This is an experimental feature, it may change in any upcoming release in a breaking way.
	TracingConfig *corev1.SecretKeySelector `json:"tracingConfig,omitempty"`
	// TracingConfig specifies the path of the tracing configuration file.
	// When used alongside with TracingConfig, TracingConfigFile takes precedence.
	TracingConfigFile *string `json:"tracingConfigFile,omitempty"`
	// GRPCServerTLSConfig configures the gRPC server from which Thanos Querier reads
	// recorded rule data.
	// Note: Currently only the CAFile, CertFile, and KeyFile fields are supported.
	// Maps to the '--grpc-server-tls-*' CLI args.
	GRPCServerTLSConfig *TLSConfig `json:"grpcServerTlsConfig,omitempty"`
	// LogLevel for Thanos sidecar to be configured with.
	LogLevel string `json:"logLevel,omitempty"`
	// LogFormat for Thanos sidecar to be configured with.
	LogFormat string `json:"logFormat,omitempty"`
	// MinTime for Thanos sidecar to be configured with. Option can be a constant time in RFC3339 format or time duration relative to current time, such as -1d or 2h45m. Valid duration units are ms, s, m, h, d, w, y.
	MinTime string `json:"minTime,omitempty"`
	// RoutePrefix is prometheus prefix url
	RoutePrefix string `json:"routePrefix,omitempty"`
	// Additional volume mounts of thanos pod.
	AdditionalVolumeMounts []corev1.VolumeMount `json:"additionalVolumeMounts,omitempty"`
}

ThanosSpec is the desired state of thanos sidecar

func (*ThanosSpec) DeepCopy

func (in *ThanosSpec) DeepCopy() *ThanosSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThanosSpec.

func (*ThanosSpec) DeepCopyInto

func (in *ThanosSpec) DeepCopyInto(out *ThanosSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiCDCCapture

type TiCDCCapture struct {
	PodName string `json:"podName,omitempty"`
	ID      string `json:"id,omitempty"`
	Version string `json:"version,omitempty"`
	IsOwner bool   `json:"isOwner,omitempty"`
	Ready   bool   `json:"ready,omitempty"`
}

TiCDCCapture is TiCDC Capture status

func (*TiCDCCapture) DeepCopy

func (in *TiCDCCapture) DeepCopy() *TiCDCCapture

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiCDCCapture.

func (*TiCDCCapture) DeepCopyInto

func (in *TiCDCCapture) DeepCopyInto(out *TiCDCCapture)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiCDCConfig

type TiCDCConfig struct {
	// Time zone of TiCDC
	// Optional: Defaults to UTC
	// +optional
	Timezone *string `toml:"tz,omitempty" json:"timezone,omitempty"`

	// CDC GC safepoint TTL duration, specified in seconds
	// Optional: Defaults to 86400
	// +optional
	GCTTL *int32 `toml:"gc-ttl,omitempty" json:"gcTTL,omitempty"`

	// LogLevel is the log level
	// Optional: Defaults to info
	// +optional
	LogLevel *string `toml:"log-level,omitempty" json:"logLevel,omitempty"`

	// LogFile is the log file
	// Optional: Defaults to /dev/stderr
	// +optional
	LogFile *string `toml:"log-file,omitempty" json:"logFile,omitempty"`
}

TiCDCConfig is the configuration of tidbcdc ref https://github.com/pingcap/ticdc/blob/a28d9e43532edc4a0380f0ef87314631bf18d866/pkg/config/config.go#L176 +k8s:openapi-gen=true

func (*TiCDCConfig) DeepCopy

func (in *TiCDCConfig) DeepCopy() *TiCDCConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiCDCConfig.

func (*TiCDCConfig) DeepCopyInto

func (in *TiCDCConfig) DeepCopyInto(out *TiCDCConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiCDCSpec

type TiCDCSpec struct {
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// Specify a Service Account for TiCDC
	ServiceAccount string `json:"serviceAccount,omitempty"`

	// The desired ready replicas
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// TLSClientSecretNames are the names of secrets that store the
	// client certificates for the downstream.
	// +optional
	TLSClientSecretNames []string `json:"tlsClientSecretNames,omitempty"`

	// Base image of the component, image tag is now allowed during validation
	// +kubebuilder:default=pingcap/ticdc
	// +optional
	BaseImage string `json:"baseImage"`

	// Config is the Configuration of tidbcdc servers
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Config *CDCConfigWraper `json:"config,omitempty"`

	// StorageVolumes configure additional storage for TiCDC pods.
	// +optional
	StorageVolumes []StorageVolume `json:"storageVolumes,omitempty"`

	// The storageClassName of the persistent volume for TiCDC data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`

	// GracefulShutdownTimeout is the timeout of gracefully shutdown a TiCDC pod.
	// Encoded in the format of Go Duration.
	// Defaults to 10m
	// +optional
	GracefulShutdownTimeout *metav1.Duration `json:"gracefulShutdownTimeout,omitempty"`
}

TiCDCSpec contains details of TiCDC members +k8s:openapi-gen=true

func (*TiCDCSpec) DeepCopy

func (in *TiCDCSpec) DeepCopy() *TiCDCSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiCDCSpec.

func (*TiCDCSpec) DeepCopyInto

func (in *TiCDCSpec) DeepCopyInto(out *TiCDCSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiCDCStatus

type TiCDCStatus struct {
	Synced      bool                    `json:"synced,omitempty"`
	Phase       MemberPhase             `json:"phase,omitempty"`
	StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"`
	Captures    map[string]TiCDCCapture `json:"captures,omitempty"`
	// Volumes contains the status of all volumes.
	Volumes map[StorageVolumeName]*StorageVolumeStatus `json:"volumes,omitempty"`
	// Represents the latest available observations of a component's state.
	// +optional
	// +nullable
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

TiCDCStatus is TiCDC status

func (*TiCDCStatus) DeepCopy

func (in *TiCDCStatus) DeepCopy() *TiCDCStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiCDCStatus.

func (*TiCDCStatus) DeepCopyInto

func (in *TiCDCStatus) DeepCopyInto(out *TiCDCStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiCDCStatus) GetConditions added in v1.3.6

func (s *TiCDCStatus) GetConditions() []metav1.Condition

func (*TiCDCStatus) GetPhase added in v1.3.6

func (s *TiCDCStatus) GetPhase() MemberPhase

func (*TiCDCStatus) GetStatefulSet added in v1.3.7

func (s *TiCDCStatus) GetStatefulSet() *appsv1.StatefulSetStatus

func (*TiCDCStatus) GetSynced added in v1.3.6

func (s *TiCDCStatus) GetSynced() bool

func (*TiCDCStatus) GetVolReplaceInProgress added in v1.5.1

func (s *TiCDCStatus) GetVolReplaceInProgress() bool

func (*TiCDCStatus) GetVolumes added in v1.3.6

func (s *TiCDCStatus) GetVolumes() map[StorageVolumeName]*StorageVolumeStatus

func (*TiCDCStatus) MemberType added in v1.3.7

func (s *TiCDCStatus) MemberType() MemberType

func (*TiCDCStatus) RemoveCondition added in v1.3.6

func (s *TiCDCStatus) RemoveCondition(conditionType string)

func (*TiCDCStatus) SetCondition added in v1.3.6

func (s *TiCDCStatus) SetCondition(newCondition metav1.Condition)

func (*TiCDCStatus) SetPhase added in v1.3.7

func (s *TiCDCStatus) SetPhase(phase MemberPhase)

func (*TiCDCStatus) SetStatefulSet added in v1.3.7

func (s *TiCDCStatus) SetStatefulSet(sts *appsv1.StatefulSetStatus)

func (*TiCDCStatus) SetSynced added in v1.3.7

func (s *TiCDCStatus) SetSynced(synced bool)

func (*TiCDCStatus) SetVolReplaceInProgress added in v1.5.1

func (s *TiCDCStatus) SetVolReplaceInProgress(status bool)

func (*TiCDCStatus) SetVolumes added in v1.4.0

func (s *TiCDCStatus) SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)

type TiDBAccessConfig

type TiDBAccessConfig struct {
	// Host is the tidb cluster access address
	Host string `json:"host"`
	// Port is the port number to use for connecting tidb cluster
	Port int32 `json:"port,omitempty"`
	// User is the user for login tidb cluster
	User string `json:"user,omitempty"`
	// SecretName is the name of secret which stores tidb cluster's password.
	SecretName string `json:"secretName"`
	// TLSClientSecretName is the name of secret which stores tidb server client certificate
	// Optional: Defaults to nil
	// +optional
	TLSClientSecretName *string `json:"tlsClientSecretName,omitempty"`
}

TiDBAccessConfig defines the configuration for access tidb cluster +k8s:openapi-gen=true

func (*TiDBAccessConfig) DeepCopy

func (in *TiDBAccessConfig) DeepCopy() *TiDBAccessConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBAccessConfig.

func (*TiDBAccessConfig) DeepCopyInto

func (in *TiDBAccessConfig) DeepCopyInto(out *TiDBAccessConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiDBAccessConfig) GetTidbEndpoint

func (tac *TiDBAccessConfig) GetTidbEndpoint() string

GetTidbEndpoint return the tidb endpoint for access tidb cluster directly

func (*TiDBAccessConfig) GetTidbPort

func (tac *TiDBAccessConfig) GetTidbPort() int32

GetTidbPort return the tidb port

func (*TiDBAccessConfig) GetTidbUser

func (tac *TiDBAccessConfig) GetTidbUser() string

GetTidbUser return the tidb user

type TiDBConfig

type TiDBConfig struct {
	// +optional
	Cors *string `toml:"cors,omitempty" json:"cors,omitempty"`
	// +optional
	Socket *string `toml:"socket,omitempty" json:"socket,omitempty"`
	// Optional: Defaults to 45s
	// +optional
	Lease *string `toml:"lease,omitempty" json:"lease,omitempty"`
	// Optional: Defaults to true
	// +optional
	RunDDL *bool `toml:"run-ddl,omitempty" json:"run-ddl,omitempty"`
	// Optional: Defaults to true
	// +optional
	SplitTable *bool `toml:"split-table,omitempty" json:"split-table,omitempty"`
	// Optional: Defaults to 1000
	// +optional
	TokenLimit *uint `toml:"token-limit,omitempty" json:"token-limit,omitempty"`
	// +optional
	OOMUseTmpStorage *bool `toml:"oom-use-tmp-storage,omitempty" json:"oom-use-tmp-storage,omitempty"`
	// +optional
	TempStoragePath *string `toml:"tmp-storage-path,omitempty" json:"tmp-storage-path,omitempty"`
	// Optional: Defaults to log
	// +optional
	OOMAction *string `toml:"oom-action,omitempty" json:"oom-action,omitempty"`
	// Optional: Defaults to 3072
	// +optional
	MaxIndexLength *int64 `toml:"max-index-length,omitempty" json:"max-index-length,omitempty"`
	// Optional: Defaults to 34359738368
	// +optional
	MemQuotaQuery *int64 `toml:"mem-quota-query,omitempty" json:"mem-quota-query,omitempty"`
	// TempStorageQuota describe the temporary storage Quota during query exector when OOMUseTmpStorage is enabled
	// If the quota exceed the capacity of the TempStoragePath, the tidb-server would exit with fatal error
	// +optional
	TempStorageQuota *int64 `toml:"tmp-storage-quota,omitempty" json:"tmp-storage-quota,omitempty"` // Bytes
	// Optional: Defaults to false
	// +optional
	EnableStreaming *bool `toml:"enable-streaming,omitempty" json:"enable-streaming,omitempty"`
	// Optional: Defaults to false
	// +optional
	EnableBatchDML *bool `toml:"enable-batch-dml,omitempty" json:"enable-batch-dml,omitempty"`
	// Deprecated in v4.0.0
	// +optional
	TxnLocalLatches *TxnLocalLatches `toml:"txn-local-latches,omitempty" json:"txn-local-latches,omitempty"`
	// +optional
	LowerCaseTableNames *int `toml:"lower-case-table-names,omitempty" json:"lower-case-table-names,omitempty"`
	// +optional
	Log *Log `toml:"log,omitempty" json:"log,omitempty"`
	// +optional
	Security *Security `toml:"security,omitempty" json:"security,omitempty"`
	// +optional
	Status *Status `toml:"status,omitempty" json:"status,omitempty"`
	// +optional
	Performance *Performance `toml:"performance,omitempty" json:"performance,omitempty"`
	// +optional
	PreparedPlanCache *PreparedPlanCache `toml:"prepared-plan-cache,omitempty" json:"prepared-plan-cache,omitempty"`
	// +optional
	OpenTracing *OpenTracing `toml:"opentracing,omitempty" json:"opentracing,omitempty"`
	// +optional
	ProxyProtocol *ProxyProtocol `toml:"proxy-protocol,omitempty" json:"proxy-protocol,omitempty"`
	// +optional
	TiKVClient *TiKVClient `toml:"tikv-client,omitempty" json:"tikv-client,omitempty"`
	// +optional
	Binlog *Binlog `toml:"binlog,omitempty" json:"binlog,omitempty"`
	// +optional
	CompatibleKillQuery *bool `toml:"compatible-kill-query,omitempty" json:"compatible-kill-query,omitempty"`
	// +optional
	Plugin *Plugin `toml:"plugin,omitempty" json:"plugin,omitempty"`
	// +optional
	PessimisticTxn *PessimisticTxn `toml:"pessimistic-txn,omitempty" json:"pessimistic-txn,omitempty"`
	// Optional: Defaults to true
	// +optional
	CheckMb4ValueInUTF8 *bool `toml:"check-mb4-value-in-utf8,omitempty" json:"check-mb4-value-in-utf8,omitempty"`
	// Optional: Defaults to false
	// +optional
	AlterPrimaryKey *bool `toml:"alter-primary-key,omitempty" json:"alter-primary-key,omitempty"`
	// Optional: Defaults to true
	// +optional
	TreatOldVersionUTF8AsUTF8MB4 *bool `toml:"treat-old-version-utf8-as-utf8mb4,omitempty" json:"treat-old-version-utf8-as-utf8mb4,omitempty"`
	// Optional: Defaults to 1000
	// +optional
	SplitRegionMaxNum *uint64 `toml:"split-region-max-num,omitempty" json:"split-region-max-num,omitempty"`
	// +optional
	StmtSummary *StmtSummary `toml:"stmt-summary,omitempty" json:"stmt-summary,omitempty"`
	// RepairMode indicates that the TiDB is in the repair mode for table meta.
	// +optional
	RepairMode *bool `toml:"repair-mode,omitempty" json:"repair-mode,omitempty"`
	// +optional
	RepairTableList []string `toml:"repair-table-list,omitempty" json:"repair-table-list,omitempty"`
	// IsolationRead indicates that the TiDB reads data from which isolation level(engine and label).
	// +optional
	IsolationRead *IsolationRead `toml:"isolation-read,omitempty" json:"isolation-read,omitempty"`
	// MaxServerConnections is the maximum permitted number of simultaneous client connections.
	// +optional
	MaxServerConnections *uint32 `toml:"max-server-connections,omitempty" json:"max-server-connections,omitempty"`
	// NewCollationsEnabledOnFirstBootstrap indicates if the new collations are enabled, it effects only when a TiDB cluster bootstrapped on the first time.
	// +optional
	NewCollationsEnabledOnFirstBootstrap *bool `toml:"new_collations_enabled_on_first_bootstrap,omitempty" json:"new_collations_enabled_on_first_bootstrap,omitempty"`
	// Experimental contains parameters for experimental features.
	// +optional
	Experimental *Experimental `toml:"experimental,omitempty" json:"experimental,omitempty"`
	// EnableDynamicConfig enables the TiDB to fetch configs from PD and update itself during runtime.
	// see https://github.com/pingcap/tidb/pull/13660 for more details.
	// +optional
	EnableDynamicConfig *bool `toml:"enable-dynamic-config,omitempty" json:"enable-dynamic-config,omitempty"`
	// imported from v3.1.0
	// +optional
	EnableTableLock *bool `toml:"enable-table-lock,omitempty" json:"enable-table-lock,omitempty"`
	// imported from v3.1.0
	// +optional
	DelayCleanTableLock *uint64 `toml:"delay-clean-table-lock,omitempty" json:"delay-clean-table-lock,omitempty"`
	// imported from v4.0.5
	// SkipRegisterToDashboard tells TiDB don't register itself to the dashboard.
	// +optional
	SkipRegisterToDashboard *bool `toml:"skip-register-to-dashboard,omitempty" json:"skip-register-to-dashboard,omitempty"`
	// When enabled, usage data (for example, instance versions) will be reported to PingCAP periodically for user experience analytics.
	// If this config is set to `false` on all TiDB servers, telemetry will be always disabled regardless of the value of the global variable `tidb_enable_telemetry`.
	// See PingCAP privacy policy for details: https://pingcap.com/en/privacy-policy/.
	// Imported from v4.0.2.
	// Optional: Defaults to true
	// +optional
	EnableTelemetry *bool `toml:"enable-telemetry,omitempty" json:"enable-telemetry,omitempty"`
	// Labels are labels for TiDB server
	// +optional
	Labels map[string]string `toml:"labels,omitempty" json:"labels,omitempty"`
}

TiDBConfig is the configuration of tidb-server For more detail, refer to https://pingcap.com/docs/stable/reference/configuration/tidb-server/configuration/ +k8s:openapi-gen=true

func (*TiDBConfig) DeepCopy

func (in *TiDBConfig) DeepCopy() *TiDBConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBConfig.

func (*TiDBConfig) DeepCopyInto

func (in *TiDBConfig) DeepCopyInto(out *TiDBConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiDBConfigWraper

type TiDBConfigWraper struct {
	*config.GenericConfig `json:",inline"`
}

TiDBConfigWraper simply wrapps a GenericConfig

func NewTiDBConfig

func NewTiDBConfig() *TiDBConfigWraper

NewTiDBConfig returns an empty config structure

func (*TiDBConfigWraper) DeepCopy

func (in *TiDBConfigWraper) DeepCopy() *TiDBConfigWraper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBConfigWraper.

func (*TiDBConfigWraper) DeepCopyInto

func (in *TiDBConfigWraper) DeepCopyInto(out *TiDBConfigWraper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiDBConfigWraper) MarshalJSON

func (c *TiDBConfigWraper) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler interface.

func (*TiDBConfigWraper) MarshalTOML

func (c *TiDBConfigWraper) MarshalTOML() ([]byte, error)

func (*TiDBConfigWraper) UnmarshalJSON

func (c *TiDBConfigWraper) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler interface. If the data is a object, we must use the Deprecated TiDBConfig to Unmarshal for compatibility, if we use a map[string]interface{} to Unmarshal directly, we can not distinct the type between integer and float for toml.

type TiDBFailureMember

type TiDBFailureMember struct {
	PodName string `json:"podName,omitempty"`
	// +nullable
	CreatedAt metav1.Time `json:"createdAt,omitempty"`
}

TiDBFailureMember is the tidb failure member information

func (*TiDBFailureMember) DeepCopy

func (in *TiDBFailureMember) DeepCopy() *TiDBFailureMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBFailureMember.

func (*TiDBFailureMember) DeepCopyInto

func (in *TiDBFailureMember) DeepCopyInto(out *TiDBFailureMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiDBInitializer

type TiDBInitializer struct {
	CreatePassword bool `json:"createPassword,omitempty"`
}

func (*TiDBInitializer) DeepCopy

func (in *TiDBInitializer) DeepCopy() *TiDBInitializer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBInitializer.

func (*TiDBInitializer) DeepCopyInto

func (in *TiDBInitializer) DeepCopyInto(out *TiDBInitializer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiDBMember

type TiDBMember struct {
	Name   string `json:"name"`
	Health bool   `json:"health"`
	// Last time the health transitioned from one to another.
	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// Node hosting pod of this TiDB member.
	NodeName string `json:"node,omitempty"`
}

TiDBMember is TiDB member

func (*TiDBMember) DeepCopy

func (in *TiDBMember) DeepCopy() *TiDBMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBMember.

func (*TiDBMember) DeepCopyInto

func (in *TiDBMember) DeepCopyInto(out *TiDBMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiDBServiceSpec

type TiDBServiceSpec struct {
	// +k8s:openapi-gen=false
	ServiceSpec `json:",inline"`

	// ExternalTrafficPolicy of the service
	// Optional: Defaults to omitted
	// +optional
	ExternalTrafficPolicy *corev1.ServiceExternalTrafficPolicyType `json:"externalTrafficPolicy,omitempty"`

	// Whether expose the status port
	// Optional: Defaults to true
	// +optional
	ExposeStatus *bool `json:"exposeStatus,omitempty"`

	// Expose the tidb cluster mysql port to MySQLNodePort
	// Optional: Defaults to 0
	// +optional
	MySQLNodePort *int `json:"mysqlNodePort,omitempty"`

	// Expose the tidb status node port to StatusNodePort
	// Optional: Defaults to 0
	// +optional
	StatusNodePort *int `json:"statusNodePort,omitempty"`

	// Expose additional ports for TiDB
	// Optional: Defaults to omitted
	// +optional
	AdditionalPorts []corev1.ServicePort `json:"additionalPorts,omitempty"`
}

TiDBServiceSpec defines `.tidb.service` field of `TidbCluster.spec`. +k8s:openapi-gen=true

func (*TiDBServiceSpec) DeepCopy

func (in *TiDBServiceSpec) DeepCopy() *TiDBServiceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBServiceSpec.

func (*TiDBServiceSpec) DeepCopyInto

func (in *TiDBServiceSpec) DeepCopyInto(out *TiDBServiceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiDBServiceSpec) GetMySQLNodePort

func (tidbSvc *TiDBServiceSpec) GetMySQLNodePort() int32

GetMySQLNodePort returns the mysqlNodePort config in spec.tidb.service

func (*TiDBServiceSpec) GetPortName added in v1.3.3

func (tidbSvc *TiDBServiceSpec) GetPortName() string

GetPortName returns the service port name in spec.tidb.service

func (*TiDBServiceSpec) GetStatusNodePort

func (tidbSvc *TiDBServiceSpec) GetStatusNodePort() int32

GetStatusNodePort returns the statusNodePort config in spec.tidb.service

func (*TiDBServiceSpec) ShouldExposeStatus

func (tidbSvc *TiDBServiceSpec) ShouldExposeStatus() bool

type TiDBSlowLogTailerSpec

type TiDBSlowLogTailerSpec struct {
	corev1.ResourceRequirements `json:",inline"`

	// (Deprecated) Image used for slowlog tailer.
	// Use `spec.helper.image` instead
	// +k8s:openapi-gen=false
	Image *string `json:"image,omitempty"`

	// (Deprecated) ImagePullPolicy of the component. Override the cluster-level imagePullPolicy if present
	// Use `spec.helper.imagePullPolicy` instead
	// +k8s:openapi-gen=false
	ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

TiDBSlowLogTailerSpec represents an optional log tailer sidecar with TiDB +k8s:openapi-gen=true

func (*TiDBSlowLogTailerSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBSlowLogTailerSpec.

func (*TiDBSlowLogTailerSpec) DeepCopyInto

func (in *TiDBSlowLogTailerSpec) DeepCopyInto(out *TiDBSlowLogTailerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiDBSpec

type TiDBSpec struct {
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// Specify a Service Account for tidb
	ServiceAccount string `json:"serviceAccount,omitempty"`

	// The desired ready replicas
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// Base image of the component, image tag is now allowed during validation
	// +kubebuilder:default=pingcap/tidb
	// +optional
	BaseImage string `json:"baseImage"`

	// Service defines a Kubernetes service of TiDB cluster.
	// Optional: No kubernetes service will be created by default.
	// +optional
	Service *TiDBServiceSpec `json:"service,omitempty"`

	// Whether enable TiDB Binlog, it is encouraged to not set this field and rely on the default behavior
	// Optional: Defaults to true if PumpSpec is non-nil, otherwise false
	// +optional
	BinlogEnabled *bool `json:"binlogEnabled,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"`

	// Whether output the slow log in an separate sidecar container
	// Optional: Defaults to true
	// +optional
	SeparateSlowLog *bool `json:"separateSlowLog,omitempty"`

	// Optional volume name configuration for slow query log.
	// +optional
	SlowLogVolumeName string `json:"slowLogVolumeName,omitempty"`

	// The specification of the slow log tailer sidecar
	// +optional
	SlowLogTailer *TiDBSlowLogTailerSpec `json:"slowLogTailer,omitempty"`

	// Whether enable the TLS connection between the SQL client and TiDB server
	// Optional: Defaults to nil
	// +optional
	TLSClient *TiDBTLSClient `json:"tlsClient,omitempty"`

	// Whether enable `tidb_auth_token` authentication method. The tidb_auth_token authentication method is used only for the internal operation of TiDB Cloud.
	// Optional: Defaults to false
	// +optional
	TokenBasedAuthEnabled *bool `json:"tokenBasedAuthEnabled,omitempty"`

	// Plugins is a list of plugins that are loaded by TiDB server, empty means plugin disabled
	// +optional
	Plugins []string `json:"plugins,omitempty"`

	// Config is the Configuration of tidb-servers
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Config *TiDBConfigWraper `json:"config,omitempty"`

	// Lifecycle describes actions that the management system should take in response to container lifecycle
	// events. For the PostStart and PreStop lifecycle handlers, management of the container blocks
	// until the action is complete, unless the container process fails, in which case the handler is aborted.
	// +optional
	Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty"`

	// StorageVolumes configure additional storage for TiDB pods.
	// +optional
	StorageVolumes []StorageVolume `json:"storageVolumes,omitempty"`

	// The storageClassName of the persistent volume for TiDB data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`

	// Initializer is the init configurations of TiDB
	//
	// +optional
	Initializer *TiDBInitializer `json:"initializer,omitempty"`

	// BootstrapSQLConfigMapName is the name of the ConfigMap which contains the bootstrap SQL file with the key `bootstrap-sql`,
	// which will only be executed when a TiDB cluster bootstrap on the first time.
	// The field should be set ONLY when create a TC, since it only take effect on the first time bootstrap.
	// Only v6.5.1+ supports this feature.
	// +optional
	BootstrapSQLConfigMapName *string `json:"bootstrapSQLConfigMapName,omitempty"`

	// ScalePolicy is the scale configuration for TiDB.
	// +optional
	ScalePolicy ScalePolicy `json:"scalePolicy,omitempty"`

	// CustomizedStartupProbe is the customized startup probe for TiDB.
	// You can provide your own startup probe for TiDB.
	// The image will be an init container, and the tidb-server container will copy the probe binary from it, and execute it.
	// The probe binary in the image should be placed under the root directory, i.e., `/your-probe`.
	// +optional
	CustomizedStartupProbe *CustomizedProbe `json:"customizedStartupProbe,omitempty"`

	// Arguments is the extra command line arguments for TiDB server.
	// +optional
	Arguments []string `json:"arguments,omitempty"`
}

TiDBSpec contains details of TiDB members +k8s:openapi-gen=true

func (*TiDBSpec) DeepCopy

func (in *TiDBSpec) DeepCopy() *TiDBSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBSpec.

func (*TiDBSpec) DeepCopyInto

func (in *TiDBSpec) DeepCopyInto(out *TiDBSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiDBSpec) GetScaleInParallelism added in v1.6.0

func (tidb *TiDBSpec) GetScaleInParallelism() int

func (*TiDBSpec) GetScaleOutParallelism added in v1.6.0

func (tidb *TiDBSpec) GetScaleOutParallelism() int

func (*TiDBSpec) GetServicePort added in v1.3.3

func (tidb *TiDBSpec) GetServicePort() int32

GetServicePort returns the service port for tidb

func (*TiDBSpec) GetSlowLogTailerSpec

func (tidb *TiDBSpec) GetSlowLogTailerSpec() TiDBSlowLogTailerSpec

func (*TiDBSpec) IsBootstrapSQLEnabled added in v1.5.0

func (tidb *TiDBSpec) IsBootstrapSQLEnabled() bool

func (*TiDBSpec) IsTLSClientEnabled

func (tidb *TiDBSpec) IsTLSClientEnabled() bool

func (*TiDBSpec) ShouldSeparateSlowLog

func (tidb *TiDBSpec) ShouldSeparateSlowLog() bool

type TiDBStatus

type TiDBStatus struct {
	Phase                    MemberPhase                  `json:"phase,omitempty"`
	StatefulSet              *apps.StatefulSetStatus      `json:"statefulSet,omitempty"`
	Members                  map[string]TiDBMember        `json:"members,omitempty"`
	FailureMembers           map[string]TiDBFailureMember `json:"failureMembers,omitempty"`
	ResignDDLOwnerRetryCount int32                        `json:"resignDDLOwnerRetryCount,omitempty"`
	Image                    string                       `json:"image,omitempty"`
	PasswordInitialized      *bool                        `json:"passwordInitialized,omitempty"`
	// Volumes contains the status of all volumes.
	Volumes map[StorageVolumeName]*StorageVolumeStatus `json:"volumes,omitempty"`
	// Represents the latest available observations of a component's state.
	// +optional
	// +nullable
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// Indicates that a Volume replace using VolumeReplacing feature is in progress.
	VolReplaceInProgress bool `json:"volReplaceInProgress,omitempty"`
}

TiDBStatus is TiDB status

func (*TiDBStatus) DeepCopy

func (in *TiDBStatus) DeepCopy() *TiDBStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBStatus.

func (*TiDBStatus) DeepCopyInto

func (in *TiDBStatus) DeepCopyInto(out *TiDBStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiDBStatus) GetConditions added in v1.3.6

func (s *TiDBStatus) GetConditions() []metav1.Condition

func (*TiDBStatus) GetPhase added in v1.3.6

func (s *TiDBStatus) GetPhase() MemberPhase

func (*TiDBStatus) GetStatefulSet added in v1.3.7

func (s *TiDBStatus) GetStatefulSet() *appsv1.StatefulSetStatus

func (*TiDBStatus) GetSynced added in v1.3.6

func (s *TiDBStatus) GetSynced() bool

func (*TiDBStatus) GetVolReplaceInProgress added in v1.5.1

func (s *TiDBStatus) GetVolReplaceInProgress() bool

func (*TiDBStatus) GetVolumes added in v1.3.6

func (s *TiDBStatus) GetVolumes() map[StorageVolumeName]*StorageVolumeStatus

func (*TiDBStatus) MemberType added in v1.3.7

func (s *TiDBStatus) MemberType() MemberType

func (*TiDBStatus) RemoveCondition added in v1.3.6

func (s *TiDBStatus) RemoveCondition(conditionType string)

func (*TiDBStatus) SetCondition added in v1.3.6

func (s *TiDBStatus) SetCondition(newCondition metav1.Condition)

func (*TiDBStatus) SetPhase added in v1.3.7

func (s *TiDBStatus) SetPhase(phase MemberPhase)

func (*TiDBStatus) SetStatefulSet added in v1.3.7

func (s *TiDBStatus) SetStatefulSet(sts *appsv1.StatefulSetStatus)

func (*TiDBStatus) SetSynced added in v1.3.7

func (s *TiDBStatus) SetSynced(synced bool)

func (*TiDBStatus) SetVolReplaceInProgress added in v1.5.1

func (s *TiDBStatus) SetVolReplaceInProgress(status bool)

func (*TiDBStatus) SetVolumes added in v1.4.0

func (s *TiDBStatus) SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)

type TiDBTLSClient

type TiDBTLSClient struct {
	// When enabled, TiDB will accept TLS encrypted connections from MySQL client
	// The steps to enable this feature:
	//   1. Generate a TiDB server-side certificate and a client-side certifiacete for the TiDB cluster.
	//      There are multiple ways to generate certificates:
	//        - user-provided certificates: https://pingcap.com/docs/stable/how-to/secure/enable-tls-clients/
	//        - use the K8s built-in certificate signing system signed certificates: https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/
	//        - or use cert-manager signed certificates: https://cert-manager.io/
	//   2. Create a K8s Secret object which contains the TiDB server-side certificate created above.
	//      The name of this Secret must be: <clusterName>-tidb-server-secret.
	//        kubectl create secret generic <clusterName>-tidb-server-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
	//   3. Create a K8s Secret object which contains the TiDB client-side certificate created above which will be used by TiDB Operator.
	//      The name of this Secret must be: <clusterName>-tidb-client-secret.
	//        kubectl create secret generic <clusterName>-tidb-client-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
	//   4. Set Enabled to `true`.
	// +optional
	Enabled bool `json:"enabled,omitempty"`

	// DisableClientAuthn will skip client's certificate validation from the TiDB server.
	// Optional: defaults to false
	// +optional
	DisableClientAuthn bool `json:"disableClientAuthn,omitempty"`

	// SkipInternalClientCA will skip TiDB server's certificate validation for internal components like Initializer, Dashboard, etc.
	// Optional: defaults to false
	// +optional
	SkipInternalClientCA bool `json:"skipInternalClientCA,omitempty"`
}

TiDBTLSClient can enable TLS connection between TiDB server and MySQL client +k8s:openapi-gen=true

func (*TiDBTLSClient) DeepCopy

func (in *TiDBTLSClient) DeepCopy() *TiDBTLSClient

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBTLSClient.

func (*TiDBTLSClient) DeepCopyInto

func (in *TiDBTLSClient) DeepCopyInto(out *TiDBTLSClient)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiFlashCommonConfigWraper

type TiFlashCommonConfigWraper struct {
	*config.GenericConfig `json:",inline"`
}

func NewTiFlashCommonConfig

func NewTiFlashCommonConfig() *TiFlashCommonConfigWraper

func (*TiFlashCommonConfigWraper) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiFlashCommonConfigWraper.

func (*TiFlashCommonConfigWraper) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiFlashCommonConfigWraper) MarshalJSON

func (c *TiFlashCommonConfigWraper) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler interface.

func (*TiFlashCommonConfigWraper) MarshalTOML

func (c *TiFlashCommonConfigWraper) MarshalTOML() ([]byte, error)

func (*TiFlashCommonConfigWraper) UnmarshalJSON

func (c *TiFlashCommonConfigWraper) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler interface. If the data is a object, we must use the Deprecated TiFlashCommonConfig to Unmarshal for compatibility, if we use a map[string]interface{} to Unmarshal directly, we can not distinct the type between integer and float for toml.

type TiFlashConfig

type TiFlashConfig struct {
	// commonConfig is the Configuration of TiFlash process
	// +optional
	CommonConfig *CommonConfig `json:"config,omitempty"`

	// proxyConfig is the Configuration of proxy process
	// +optional
	ProxyConfig *ProxyConfig `json:"proxy,omitempty"`
}

TiFlashConfig is the configuration of TiFlash. +k8s:openapi-gen=true

func (*TiFlashConfig) DeepCopy

func (in *TiFlashConfig) DeepCopy() *TiFlashConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiFlashConfig.

func (*TiFlashConfig) DeepCopyInto

func (in *TiFlashConfig) DeepCopyInto(out *TiFlashConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiFlashConfigWraper

type TiFlashConfigWraper struct {
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Common *TiFlashCommonConfigWraper `json:"config,omitempty"`
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Proxy *TiFlashProxyConfigWraper `json:"proxy,omitempty"`
}

func NewTiFlashConfig

func NewTiFlashConfig() *TiFlashConfigWraper

func (*TiFlashConfigWraper) DeepCopy

func (in *TiFlashConfigWraper) DeepCopy() *TiFlashConfigWraper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiFlashConfigWraper.

func (*TiFlashConfigWraper) DeepCopyInto

func (in *TiFlashConfigWraper) DeepCopyInto(out *TiFlashConfigWraper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiFlashProxyConfigWraper

type TiFlashProxyConfigWraper struct {
	*config.GenericConfig `json:",inline"`
}

func NewTiFlashProxyConfig

func NewTiFlashProxyConfig() *TiFlashProxyConfigWraper

func (*TiFlashProxyConfigWraper) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiFlashProxyConfigWraper.

func (*TiFlashProxyConfigWraper) DeepCopyInto

func (in *TiFlashProxyConfigWraper) DeepCopyInto(out *TiFlashProxyConfigWraper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiFlashProxyConfigWraper) MarshalJSON

func (c *TiFlashProxyConfigWraper) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler interface.

func (*TiFlashProxyConfigWraper) MarshalTOML

func (c *TiFlashProxyConfigWraper) MarshalTOML() ([]byte, error)

func (*TiFlashProxyConfigWraper) UnmarshalJSON

func (c *TiFlashProxyConfigWraper) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler interface. If the data is a object, we must use the Deprecated TiFlashProxyConfig to Unmarshal for compatibility, if we use a map[string]interface{} to Unmarshal directly, we can not distinct the type between integer and float for toml.

type TiFlashSpec

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=0
	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 *TiFlashConfigWraper `json:"config,omitempty"`

	// Initializer is the configurations of the init container for TiFlash
	//
	// +optional
	Initializer *InitContainerSpec `json:"initializer,omitempty"`

	// LogTailer is the configurations of the log tailers for TiFlash
	// +optional
	LogTailer *LogTailerSpec `json:"logTailer,omitempty"`

	// RecoverFailover indicates that Operator can recover the failover Pods
	// +optional
	RecoverFailover bool `json:"recoverFailover,omitempty"`

	// Failover is the configurations of failover
	// +optional
	Failover *Failover `json:"failover,omitempty"`

	// ScalePolicy is the scale configuration for TiFlash
	// +optional
	ScalePolicy ScalePolicy `json:"scalePolicy,omitempty"`
}

TiFlashSpec contains details of TiFlash members +k8s:openapi-gen=true

func (*TiFlashSpec) DeepCopy

func (in *TiFlashSpec) DeepCopy() *TiFlashSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiFlashSpec.

func (*TiFlashSpec) DeepCopyInto

func (in *TiFlashSpec) DeepCopyInto(out *TiFlashSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiFlashSpec) DoesMountCMInTiflashContainer added in v1.6.0

func (tiflash *TiFlashSpec) DoesMountCMInTiflashContainer() bool

func (*TiFlashSpec) GetRecoverByUID

func (tiflash *TiFlashSpec) GetRecoverByUID() types.UID

func (*TiFlashSpec) GetScaleInParallelism added in v1.4.0

func (tiflash *TiFlashSpec) GetScaleInParallelism() int

func (*TiFlashSpec) GetScaleOutParallelism added in v1.4.0

func (tiflash *TiFlashSpec) GetScaleOutParallelism() int

type TiFlashStatus

type TiFlashStatus struct {
	Synced          bool                        `json:"synced,omitempty"`
	Phase           MemberPhase                 `json:"phase,omitempty"`
	StatefulSet     *apps.StatefulSetStatus     `json:"statefulSet,omitempty"`
	Stores          map[string]TiKVStore        `json:"stores,omitempty"`
	PeerStores      map[string]TiKVStore        `json:"peerStores,omitempty"`
	TombstoneStores map[string]TiKVStore        `json:"tombstoneStores,omitempty"`
	FailureStores   map[string]TiKVFailureStore `json:"failureStores,omitempty"`
	FailoverUID     types.UID                   `json:"failoverUID,omitempty"`
	Image           string                      `json:"image,omitempty"`
	// Volumes contains the status of all volumes.
	Volumes map[StorageVolumeName]*StorageVolumeStatus `json:"volumes,omitempty"`
	// Represents the latest available observations of a component's state.
	// +optional
	// +nullable
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

TiFlashStatus is TiFlash status

func (*TiFlashStatus) DeepCopy

func (in *TiFlashStatus) DeepCopy() *TiFlashStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiFlashStatus.

func (*TiFlashStatus) DeepCopyInto

func (in *TiFlashStatus) DeepCopyInto(out *TiFlashStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiFlashStatus) GetConditions added in v1.3.6

func (s *TiFlashStatus) GetConditions() []metav1.Condition

func (*TiFlashStatus) GetPhase added in v1.3.6

func (s *TiFlashStatus) GetPhase() MemberPhase

func (*TiFlashStatus) GetStatefulSet added in v1.3.7

func (s *TiFlashStatus) GetStatefulSet() *appsv1.StatefulSetStatus

func (*TiFlashStatus) GetSynced added in v1.3.6

func (s *TiFlashStatus) GetSynced() bool

func (*TiFlashStatus) GetVolReplaceInProgress added in v1.5.1

func (s *TiFlashStatus) GetVolReplaceInProgress() bool

func (*TiFlashStatus) GetVolumes added in v1.3.6

func (*TiFlashStatus) MemberType added in v1.3.7

func (s *TiFlashStatus) MemberType() MemberType

func (*TiFlashStatus) RemoveCondition added in v1.3.6

func (s *TiFlashStatus) RemoveCondition(conditionType string)

func (*TiFlashStatus) SetCondition added in v1.3.6

func (s *TiFlashStatus) SetCondition(newCondition metav1.Condition)

func (*TiFlashStatus) SetPhase added in v1.3.7

func (s *TiFlashStatus) SetPhase(phase MemberPhase)

func (*TiFlashStatus) SetStatefulSet added in v1.3.7

func (s *TiFlashStatus) SetStatefulSet(sts *appsv1.StatefulSetStatus)

func (*TiFlashStatus) SetSynced added in v1.3.7

func (s *TiFlashStatus) SetSynced(synced bool)

func (*TiFlashStatus) SetVolReplaceInProgress added in v1.5.1

func (s *TiFlashStatus) SetVolReplaceInProgress(status bool)

func (*TiFlashStatus) SetVolumes added in v1.4.0

func (s *TiFlashStatus) SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)

type TiKVBackupConfig

type TiKVBackupConfig struct {
	// +optional
	NumThreads *int64 `json:"num-threads,omitempty" toml:"num-threads,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVBackupConfig) DeepCopy

func (in *TiKVBackupConfig) DeepCopy() *TiKVBackupConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVBackupConfig.

func (*TiKVBackupConfig) DeepCopyInto

func (in *TiKVBackupConfig) DeepCopyInto(out *TiKVBackupConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVBlockCacheConfig

type TiKVBlockCacheConfig struct {
	// Optional: Defaults to true
	// +optional
	Shared *bool `json:"shared,omitempty" toml:"shared,omitempty"`
	// +optional
	Capacity *string `json:"capacity,omitempty" toml:"capacity,omitempty"`
	// +optional
	NumShardBits *int64 `json:"num-shard-bits,omitempty" toml:"num-shard-bits,omitempty"`
	// +optional
	StrictCapacityLimit *bool `json:"strict-capacity-limit,omitempty" toml:"strict-capacity-limit,omitempty"`
	// +optional
	HighPriPoolRatio *float64 `json:"high-pri-pool-ratio,omitempty" toml:"high-pri-pool-ratio,omitempty"`
	// +optional
	MemoryAllocator *string `json:"memory-allocator,omitempty" toml:"memory-allocator,omitempty"`
}

TiKVBlockCacheConfig is the config of a block cache +k8s:openapi-gen=true

func (*TiKVBlockCacheConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVBlockCacheConfig.

func (*TiKVBlockCacheConfig) DeepCopyInto

func (in *TiKVBlockCacheConfig) DeepCopyInto(out *TiKVBlockCacheConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVCfConfig

type TiKVCfConfig struct {
	// +optional
	BlockSize *string `json:"block-size,omitempty" toml:"block-size,omitempty"`
	// +optional
	BlockCacheSize *string `json:"block-cache-size,omitempty" toml:"block-cache-size,omitempty"`
	// +optional
	DisableBlockCache *bool `json:"disable-block-cache,omitempty" toml:"disable-block-cache,omitempty"`
	// +optional
	CacheIndexAndFilterBlocks *bool `json:"cache-index-and-filter-blocks,omitempty" toml:"cache-index-and-filter-blocks,omitempty"`
	// +optional
	PinL0FilterAndIndexBlocks *bool `json:"pin-l0-filter-and-index-blocks,omitempty" toml:"pin-l0-filter-and-index-blocks,omitempty"`
	// +optional
	UseBloomFilter *bool `json:"use-bloom-filter,omitempty" toml:"use-bloom-filter,omitempty"`
	// +optional
	OptimizeFiltersForHits *bool `json:"optimize-filters-for-hits,omitempty" toml:"optimize-filters-for-hits,omitempty"`
	// +optional
	WholeKeyFiltering *bool `json:"whole-key-filtering,omitempty" toml:"whole-key-filtering,omitempty"`
	// +optional
	BloomFilterBitsPerKey *int64 `json:"bloom-filter-bits-per-key,omitempty" toml:"bloom-filter-bits-per-key,omitempty"`
	// +optional
	BlockBasedBloomFilter *bool `json:"block-based-bloom-filter,omitempty" toml:"block-based-bloom-filter,omitempty"`
	// +optional
	ReadAmpBytesPerBit *int64 `json:"read-amp-bytes-per-bit,omitempty" toml:"read-amp-bytes-per-bit,omitempty"`
	// +optional
	CompressionPerLevel []string `json:"compression-per-level,omitempty" toml:"compression-per-level,omitempty"`
	// +optional
	WriteBufferSize *string `json:"write-buffer-size,omitempty" toml:"write-buffer-size,omitempty"`
	// +optional
	MaxWriteBufferNumber *int64 `json:"max-write-buffer-number,omitempty" toml:"max-write-buffer-number,omitempty"`
	// +optional
	MinWriteBufferNumberToMerge *int64 `json:"min-write-buffer-number-to-merge,omitempty" toml:"min-write-buffer-number-to-merge,omitempty"`
	// +optional
	MaxBytesForLevelBase *string `json:"max-bytes-for-level-base,omitempty" toml:"max-bytes-for-level-base,omitempty"`
	// +optional
	TargetFileSizeBase *string `json:"target-file-size-base,omitempty" toml:"target-file-size-base,omitempty"`
	// +optional
	Level0FileNumCompactionTrigger *int64 `json:"level0-file-num-compaction-trigger,omitempty" toml:"level0-file-num-compaction-trigger,omitempty"`
	// +optional
	Level0SlowdownWritesTrigger *int64 `json:"level0-slowdown-writes-trigger,omitempty" toml:"level0-slowdown-writes-trigger,omitempty"`
	// +optional
	Level0StopWritesTrigger *int64 `json:"level0-stop-writes-trigger,omitempty" toml:"level0-stop-writes-trigger,omitempty"`
	// +optional
	MaxCompactionBytes *string `json:"max-compaction-bytes,omitempty" toml:"max-compaction-bytes,omitempty"`
	// +optional
	CompactionPri *int64 `json:"compaction-pri,omitempty" toml:"compaction-pri,omitempty"`
	// +optional
	DynamicLevelBytes *bool `json:"dynamic-level-bytes,omitempty" toml:"dynamic-level-bytes,omitempty"`
	// +optional
	NumLevels *int64 `json:"num-levels,omitempty" toml:"num-levels,omitempty"`
	// +optional
	MaxBytesForLevelMultiplier *int64 `json:"max-bytes-for-level-multiplier,omitempty" toml:"max-bytes-for-level-multiplier,omitempty"`
	// +optional
	CompactionStyle *int64 `json:"compaction-style,omitempty" toml:"compaction-style,omitempty"`
	// +optional
	DisableAutoCompactions *bool `json:"disable-auto-compactions,omitempty" toml:"disable-auto-compactions,omitempty"`
	// +optional
	SoftPendingCompactionBytesLimit *string `json:"soft-pending-compaction-bytes-limit,omitempty" toml:"soft-pending-compaction-bytes-limit,omitempty"`
	// +optional
	HardPendingCompactionBytesLimit *string `json:"hard-pending-compaction-bytes-limit,omitempty" toml:"hard-pending-compaction-bytes-limit,omitempty"`
	// +optional
	ForceConsistencyChecks *bool `json:"force-consistency-checks,omitempty" toml:"force-consistency-checks,omitempty"`
	// +optional
	PropSizeIndexDistance *int64 `json:"prop-size-index-distance,omitempty" toml:"prop-size-index-distance,omitempty"`
	// +optional
	PropKeysIndexDistance *int64 `json:"prop-keys-index-distance,omitempty" toml:"prop-keys-index-distance,omitempty"`
	// +optional
	EnableDoublySkiplist *bool `json:"enable-doubly-skiplist,omitempty" toml:"enable-doubly-skiplist,omitempty"`
	// +optional
	Titan *TiKVTitanCfConfig `json:"titan,omitempty" toml:"titan,omitempty"`
}

TiKVCfConfig is the config of a cf +k8s:openapi-gen=true

func (*TiKVCfConfig) DeepCopy

func (in *TiKVCfConfig) DeepCopy() *TiKVCfConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVCfConfig.

func (*TiKVCfConfig) DeepCopyInto

func (in *TiKVCfConfig) DeepCopyInto(out *TiKVCfConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVClient

type TiKVClient struct {
	// GrpcConnectionCount is the max gRPC connections that will be established
	// with each tikv-server.
	// Optional: Defaults to 16
	// +optional
	GrpcConnectionCount *uint `toml:"grpc-connection-count,omitempty" json:"grpc-connection-count,omitempty"`
	// After a duration of this time in seconds if the client doesn't see any activity it pings
	// the server to see if the transport is still alive.
	// Optional: Defaults to 10
	// +optional
	GrpcKeepAliveTime *uint `toml:"grpc-keepalive-time,omitempty" json:"grpc-keepalive-time,omitempty"`
	// After having pinged for keepalive check, the client waits for a duration of Timeout in seconds
	// and if no activity is seen even after that the connection is closed.
	// Optional: Defaults to 3
	// +optional
	GrpcKeepAliveTimeout *uint `toml:"grpc-keepalive-timeout,omitempty" json:"grpc-keepalive-timeout,omitempty"`
	// CommitTimeout is the max time which command 'commit' will wait.
	// Optional: Defaults to 41s
	// +optional
	CommitTimeout *string `toml:"commit-timeout,omitempty" json:"commit-timeout,omitempty"`
	// Deprecated in v4.0.0
	// MaxTxnTimeUse is the max time a Txn may use (in seconds) from its startTS to commitTS.
	// Optional: Defaults to 590
	// +optional
	MaxTxnTimeUse *uint `toml:"max-txn-time-use,omitempty" json:"max-txn-time-use,omitempty"`
	// MaxBatchSize is the max batch size when calling batch commands API.
	// Optional: Defaults to 128
	// +optional
	MaxBatchSize *uint `toml:"max-batch-size,omitempty" json:"max-batch-size,omitempty"`
	// If TiKV load is greater than this, TiDB will wait for a while to avoid little batch.
	// Optional: Defaults to 200
	// +optional
	OverloadThreshold *uint `toml:"overload-threshold,omitempty" json:"overload-threshold,omitempty"`
	// MaxBatchWaitTime in nanosecond is the max wait time for batch.
	// Optional: Defaults to 0
	// +optional
	MaxBatchWaitTime *time.Duration `toml:"max-batch-wait-time,omitempty" json:"max-batch-wait-time,omitempty"`
	// BatchWaitSize is the max wait size for batch.
	// Optional: Defaults to 8
	// +optional
	BatchWaitSize *uint `toml:"batch-wait-size,omitempty" json:"batch-wait-size,omitempty"`
	// If a Region has not been accessed for more than the given duration (in seconds), it
	// will be reloaded from the PD.
	// Optional: Defaults to 600
	// +optional
	RegionCacheTTL *uint `toml:"region-cache-ttl,omitempty" json:"region-cache-ttl,omitempty"`
	// If a store has been up to the limit, it will return error for successive request to
	// prevent the store occupying too much token in dispatching level.
	// Optional: Defaults to 0
	// +optional
	StoreLimit *int64 `toml:"store-limit,omitempty" json:"store-limit,omitempty"`
	// StoreLivenessTimeout is the timeout for store liveness check request.
	// +optional
	StoreLivenessTimeout *string `toml:"store-liveness-timeout,omitempty" json:"store-liveness-timeout,omitempty"`
	// +optional
	CoprCache *CoprocessorCache `toml:"copr-cache,omitempty" json:"copr-cache,omitempty"`
}

TiKVClient is the config for tikv client. +k8s:openapi-gen=true

func (*TiKVClient) DeepCopy

func (in *TiKVClient) DeepCopy() *TiKVClient

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVClient.

func (*TiKVClient) DeepCopyInto

func (in *TiKVClient) DeepCopyInto(out *TiKVClient)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVConfig

type TiKVConfig 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
	LogFormat *string `json:"log-format,omitempty" toml:"log-format,omitempty"`
	// +optional
	SlowLogFile *string `json:"slow-log-file,omitempty" toml:"slow-log-file,omitempty"`
	// +optional
	SlowLogThreshold *string `json:"slow-log-threshold,omitempty" toml:"slow-log-threshold,omitempty"`
	// Optional: Defaults to 24h
	// +optional
	LogRotationTimespan *string `json:"log-rotation-timespan,omitempty" toml:"log-rotation-timespan,omitempty"`
	// +optional
	LogRotationSize *string `json:"log-rotation-size,omitempty" toml:"log-rotation-size,omitempty"`
	// +optional
	RefreshConfigInterval *string `json:"refresh-config-interval,omitempty" toml:"refresh-config-interval,omitempty"`
	// +optional
	PanicWhenUnexpectedKeyOrData *bool `json:"panic-when-unexpected-key-or-data,omitempty" toml:"panic-when-unexpected-key-or-data,omitempty"`
	// +optional
	Server *TiKVServerConfig `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"`
	// +optional
	TiKVPessimisticTxn *TiKVPessimisticTxn `json:"pessimistic-txn,omitempty" toml:"pessimistic-txn,omitempty"`
	// +optional
	Backup *TiKVBackupConfig `json:"backup,omitempty" toml:"backup,omitempty"`
}

TiKVConfig is the configuration of TiKV. +k8s:openapi-gen=true

func (*TiKVConfig) DeepCopy

func (in *TiKVConfig) DeepCopy() *TiKVConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVConfig.

func (*TiKVConfig) DeepCopyInto

func (in *TiKVConfig) DeepCopyInto(out *TiKVConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVConfigWraper

type TiKVConfigWraper struct {
	*config.GenericConfig `json:",inline"`
}

func NewTiKVConfig

func NewTiKVConfig() *TiKVConfigWraper

func (*TiKVConfigWraper) DeepCopy

func (in *TiKVConfigWraper) DeepCopy() *TiKVConfigWraper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVConfigWraper.

func (*TiKVConfigWraper) DeepCopyInto

func (in *TiKVConfigWraper) DeepCopyInto(out *TiKVConfigWraper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiKVConfigWraper) MarshalJSON

func (c *TiKVConfigWraper) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler interface.

func (*TiKVConfigWraper) MarshalTOML

func (c *TiKVConfigWraper) MarshalTOML() ([]byte, error)

func (*TiKVConfigWraper) UnmarshalJSON

func (c *TiKVConfigWraper) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler interface. If the data is a object, we must use the Deprecated TiKVConfig to Unmarshal for compatibility, if we use a map[string]interface{} to Unmarshal directly, we can not distinct the type between integer and float for toml.

type TiKVCoprocessorConfig

type TiKVCoprocessorConfig struct {
	// When it is set to `true`, TiKV will try to split a Region with table prefix if that Region
	// crosses tables.
	// It is recommended to turn off this option if there will be a large number of tables created.
	// Optional: Defaults to false
	// optional
	SplitRegionOnTable *bool `json:"split-region-on-table,omitempty" toml:"split-region-on-table,omitempty"`

	// One split check produces several split keys in batch. This config limits the number of produced
	// split keys in one batch.
	// optional
	BatchSplitLimit *int64 `json:"batch-split-limit,omitempty" toml:"batch-split-limit,omitempty"`

	// When Region [a,e) size exceeds `region-max-size`, it will be split into several Regions [a,b),
	// [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region-split-size` (or a
	// little larger). See also: region-split-size
	// Optional: Defaults to 144MB
	// optional
	RegionMaxSize *string `json:"region-max-size,omitempty" toml:"region-max-size,omitempty"`

	// When Region [a,e) size exceeds `region-max-size`, it will be split into several Regions [a,b),
	// [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region-split-size` (or a
	// little larger). See also: region-max-size
	// Optional: Defaults to 96MB
	// optional
	RegionSplitSize *string `json:"region-split-size,omitempty" toml:"region-split-size,omitempty"`

	// When the number of keys in Region [a,e) exceeds the `region-max-keys`, it will be split into
	// several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be
	// `region-split-keys`. See also: region-split-keys
	// Optional: Defaults to 1440000
	// optional
	RegionMaxKeys *int64 `json:"region-max-keys,omitempty" toml:"region-max-keys,omitempty"`

	// When the number of keys in Region [a,e) exceeds the `region-max-keys`, it will be split into
	// several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be
	// `region-split-keys`. See also: region-max-keys
	// Optional: Defaults to 960000
	// optional
	RegionSplitKeys *int64 `json:"region-split-keys,omitempty" toml:"region-split-keys,omitempty"`
}

TiKVCoprocessorConfig is the configuration of TiKV Coprocessor component. +k8s:openapi-gen=true

func (*TiKVCoprocessorConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVCoprocessorConfig.

func (*TiKVCoprocessorConfig) DeepCopyInto

func (in *TiKVCoprocessorConfig) DeepCopyInto(out *TiKVCoprocessorConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVCoprocessorReadPoolConfig

type TiKVCoprocessorReadPoolConfig struct {
	// Optional: Defaults to 8
	// +optional
	HighConcurrency *int64 `json:"high-concurrency,omitempty" toml:"high-concurrency,omitempty"`
	// Optional: Defaults to 8
	// +optional
	NormalConcurrency *int64 `json:"normal-concurrency,omitempty" toml:"normal-concurrency,omitempty"`
	// Optional: Defaults to 8
	// +optional
	LowConcurrency *int64 `json:"low-concurrency,omitempty" toml:"low-concurrency,omitempty"`
	// Optional: Defaults to 2000
	// +optional
	MaxTasksPerWorkerHigh *int64 `json:"max-tasks-per-worker-high,omitempty" toml:"max-tasks-per-worker-high,omitempty"`
	// Optional: Defaults to 2000
	// +optional
	MaxTasksPerWorkerNormal *int64 `json:"max-tasks-per-worker-normal,omitempty" toml:"max-tasks-per-worker-normal,omitempty"`
	// Optional: Defaults to 2000
	// +optional
	MaxTasksPerWorkerLow *int64 `json:"max-tasks-per-worker-low,omitempty" toml:"max-tasks-per-worker-low,omitempty"`
	// Optional: Defaults to 10MB
	// +optional
	StackSize *string `json:"stack-size,omitempty" toml:"stack-size,omitempty"`
	// Optional: Defaults to true
	// +optional
	UseUnifiedPool *bool `json:"use-unified-pool,omitempty" toml:"use-unified-pool,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVCoprocessorReadPoolConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVCoprocessorReadPoolConfig.

func (*TiKVCoprocessorReadPoolConfig) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVDbConfig

type TiKVDbConfig struct {
	// +optional
	// Optional: Defaults to 2
	WalRecoveryMode *int64 `json:"wal-recovery-mode,omitempty" toml:"wal-recovery-mode,omitempty"`
	// +optional
	WalTTLSeconds *int64 `json:"wal-ttl-seconds,omitempty" toml:"wal-ttl-seconds,omitempty"`
	// +optional
	WalSizeLimit *string `json:"wal-size-limit,omitempty" toml:"wal-size-limit,omitempty"`
	// +optional
	// Optional: Defaults to 4GB
	MaxTotalWalSize *string `json:"max-total-wal-size,omitempty" toml:"max-total-wal-size,omitempty"`
	// +optional
	// Optional: Defaults to 8
	MaxBackgroundJobs *int64 `json:"max-background-jobs,omitempty" toml:"max-background-jobs,omitempty"`
	// +optional
	// Optional: Defaults to 128MB
	MaxManifestFileSize *string `json:"max-manifest-file-size,omitempty" toml:"max-manifest-file-size,omitempty"`
	// +optional
	// Optional: Defaults to true
	CreateIfMissing *bool `json:"create-if-missing,omitempty" toml:"create-if-missing,omitempty"`
	// +optional
	// Optional: Defaults to 40960
	MaxOpenFiles *int64 `json:"max-open-files,omitempty" toml:"max-open-files,omitempty"`
	// +optional
	// Optional: Defaults to true
	EnableStatistics *bool `json:"enable-statistics,omitempty" toml:"enable-statistics,omitempty"`
	// +optional
	// Optional: Defaults to 10m
	StatsDumpPeriod *string `json:"stats-dump-period,omitempty" toml:"stats-dump-period,omitempty"`
	// Optional: Defaults to 0
	// +optional
	CompactionReadaheadSize *string `json:"compaction-readahead-size,omitempty" toml:"compaction-readahead-size,omitempty"`
	// +optional
	InfoLogMaxSize *string `json:"info-log-max-size,omitempty" toml:"info-log-max-size,omitempty"`
	// +optional
	InfoLogRollTime *string `json:"info-log-roll-time,omitempty" toml:"info-log-roll-time,omitempty"`
	// +optional
	InfoLogKeepLogFileNum *int64 `json:"info-log-keep-log-file-num,omitempty" toml:"info-log-keep-log-file-num,omitempty"`
	// +optional
	InfoLogDir *string `json:"info-log-dir,omitempty" toml:"info-log-dir,omitempty"`
	// +optional
	RateBytesPerSec *string `json:"rate-bytes-per-sec,omitempty" toml:"rate-bytes-per-sec,omitempty"`
	// +optional
	RateLimiterMode *int64 `json:"rate-limiter-mode,omitempty" toml:"rate-limiter-mode,omitempty"`
	// +optional
	AutoTuned *bool `json:"auto-tuned,omitempty" toml:"auto-tuned,omitempty"`
	// +optional
	BytesPerSync *string `json:"bytes-per-sync,omitempty" toml:"bytes-per-sync,omitempty"`
	// +optional
	WalBytesPerSync *string `json:"wal-bytes-per-sync,omitempty" toml:"wal-bytes-per-sync,omitempty"`
	// +optional
	// Optional: Defaults to 3
	MaxSubCompactions *int64 `json:"max-sub-compactions,omitempty" toml:"max-sub-compactions,omitempty"`
	// +optional
	WritableFileMaxBufferSize *string `json:"writable-file-max-buffer-size,omitempty" toml:"writable-file-max-buffer-size,omitempty"`
	// +optional
	UseDirectIoForFlushAndCompaction *bool `json:"use-direct-io-for-flush-and-compaction,omitempty" toml:"use-direct-io-for-flush-and-compaction,omitempty"`
	// +optional
	EnablePipelinedWrite *bool `json:"enable-pipelined-write,omitempty" toml:"enable-pipelined-write,omitempty"`
	// +optional
	Defaultcf *TiKVCfConfig `json:"defaultcf,omitempty" toml:"defaultcf,omitempty"`
	// +optional
	Writecf *TiKVCfConfig `json:"writecf,omitempty" toml:"writecf,omitempty"`
	// +optional
	Lockcf *TiKVCfConfig `json:"lockcf,omitempty" toml:"lockcf,omitempty"`
	// +optional
	Raftcf *TiKVCfConfig `json:"raftcf,omitempty" toml:"raftcf,omitempty"`
	// +optional
	Titan *TiKVTitanDBConfig `json:"titan,omitempty" toml:"titan,omitempty"`
}

TiKVDbConfig is the rocksdb config. +k8s:openapi-gen=true

func (*TiKVDbConfig) DeepCopy

func (in *TiKVDbConfig) DeepCopy() *TiKVDbConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVDbConfig.

func (*TiKVDbConfig) DeepCopyInto

func (in *TiKVDbConfig) DeepCopyInto(out *TiKVDbConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVEncryptionConfig

type TiKVEncryptionConfig struct {
	// Encrypyion method, use data key encryption raw rocksdb data
	// Possible values: plaintext, aes128-ctr, aes192-ctr, aes256-ctr
	// Optional: Default to plaintext
	// optional
	Method *string `json:"data-encryption-method,omitempty" toml:"data-encryption-method,omitempty"`

	// The frequency of datakey rotation, It managered by tikv
	// Optional: default to 7d
	// optional
	DataKeyRotationPeriod *string `json:"data-key-rotation-period,omitempty" toml:"data-key-rotation-period,omitempty"`

	// Master key config
	MasterKey *TiKVMasterKeyConfig `json:"master-key,omitempty" toml:"master-key,omitempty"`

	// Previous master key config
	// It used in master key rotation, the data key should decryption by previous master key and  then encrypytion by new master key
	PreviousMasterKey *TiKVMasterKeyConfig `json:"previous-master-key,omitempty" toml:"previoud-master-key,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVEncryptionConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVEncryptionConfig.

func (*TiKVEncryptionConfig) DeepCopyInto

func (in *TiKVEncryptionConfig) DeepCopyInto(out *TiKVEncryptionConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVFailureStore

type TiKVFailureStore struct {
	PodName      string                    `json:"podName,omitempty"`
	StoreID      string                    `json:"storeID,omitempty"`
	PVCUIDSet    map[types.UID]EmptyStruct `json:"pvcUIDSet,omitempty"`
	StoreDeleted bool                      `json:"storeDeleted,omitempty"`
	HostDown     bool                      `json:"hostDown,omitempty"`
	// +nullable
	CreatedAt metav1.Time `json:"createdAt,omitempty"`
}

TiKVFailureStore is the tikv failure store information

func (*TiKVFailureStore) DeepCopy

func (in *TiKVFailureStore) DeepCopy() *TiKVFailureStore

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVFailureStore.

func (*TiKVFailureStore) DeepCopyInto

func (in *TiKVFailureStore) DeepCopyInto(out *TiKVFailureStore)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVGCConfig

type TiKVGCConfig struct {
	// +optional
	// Optional: Defaults to 512
	BatchKeys *int64 `json:"batch-keys,omitempty" toml:"batch-keys,omitempty"`
	// +optional
	MaxWriteBytesPerSec *string `json:"max-write-bytes-per-sec,omitempty" toml:"max-write-bytes-per-sec,omitempty"`
	// +optional
	EnableCompactionFilter *bool `json:"enable-compaction-filter,omitempty" toml:"enable-compaction-filter,omitempty"`
	// +optional
	EnableCompactionFilterSkipVersionCheck *bool `json:"compaction-filter-skip-version-check,omitempty" toml:"compaction-filter-skip-version-check,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVGCConfig) DeepCopy

func (in *TiKVGCConfig) DeepCopy() *TiKVGCConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVGCConfig.

func (*TiKVGCConfig) DeepCopyInto

func (in *TiKVGCConfig) DeepCopyInto(out *TiKVGCConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVImportConfig

type TiKVImportConfig struct {
	// +optional
	ImportDir *string `json:"import-dir,omitempty" toml:"import-dir,omitempty"`
	// +optional
	NumThreads *int64 `json:"num-threads,omitempty" toml:"num-threads,omitempty"`
	// +optional
	NumImportJobs *int64 `json:"num-import-jobs,omitempty" toml:"num-import-jobs,omitempty"`
	// +optional
	NumImportSstJobs *int64 `json:"num-import-sst-jobs,omitempty" toml:"num-import-sst-jobs,omitempty"`
	// +optional
	MaxPrepareDuration *string `json:"max-prepare-duration,omitempty" toml:"max-prepare-duration,omitempty"`
	// +optional
	RegionSplitSize *string `json:"region-split-size,omitempty" toml:"region-split-size,omitempty"`
	// +optional
	StreamChannelWindow *int64 `json:"stream-channel-window,omitempty" toml:"stream-channel-window,omitempty"`
	// +optional
	MaxOpenEngines *int64 `json:"max-open-engines,omitempty" toml:"max-open-engines,omitempty"`
	// +optional
	UploadSpeedLimit *string `json:"upload-speed-limit,omitempty" toml:"upload-speed-limit,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVImportConfig) DeepCopy

func (in *TiKVImportConfig) DeepCopy() *TiKVImportConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVImportConfig.

func (*TiKVImportConfig) DeepCopyInto

func (in *TiKVImportConfig) DeepCopyInto(out *TiKVImportConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVMasterKeyConfig

type TiKVMasterKeyConfig struct {
	// Use KMS encryption or use file encryption, possible values: kms, file
	// If set to kms, kms MasterKeyKMSConfig should be filled, if set to file MasterKeyFileConfig should be filled
	// optional
	Type *string `json:"type,omitempty" toml:"type,omitempty"`

	// Master key file config
	// If the type set to file, this config should be filled
	MasterKeyFileConfig `json:",inline"`

	// Master key KMS config
	// If the type set to kms, this config should be filled
	MasterKeyKMSConfig `json:",inline"`
}

+k8s:openapi-gen=true

func (*TiKVMasterKeyConfig) DeepCopy

func (in *TiKVMasterKeyConfig) DeepCopy() *TiKVMasterKeyConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVMasterKeyConfig.

func (*TiKVMasterKeyConfig) DeepCopyInto

func (in *TiKVMasterKeyConfig) DeepCopyInto(out *TiKVMasterKeyConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVPDConfig

type TiKVPDConfig struct {
	// The PD endpoints for the client.
	//
	// Default is empty.
	// +optional
	Endpoints []string `json:"endpoints,omitempty" toml:"endpoints,omitempty"`
	// The interval at which to retry a PD connection initialization.
	//
	// Default is 300ms.
	// Optional: Defaults to 300ms
	// +optional
	RetryInterval *string `json:"retry-interval,omitempty" toml:"retry-interval,omitempty"`
	// The maximum number of times to retry a PD connection initialization.
	//
	// Default is isize::MAX, represented by -1.
	// Optional: Defaults to -1
	// +optional
	RetryMaxCount *int64 `json:"retry-max-count,omitempty" toml:"retry-max-count,omitempty"`
	// If the client observes the same error message on retry, it can repeat the message only
	// every `n` times.
	//
	// Default is 10. Set to 1 to disable this feature.
	// Optional: Defaults to 10
	// +optional
	RetryLogEvery *int64 `json:"retry-log-every,omitempty" toml:"retry-log-every,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVPDConfig) DeepCopy

func (in *TiKVPDConfig) DeepCopy() *TiKVPDConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVPDConfig.

func (*TiKVPDConfig) DeepCopyInto

func (in *TiKVPDConfig) DeepCopyInto(out *TiKVPDConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVPessimisticTxn

type TiKVPessimisticTxn struct {
	// +optional
	Enabled *bool `json:"enabled,omitempty" toml:"enabled,omitempty"`
	// The default and maximum delay before responding to TiDB when pessimistic
	// transactions encounter locks
	// +optional
	WaitForLockTimeout *string `json:"wait-for-lock-timeout,omitempty" toml:"wait-for-lock-timeout,omitempty"`
	// If more than one transaction is waiting for the same lock, only the one with smallest
	// start timestamp will be waked up immediately when the lock is released. Others will
	// be waked up after `wake_up_delay_duration` to reduce contention and make the oldest
	// one more likely acquires the lock.
	// +optional
	WakeUpDelayDuration *string `json:"wake-up-delay-duration,omitempty" toml:"wake-up-delay-duration,omitempty"`
	// +optional
	Pipelined *bool `json:"pipelined,omitempty" toml:"pipelined,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVPessimisticTxn) DeepCopy

func (in *TiKVPessimisticTxn) DeepCopy() *TiKVPessimisticTxn

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVPessimisticTxn.

func (*TiKVPessimisticTxn) DeepCopyInto

func (in *TiKVPessimisticTxn) DeepCopyInto(out *TiKVPessimisticTxn)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVRaftDBConfig

type TiKVRaftDBConfig struct {
	// +optional
	WalRecoveryMode *string `json:"wal-recovery-mode,omitempty" toml:"wal-recovery-mode,omitempty"`
	// +optional
	WalDir *string `json:"wal-dir,omitempty" toml:"wal-dir,omitempty"`
	// +optional
	WalTtlSeconds *int64 `json:"wal-ttl-seconds,omitempty" toml:"wal-ttl-seconds,omitempty"`
	// +optional
	WalSizeLimit *string `json:"wal-size-limit,omitempty" toml:"wal-size-limit,omitempty"`
	// +optional
	MaxTotalWalSize *string `json:"max-total-wal-size,omitempty" toml:"max-total-wal-size,omitempty"`
	// +optional
	MaxBackgroundJobs *int64 `json:"max-background-jobs,omitempty" toml:"max-background-jobs,omitempty"`
	// +optional
	MaxManifestFileSize *string `json:"max-manifest-file-size,omitempty" toml:"max-manifest-file-size,omitempty"`
	// +optional
	CreateIfMissing *bool `json:"create-if-missing,omitempty" toml:"create-if-missing,omitempty"`
	// +optional
	MaxOpenFiles *int64 `json:"max-open-files,omitempty" toml:"max-open-files,omitempty"`
	// +optional
	EnableStatistics *bool `json:"enable-statistics,omitempty" toml:"enable-statistics,omitempty"`
	// +optional
	StatsDumpPeriod *string `json:"stats-dump-period,omitempty" toml:"stats-dump-period,omitempty"`
	// +optional
	CompactionReadaheadSize *string `json:"compaction-readahead-size,omitempty" toml:"compaction-readahead-size,omitempty"`
	// +optional
	InfoLogMaxSize *string `json:"info-log-max-size,omitempty" toml:"info-log-max-size,omitempty"`
	// +optional
	FnfoLogRollTime *string `json:"info-log-roll-time,omitempty" toml:"info-log-roll-time,omitempty"`
	// +optional
	InfoLogKeepLogFileNum *int64 `json:"info-log-keep-log-file-num,omitempty" toml:"info-log-keep-log-file-num,omitempty"`
	// +optional
	InfoLogDir *string `json:"info-log-dir,omitempty" toml:"info-log-dir,omitempty"`
	// +optional
	MaxSubCompactions *int64 `json:"max-sub-compactions,omitempty" toml:"max-sub-compactions,omitempty"`
	// +optional
	WritableFileMaxBufferSize *string `json:"writable-file-max-buffer-size,omitempty" toml:"writable-file-max-buffer-size,omitempty"`
	// +optional
	UseDirectIoForFlushAndCompaction *bool `json:"use-direct-io-for-flush-and-compaction,omitempty" toml:"use-direct-io-for-flush-and-compaction,omitempty"`
	// +optional
	EnablePipelinedWrite *bool `json:"enable-pipelined-write,omitempty" toml:"enable-pipelined-write,omitempty"`
	// +optional
	AllowConcurrentMemtableWrite *bool `json:"allow-concurrent-memtable-write,omitempty" toml:"allow-concurrent-memtable-write,omitempty"`
	// +optional
	BytesPerSync *string `json:"bytes-per-sync,omitempty" toml:"bytes-per-sync,omitempty"`
	// +optional
	WalBytesPerSync *string `json:"wal-bytes-per-sync,omitempty" toml:"wal-bytes-per-sync,omitempty"`
	// +optional
	Defaultcf *TiKVCfConfig `json:"defaultcf,omitempty" toml:"defaultcf,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVRaftDBConfig) DeepCopy

func (in *TiKVRaftDBConfig) DeepCopy() *TiKVRaftDBConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVRaftDBConfig.

func (*TiKVRaftDBConfig) DeepCopyInto

func (in *TiKVRaftDBConfig) DeepCopyInto(out *TiKVRaftDBConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVRaftstoreConfig

type TiKVRaftstoreConfig struct {
	// true for high reliability, prevent data loss when power failure.
	// Optional: Defaults to true
	// +optional
	SyncLog *bool `json:"sync-log,omitempty" toml:"sync-log,omitempty"`
	// Optional: Defaults to true
	// +optional
	Prevote *bool `json:"prevote,omitempty" toml:"prevote,omitempty"`
	// raft-base-tick-interval is a base tick interval (ms).
	// +optional
	RaftBaseTickInterval *string `json:"raft-base-tick-interval,omitempty" toml:"raft-base-tick-interval,omitempty"`
	// +optional
	RaftHeartbeatTicks *int64 `json:"raft-heartbeat-ticks,omitempty" toml:"raft-heartbeat-ticks,omitempty"`
	// +optional
	RaftElectionTimeoutTicks *int64 `json:"raft-election-timeout-ticks,omitempty" toml:"raft-election-timeout-ticks,omitempty"`
	// When the entry exceed the max size, reject to propose it.
	// Optional: Defaults to 8MB
	// +optional
	RaftEntryMaxSize *string `json:"raft-entry-max-size,omitempty" toml:"raft-entry-max-size,omitempty"`
	// Limit the max size of each append message.
	// Optional: Defaults to 1MB
	// +optional
	RaftMaxSizePerMsg *string `json:"raft-max-size-per-msg,omitempty" toml:"raft-max-size-per-msg,omitempty"`
	// Limit the max number of in-flight append messages during optimistic
	// replication phase.
	// Optional: Defaults to 256
	// +optional
	RaftMaxInflightMsgs *int64 `json:"raft-max-inflight-msgs,omitempty" toml:"raft-max-inflight-msgs,omitempty"`
	// Interval to gc unnecessary raft log (ms).
	// Optional: Defaults to 10s
	// +optional
	RaftLogGCTickInterval *string `json:"raft-log-gc-tick-interval,omitempty" toml:"raft-log-gc-tick-interval,omitempty"`
	// A threshold to gc stale raft log, must >= 1.
	// Optional: Defaults to 50
	// +optional
	RaftLogGCThreshold *int64 `json:"raft-log-gc-threshold,omitempty" toml:"raft-log-gc-threshold,omitempty"`
	// When entry count exceed this value, gc will be forced trigger.
	// Optional: Defaults to 72000
	// +optional
	RaftLogGCCountLimit *int64 `json:"raft-log-gc-count-limit,omitempty" toml:"raft-log-gc-count-limit,omitempty"`
	// When the approximate size of raft log entries exceed this value
	// gc will be forced trigger.
	// Optional: Defaults to 72MB
	// +optional
	RaftLogGCSizeLimit *string `json:"raft-log-gc-size-limit,omitempty" toml:"raft-log-gc-size-limit,omitempty"`
	// When a peer is not responding for this time, leader will not keep entry cache for it.
	// +optional
	RaftEntryCacheLifeTime *string `json:"raft-entry-cache-life-time,omitempty" toml:"raft-entry-cache-life-time,omitempty"`
	// When a peer is newly added, reject transferring leader to the peer for a while.
	// +optional
	RaftRejectTransferLeaderDuration *string `json:"raft-reject-transfer-leader-duration,omitempty" toml:"raft-reject-transfer-leader-duration,omitempty"`

	// Interval (ms) to check region whether need to be split or not.
	// Optional: Defaults to 10s
	// +optional
	SplitRegionCheckTickInterval *string `json:"split-region-check-tick-interval,omitempty" toml:"split-region-check-tick-interval,omitempty"`
	/// When size change of region exceed the diff since last check, it
	/// will be checked again whether it should be split.
	// Optional: Defaults to 6MB
	// +optional
	RegionSplitCheckDiff *string `json:"region-split-check-diff,omitempty" toml:"region-split-check-diff,omitempty"`
	/// Interval (ms) to check whether start compaction for a region.
	// Optional: Defaults to 5m
	// +optional
	RegionCompactCheckInterval *string `json:"region-compact-check-interval,omitempty" toml:"region-compact-check-interval,omitempty"`
	// delay time before deleting a stale peer
	// Optional: Defaults to 10m
	// +optional
	CleanStalePeerDelay *string `json:"clean-stale-peer-delay,omitempty" toml:"clean-stale-peer-delay,omitempty"`
	/// Number of regions for each time checking.
	// Optional: Defaults to 100
	// +optional
	RegionCompactCheckStep *int64 `json:"region-compact-check-step,omitempty" toml:"region-compact-check-step,omitempty"`
	/// Minimum number of tombstones to trigger manual compaction.
	// Optional: Defaults to 10000
	// +optional
	RegionCompactMinTombstones *int64 `json:"region-compact-min-tombstones,omitempty" toml:"region-compact-min-tombstones,omitempty"`
	/// Minimum percentage of tombstones to trigger manual compaction.
	/// Should between 1 and 100.
	// Optional: Defaults to 30
	// +optional
	RegionCompactTombstonesPercent *int64 `json:"region-compact-tombstones-percent,omitempty" toml:"region-compact-tombstones-percent,omitempty"`
	// Optional: Defaults to 60s
	// +optional
	PdHeartbeatTickInterval *string `json:"pd-heartbeat-tick-interval,omitempty" toml:"pd-heartbeat-tick-interval,omitempty"`
	// Optional: Defaults to 10s
	// +optional
	PdStoreHeartbeatTickInterval *string `json:"pd-store-heartbeat-tick-interval,omitempty" toml:"pd-store-heartbeat-tick-interval,omitempty"`
	// +optional
	SnapMgrGCTickInterval *string `json:"snap-mgr-gc-tick-interval,omitempty" toml:"snap-mgr-gc-tick-interval,omitempty"`
	// +optional
	SnapGCTimeout *string `json:"snap-gc-timeout,omitempty" toml:"snap-gc-timeout,omitempty"`
	// +optional
	// Optional: Defaults to 10m
	LockCfCompactInterval *string `json:"lock-cf-compact-interval,omitempty" toml:"lock-cf-compact-interval,omitempty"`
	// +optional
	// Optional: Defaults to 256MB
	LockCfCompactBytesThreshold *string `json:"lock-cf-compact-bytes-threshold,omitempty" toml:"lock-cf-compact-bytes-threshold,omitempty"`

	// +optional
	NotifyCapacity *int64 `json:"notify-capacity,omitempty" toml:"notify-capacity,omitempty"`
	// +optional
	MessagesPerTick *int64 `json:"messages-per-tick,omitempty" toml:"messages-per-tick,omitempty"`

	/// When a peer is not active for max-peer-down-duration
	/// the peer is considered to be down and is reported to PD.
	// Optional: Defaults to 5m
	// +optional
	MaxPeerDownDuration *string `json:"max-peer-down-duration,omitempty" toml:"max-peer-down-duration,omitempty"`

	/// If the leader of a peer is missing for longer than max-leader-missing-duration
	/// the peer would ask pd to confirm whether it is valid in any region.
	/// If the peer is stale and is not valid in any region, it will destroy itself.
	// +optional
	MaxLeaderMissingDuration *string `json:"max-leader-missing-duration,omitempty" toml:"max-leader-missing-duration,omitempty"`
	/// Similar to the max-leader-missing-duration, instead it will log warnings and
	/// try to alert monitoring systems, if there is any.
	// +optional
	AbnormalLeaderMissingDuration *string `json:"abnormal-leader-missing-duration,omitempty" toml:"abnormal-leader-missing-duration,omitempty"`
	// +optional
	PeerStaleStateCheckInterval *string `json:"peer-stale-state-check-interval,omitempty" toml:"peer-stale-state-check-interval,omitempty"`

	// +optional
	LeaderTransferMaxLogLag *int64 `json:"leader-transfer-max-log-lag,omitempty" toml:"leader-transfer-max-log-lag,omitempty"`

	// +optional
	SnapApplyBatchSize *string `json:"snap-apply-batch-size,omitempty" toml:"snap-apply-batch-size,omitempty"`

	// Interval (ms) to check region whether the data is consistent.
	// Optional: Defaults to 0
	// +optional
	ConsistencyCheckInterval *string `json:"consistency-check-interval,omitempty" toml:"consistency-check-interval,omitempty"`

	// +optional
	ReportRegionFlowInterval *string `json:"report-region-flow-interval,omitempty" toml:"report-region-flow-interval,omitempty"`

	// The lease provided by a successfully proposed and applied entry.
	// +optional
	RaftStoreMaxLeaderLease *string `json:"raft-store-max-leader-lease,omitempty" toml:"raft-store-max-leader-lease,omitempty"`

	// Right region derive origin region id when split.
	// +optional
	RightDeriveWhenSplit *bool `json:"right-derive-when-split,omitempty" toml:"right-derive-when-split,omitempty"`

	// +optional
	AllowRemoveLeader *bool `json:"allow-remove-leader,omitempty" toml:"allow-remove-leader,omitempty"`

	/// Max log gap allowed to propose merge.
	// +optional
	MergeMaxLogGap *int64 `json:"merge-max-log-gap,omitempty" toml:"merge-max-log-gap,omitempty"`
	/// Interval to re-propose merge.
	// +optional
	MergeCheckTickInterval *string `json:"merge-check-tick-interval,omitempty" toml:"merge-check-tick-interval,omitempty"`

	// +optional
	UseDeleteRange *bool `json:"use-delete-range,omitempty" toml:"use-delete-range,omitempty"`

	// +optional
	// Optional: Defaults to 10m
	CleanupImportSstInterval *string `json:"cleanup-import-sst-interval,omitempty" toml:"cleanup-import-sst-interval,omitempty"`

	// +optional
	ApplyMaxBatchSize *int64 `json:"apply-max-batch-size,omitempty" toml:"apply-max-batch-size,omitempty"`
	// Optional: Defaults to 2
	// +optional
	ApplyPoolSize *int64 `json:"apply-pool-size,omitempty" toml:"apply-pool-size,omitempty"`

	// +optional
	StoreMaxBatchSize *int64 `json:"store-max-batch-size,omitempty" toml:"store-max-batch-size,omitempty"`
	// Optional: Defaults to 2
	// +optional
	StorePoolSize *int64 `json:"store-pool-size,omitempty" toml:"store-pool-size,omitempty"`
	// Optional: Defaults to 3s
	// +optional
	StoreRescheduleDuration *string `json:"store-reschedule-duration,omitempty" toml:"store-reschedule-duration,omitempty"`
	// Optional: Defaults to 500ms
	// +optional
	ApplyYieldDuration *string `json:"apply-yield-duration,omitempty" toml:"apply-yield-duration,omitempty"`
	// +optional
	HibernateRegions *bool `json:"hibernate-regions,omitempty" toml:"hibernate-regions,omitempty"`
	// Optional: Defaults to false
	// +optional
	ApplyEarly *bool `json:"apply-early,omitempty" toml:"apply-early, omitempty"`
	// Optional: Defaults to 0
	// +optional
	PerfLevel *int64 `json:"perf-level,omitempty" toml:"perf-level, omitempty"`
	// Optional: Defaults to false
	// +optional
	DevAssert *bool `json:"dev-assert,omitempty" toml:"dev-assert, omitempty"`
}

TiKVRaftstoreConfig is the configuration of TiKV raftstore component. +k8s:openapi-gen=true

func (*TiKVRaftstoreConfig) DeepCopy

func (in *TiKVRaftstoreConfig) DeepCopy() *TiKVRaftstoreConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVRaftstoreConfig.

func (*TiKVRaftstoreConfig) DeepCopyInto

func (in *TiKVRaftstoreConfig) DeepCopyInto(out *TiKVRaftstoreConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVReadPoolConfig

type TiKVReadPoolConfig struct {
	// +optional
	Unified *TiKVUnifiedReadPoolConfig `json:"unified,omitempty" toml:"unified,omitempty"`
	// +optional
	Coprocessor *TiKVCoprocessorReadPoolConfig `json:"coprocessor,omitempty" toml:"coprocessor,omitempty"`
	// +optional
	Storage *TiKVStorageReadPoolConfig `json:"storage,omitempty" toml:"storage,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVReadPoolConfig) DeepCopy

func (in *TiKVReadPoolConfig) DeepCopy() *TiKVReadPoolConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVReadPoolConfig.

func (*TiKVReadPoolConfig) DeepCopyInto

func (in *TiKVReadPoolConfig) DeepCopyInto(out *TiKVReadPoolConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVSecurityConfig

type TiKVSecurityConfig struct {
	// +optional
	CAPath *string `json:"ca-path,omitempty" toml:"ca-path,omitempty"`
	// +optional
	CertPath *string `json:"cert-path,omitempty" toml:"cert-path,omitempty"`
	// +optional
	KeyPath *string `json:"key-path,omitempty" toml:"key-path,omitempty"`
	// CertAllowedCN is the Common Name that allowed
	// +optional
	// +k8s:openapi-gen=false
	CertAllowedCN []string `json:"cert-allowed-cn,omitempty" toml:"cert-allowed-cn,omitempty"`
	// +optional
	OverrideSslTarget *string `json:"override-ssl-target,omitempty" toml:"override-ssl-target,omitempty"`
	// +optional
	CipherFile *string `json:"cipher-file,omitempty" toml:"cipher-file,omitempty"`
	// +optional
	Encryption *TiKVSecurityConfigEncryption `json:"encryption,omitempty" toml:"encryption,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVSecurityConfig) DeepCopy

func (in *TiKVSecurityConfig) DeepCopy() *TiKVSecurityConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVSecurityConfig.

func (*TiKVSecurityConfig) DeepCopyInto

func (in *TiKVSecurityConfig) DeepCopyInto(out *TiKVSecurityConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVSecurityConfigEncryption

type TiKVSecurityConfigEncryption struct {
	// Encryption method to use for data files.
	// Possible values are "plaintext", "aes128-ctr", "aes192-ctr" and "aes256-ctr". Value other than
	// "plaintext" means encryption is enabled, in which case master key must be specified.
	// +optional
	DataEncryptionMethod *string `json:"data-encryption-method,omitempty" toml:"data-encryption-method,omitempty"`
	// Specifies how often TiKV rotates data encryption key.
	// +optional
	DataKeyRotationPeriod *string `json:"data-key-rotation-period,omitempty" toml:"data-key-rotation-period,omitempty"`
	// Specifies master key if encryption is enabled. There are three types of master key:
	//
	//   * "plaintext":
	//
	//     Plaintext as master key means no master key is given and only applicable when
	//     encryption is not enabled, i.e. data-encryption-method = "plaintext". This type doesn't
	//     have sub-config items. Example:
	//
	//     [security.encryption.master-key]
	//     type = "plaintext"
	//
	//   * "kms":
	//
	//     Use a KMS service to supply master key. Currently only AWS KMS is supported. This type of
	//     master key is recommended for production use. Example:
	//
	//     [security.encryption.master-key]
	//     type = "kms"
	//     ## KMS CMK key id. Must be a valid KMS CMK where the TiKV process has access to.
	//     ## In production is recommended to grant access of the CMK to TiKV using IAM.
	//     key-id = "1234abcd-12ab-34cd-56ef-1234567890ab"
	//     ## AWS region of the KMS CMK.
	//     region = "us-west-2"
	//     ## (Optional) AWS KMS service endpoint. Only required when non-default KMS endpoint is
	//     ## desired.
	//     endpoint = "https://kms.us-west-2.amazonaws.com"
	//
	//   * "file":
	//
	//     Supply a custom encryption key stored in a file. It is recommended NOT to use in production,
	//     as it breaks the purpose of encryption at rest, unless the file is stored in tempfs.
	//     The file must contain a 256-bits (32 bytes, regardless of key length implied by
	//     data-encryption-method) key encoded as hex string and end with newline ("\n"). Example:
	//
	//     [security.encryption.master-key]
	//     type = "file"
	//     path = "/path/to/master/key/file"
	// +optional
	MasterKey *TiKVSecurityConfigEncryptionMasterKey `json:"master-key,omitempty" toml:"master-key,omitempty"`
	// Specifies the old master key when rotating master key. Same config format as master-key.
	// The key is only access once during TiKV startup, after that TiKV do not need access to the key.
	// And it is okay to leave the stale previous-master-key config after master key rotation.
	// +optional
	PreviousMasterKey *TiKVSecurityConfigEncryptionPreviousMasterKey `json:"previous-master-key,omitempty" toml:"previous-master-key,omitempty"`
}

func (*TiKVSecurityConfigEncryption) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVSecurityConfigEncryption.

func (*TiKVSecurityConfigEncryption) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVSecurityConfigEncryptionMasterKey

type TiKVSecurityConfigEncryptionMasterKey struct {
	// +optional
	Type *string `json:"type" toml:"type,omitempty"`

	// Master key file config
	// If the type set to file, this config should be filled
	MasterKeyFileConfig `json:",inline"`

	// Master key KMS config
	// If the type set to kms, this config should be filled
	MasterKeyKMSConfig `json:",inline"`
}

func (*TiKVSecurityConfigEncryptionMasterKey) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVSecurityConfigEncryptionMasterKey.

func (*TiKVSecurityConfigEncryptionMasterKey) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVSecurityConfigEncryptionPreviousMasterKey

type TiKVSecurityConfigEncryptionPreviousMasterKey struct {
	// +optional
	Type *string `json:"type" toml:"type,omitempty"`

	// Master key file config
	// If the type set to file, this config should be filled
	MasterKeyFileConfig `json:",inline"`

	// Master key KMS config
	// If the type set to kms, this config should be filled
	MasterKeyKMSConfig `json:",inline"`
}

func (*TiKVSecurityConfigEncryptionPreviousMasterKey) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVSecurityConfigEncryptionPreviousMasterKey.

func (*TiKVSecurityConfigEncryptionPreviousMasterKey) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVServerConfig

type TiKVServerConfig struct {
	// Optional: Defaults to 1
	// +optional
	StatusThreadPoolSize *string `json:"status-thread-pool-size,omitempty" toml:"status-thread-pool-size,omitempty"`
	// Optional: Defaults to 10485760
	// +optional
	MaxGrpcSendMsgLen *uint `json:"max-grpc-send-msg-len,omitempty" toml:"max-grpc-send-msg-len,omitempty"`
	// Optional: Defaults to none
	// +optional
	GrpcCompressionType *string `json:"grpc-compression-type,omitempty" toml:"grpc-compression-type,omitempty"`
	// Optional: Defaults to 4
	// +optional
	GrpcConcurrency *uint `json:"grpc-concurrency,omitempty" toml:"grpc-concurrency,omitempty"`
	// Optional: Defaults to 1024
	// +optional
	GrpcConcurrentStream *uint `json:"grpc-concurrent-stream,omitempty" toml:"grpc-concurrent-stream,omitempty"`
	// Optional: Defaults to 32G
	// +optional
	GrpcMemoryQuota *string `json:"grpc-memory-pool-quota,omitempty" toml:"grpc-memory-pool-quota,omitempty"`
	// Optional: Defaults to 10
	// +optional
	GrpcRaftConnNum *uint `json:"grpc-raft-conn-num,omitempty" toml:"grpc-raft-conn-num,omitempty"`
	// Optional: Defaults to 2MB
	// +optional
	GrpcStreamInitialWindowSize *string `json:"grpc-stream-initial-window-size,omitempty" toml:"grpc-stream-initial-window-size,omitempty"`
	// Optional: Defaults to 10s
	// +optional
	GrpcKeepaliveTime *string `json:"grpc-keepalive-time,omitempty" toml:"grpc-keepalive-time,omitempty"`
	// Optional: Defaults to 3s
	// +optional
	GrpcKeepaliveTimeout *string `json:"grpc-keepalive-timeout,omitempty" toml:"grpc-keepalive-timeout,omitempty"`
	// Optional: Defaults to 32
	// +optional
	ConcurrentSendSnapLimit *uint `json:"concurrent-send-snap-limit,omitempty" toml:"concurrent-send-snap-limit,omitempty"`
	// Optional: Defaults to 32
	// +optional
	ConcurrentRecvSnapLimit *uint `json:"concurrent-recv-snap-limit,omitempty" toml:"concurrent-recv-snap-limit,omitempty"`
	// Optional: Defaults to 1000
	// +optional
	EndPointRecursionLimit *uint `json:"end-point-recursion-limit,omitempty" toml:"end-point-recursion-limit,omitempty"`
	// +optional
	EndPointStreamChannelSize *uint `json:"end-point-stream-channel-size,omitempty" toml:"end-point-stream-channel-size,omitempty"`
	// +optional
	EndPointBatchRowLimit *uint `json:"end-point-batch-row-limit,omitempty" toml:"end-point-batch-row-limit,omitempty"`
	// +optional
	EndPointStreamBatchRowLimit *uint `json:"end-point-stream-batch-row-limit,omitempty" toml:"end-point-stream-batch-row-limit,omitempty"`
	// +optional
	EndPointEnableBatchIfPossible *uint `json:"end-point-enable-batch-if-possible,omitempty" toml:"end-point-enable-batch-if-possible,omitempty"`
	// +optional
	EndPointRequestMaxHandleDuration *string `json:"end-point-request-max-handle-duration,omitempty" toml:"end-point-request-max-handle-duration,omitempty"`
	// Optional: Defaults to 100MB
	// +optional
	SnapMaxWriteBytesPerSec *string `json:"snap-max-write-bytes-per-sec,omitempty" toml:"snap-max-write-bytes-per-sec,omitempty"`
	// +optional
	SnapMaxTotalSize *string `json:"snap-max-total-size,omitempty" toml:"snap-max-total-size,omitempty"`
	// +optional
	StatsConcurrency *uint `json:"stats-concurrency,omitempty" toml:"stats-concurrency,omitempty"`
	// +optional
	HeavyLoadThreshold *uint `json:"heavy-load-threshold,omitempty" toml:"heavy-load-threshold,omitempty"`
	// Optional: Defaults to 60s
	// +optional
	HeavyLoadWaitDuration *string `json:"heavy-load-wait-duration,omitempty" toml:"heavy-load-wait-duration,omitempty"`
	// +optional
	Labels map[string]string `json:"labels,omitempty" toml:"labels,omitempty"`
	// +optional
	EnableRequestBatch *bool `json:"enable-request-batch,omitempty" toml:"enable-request-batch,omitempty"`
	// +optional
	RequestBatchEnableCrossCommand *bool `json:"request-batch-enable-cross-command,omitempty" toml:"request-batch-enable-cross-command,omitempty"`
	// +optional
	RequestBatchWaitDuration *string `json:"request-batch-wait-duration,omitempty" toml:"request-batch-wait-duration,omitempty"`
}

TiKVServerConfig is the configuration of TiKV server. +k8s:openapi-gen=true

func (*TiKVServerConfig) DeepCopy

func (in *TiKVServerConfig) DeepCopy() *TiKVServerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVServerConfig.

func (*TiKVServerConfig) DeepCopyInto

func (in *TiKVServerConfig) DeepCopyInto(out *TiKVServerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVSpec

type TiKVSpec struct {
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// Specify a Service Account for tikv
	ServiceAccount string `json:"serviceAccount,omitempty"`

	// The desired ready replicas
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// Base image of the component, image tag is now allowed during validation
	// +kubebuilder:default=pingcap/tikv
	// +optional
	BaseImage string `json:"baseImage"`

	// Whether create the TiKV 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"`

	// Whether output the RocksDB log in a separate sidecar container
	// Optional: Defaults to false
	// +optional
	SeparateRocksDBLog *bool `json:"separateRocksDBLog,omitempty"`

	// Whether output the Raft log in a separate sidecar container
	// Optional: Defaults to false
	// +optional
	SeparateRaftLog *bool `json:"separateRaftLog,omitempty"`

	// Optional volume name configuration for rocksdb log.
	// +optional
	RocksDBLogVolumeName string `json:"rocksDBLogVolumeName,omitempty"`

	// Optional volume name configuration for raft log.
	// +optional
	RaftLogVolumeName string `json:"raftLogVolumeName,omitempty"`

	// LogTailer is the configurations of the log tailers for TiKV
	// +optional
	LogTailer *LogTailerSpec `json:"logTailer,omitempty"`

	// The storageClassName of the persistent volume for TiKV data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`

	// Subdirectory within the volume to store TiKV Data. By default, the data
	// is stored in the root directory of volume which is mounted at
	// /var/lib/tikv.
	// Specifying this will change the data directory to a subdirectory, e.g.
	// /var/lib/tikv/data if you set the value to "data".
	// It's dangerous to change this value for a running cluster as it will
	// upgrade your cluster to use a new storage directory.
	// Defaults to "" (volume's root).
	// +optional
	DataSubDir string `json:"dataSubDir,omitempty"`

	// Config is the Configuration of tikv-servers
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Config *TiKVConfigWraper `json:"config,omitempty"`

	// RecoverFailover indicates that Operator can recover the failed Pods
	// +optional
	RecoverFailover bool `json:"recoverFailover,omitempty"`

	// Failover is the configurations of failover
	// +optional
	Failover *Failover `json:"failover,omitempty"`

	// MountClusterClientSecret indicates whether to mount `cluster-client-secret` to the Pod
	// +optional
	MountClusterClientSecret *bool `json:"mountClusterClientSecret,omitempty"`

	// EvictLeaderTimeout indicates the timeout to evict tikv leader, in the format of Go Duration.
	// Defaults to 1500min
	// +optional
	EvictLeaderTimeout *string `json:"evictLeaderTimeout,omitempty"`

	// WaitLeaderTransferBackTimeout indicates the timeout to wait for leader transfer back before
	// the next tikv upgrade.
	//
	// Defaults to 400s
	// +optional
	WaitLeaderTransferBackTimeout *metav1.Duration `json:"waitLeaderTransferBackTimeout,omitempty"`

	// StorageVolumes configure additional storage for TiKV pods.
	// +optional
	StorageVolumes []StorageVolume `json:"storageVolumes,omitempty"`

	// StoreLabels configures additional labels for TiKV stores.
	// +optional
	StoreLabels []string `json:"storeLabels,omitempty"`

	// EnableNamedStatusPort enables status port(20180) in the Pod spec.
	// If you set it to `true` for an existing cluster, the TiKV cluster will be rolling updated.
	EnableNamedStatusPort bool `json:"enableNamedStatusPort,omitempty"`

	// ScalePolicy is the scale configuration for TiKV
	// +optional
	ScalePolicy ScalePolicy `json:"scalePolicy,omitempty"`
}

TiKVSpec contains details of TiKV members +k8s:openapi-gen=true

func (*TiKVSpec) DeepCopy

func (in *TiKVSpec) DeepCopy() *TiKVSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVSpec.

func (*TiKVSpec) DeepCopyInto

func (in *TiKVSpec) DeepCopyInto(out *TiKVSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiKVSpec) GetLogTailerSpec

func (tikv *TiKVSpec) GetLogTailerSpec() LogTailerSpec

func (*TiKVSpec) GetRecoverByUID

func (tikv *TiKVSpec) GetRecoverByUID() types.UID

func (*TiKVSpec) GetScaleInParallelism added in v1.4.0

func (tikv *TiKVSpec) GetScaleInParallelism() int

func (*TiKVSpec) GetScaleOutParallelism added in v1.4.0

func (tikv *TiKVSpec) GetScaleOutParallelism() int

func (*TiKVSpec) ShouldSeparateRaftLog

func (tikv *TiKVSpec) ShouldSeparateRaftLog() bool

func (*TiKVSpec) ShouldSeparateRocksDBLog

func (tikv *TiKVSpec) ShouldSeparateRocksDBLog() bool

type TiKVStatus

type TiKVStatus struct {
	Synced          bool                          `json:"synced,omitempty"`
	Phase           MemberPhase                   `json:"phase,omitempty"`
	BootStrapped    bool                          `json:"bootStrapped,omitempty"`
	StatefulSet     *apps.StatefulSetStatus       `json:"statefulSet,omitempty"`
	Stores          map[string]TiKVStore          `json:"stores,omitempty"` // key: store id
	PeerStores      map[string]TiKVStore          `json:"peerStores,omitempty"`
	TombstoneStores map[string]TiKVStore          `json:"tombstoneStores,omitempty"`
	FailureStores   map[string]TiKVFailureStore   `json:"failureStores,omitempty"`
	FailoverUID     types.UID                     `json:"failoverUID,omitempty"`
	Image           string                        `json:"image,omitempty"`
	EvictLeader     map[string]*EvictLeaderStatus `json:"evictLeader,omitempty"`
	// Volumes contains the status of all volumes.
	Volumes map[StorageVolumeName]*StorageVolumeStatus `json:"volumes,omitempty"`
	// Represents the latest available observations of a component's state.
	// +optional
	// +nullable
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// Indicates that a Volume replace using VolumeReplacing feature is in progress.
	VolReplaceInProgress bool `json:"volReplaceInProgress,omitempty"`
}

TiKVStatus is TiKV status

func (*TiKVStatus) DeepCopy

func (in *TiKVStatus) DeepCopy() *TiKVStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVStatus.

func (*TiKVStatus) DeepCopyInto

func (in *TiKVStatus) DeepCopyInto(out *TiKVStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiKVStatus) GetConditions added in v1.3.6

func (s *TiKVStatus) GetConditions() []metav1.Condition

func (*TiKVStatus) GetPhase added in v1.3.6

func (s *TiKVStatus) GetPhase() MemberPhase

func (*TiKVStatus) GetStatefulSet added in v1.3.7

func (s *TiKVStatus) GetStatefulSet() *appsv1.StatefulSetStatus

func (*TiKVStatus) GetSynced added in v1.3.6

func (s *TiKVStatus) GetSynced() bool

func (*TiKVStatus) GetVolReplaceInProgress added in v1.5.1

func (s *TiKVStatus) GetVolReplaceInProgress() bool

func (*TiKVStatus) GetVolumes added in v1.3.6

func (s *TiKVStatus) GetVolumes() map[StorageVolumeName]*StorageVolumeStatus

func (*TiKVStatus) MemberType added in v1.3.7

func (s *TiKVStatus) MemberType() MemberType

func (*TiKVStatus) RemoveCondition added in v1.3.6

func (s *TiKVStatus) RemoveCondition(conditionType string)

func (*TiKVStatus) SetCondition added in v1.3.6

func (s *TiKVStatus) SetCondition(newCondition metav1.Condition)

func (*TiKVStatus) SetPhase added in v1.3.7

func (s *TiKVStatus) SetPhase(phase MemberPhase)

func (*TiKVStatus) SetStatefulSet added in v1.3.7

func (s *TiKVStatus) SetStatefulSet(sts *appsv1.StatefulSetStatus)

func (*TiKVStatus) SetSynced added in v1.3.7

func (s *TiKVStatus) SetSynced(synced bool)

func (*TiKVStatus) SetVolReplaceInProgress added in v1.5.1

func (s *TiKVStatus) SetVolReplaceInProgress(status bool)

func (*TiKVStatus) SetVolumes added in v1.4.0

func (s *TiKVStatus) SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)

type TiKVStorageConfig

type TiKVStorageConfig struct {
	// +optional
	MaxKeySize *int64 `json:"max-key-size,omitempty" toml:"max-key-size,omitempty"`
	// Deprecated in v4.0.0
	// +optional
	SchedulerNotifyCapacity *int64 `json:"scheduler-notify-capacity,omitempty" toml:"scheduler-notify-capacity,omitempty"`
	// +optional
	// Optional: Defaults to 2048000
	SchedulerConcurrency *int64 `json:"scheduler-concurrency,omitempty" toml:"scheduler-concurrency,omitempty"`
	// +optional
	// Optional: Defaults to 4
	SchedulerWorkerPoolSize *int64 `json:"scheduler-worker-pool-size,omitempty" toml:"scheduler-worker-pool-size,omitempty"`
	// +optional
	// Optional: Defaults to 100MB
	SchedulerPendingWriteThreshold *string `json:"scheduler-pending-write-threshold,omitempty" toml:"scheduler-pending-write-threshold,omitempty"`
	// +optional
	BlockCache *TiKVBlockCacheConfig `json:"block-cache,omitempty" toml:"block-cache,omitempty"`
	// The size of the temporary file that preoccupies the extra space when
	// TiKV is started. The name of temporary file is `space_placeholder_file`,
	// located in the `storage.data-dir` directory. When TiKV runs out of disk
	// space and cannot be started normally, you can delete this file as an
	// emergency intervention and set it to `0MB`. Default value is 2GB.
	// +optional
	ReserveSpace *string `json:"reserve-space,omitempty" toml:"reserve-space,omitempty"`
}

TiKVStorageConfig is the config of storage +k8s:openapi-gen=true

func (*TiKVStorageConfig) DeepCopy

func (in *TiKVStorageConfig) DeepCopy() *TiKVStorageConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVStorageConfig.

func (*TiKVStorageConfig) DeepCopyInto

func (in *TiKVStorageConfig) DeepCopyInto(out *TiKVStorageConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVStorageReadPoolConfig

type TiKVStorageReadPoolConfig struct {
	// Optional: Defaults to 4
	// +optional
	HighConcurrency *int64 `json:"high-concurrency,omitempty" toml:"high-concurrency,omitempty"`
	// Optional: Defaults to 4
	// +optional
	NormalConcurrency *int64 `json:"normal-concurrency,omitempty" toml:"normal-concurrency,omitempty"`
	// Optional: Defaults to 4
	// +optional
	LowConcurrency *int64 `json:"low-concurrency,omitempty" toml:"low-concurrency,omitempty"`
	// Optional: Defaults to 2000
	// +optional
	MaxTasksPerWorkerHigh *int64 `json:"max-tasks-per-worker-high,omitempty" toml:"max-tasks-per-worker-high,omitempty"`
	// Optional: Defaults to 2000
	// +optional
	MaxTasksPerWorkerNormal *int64 `json:"max-tasks-per-worker-normal,omitempty" toml:"max-tasks-per-worker-normal,omitempty"`
	// Optional: Defaults to 2000
	// +optional
	MaxTasksPerWorkerLow *int64 `json:"max-tasks-per-worker-low,omitempty" toml:"max-tasks-per-worker-low,omitempty"`
	// Optional: Defaults to 10MB
	// +optional
	StackSize *string `json:"stack-size,omitempty" toml:"stack-size,omitempty"`
	// Optional: Defaults to true
	// +optional
	UseUnifiedPool *bool `json:"use-unified-pool,omitempty" toml:"use-unified-pool,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVStorageReadPoolConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVStorageReadPoolConfig.

func (*TiKVStorageReadPoolConfig) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVStore

type TiKVStore struct {
	// store id is also uint64, due to the same reason as pd id, we store id as string
	ID          string `json:"id"`
	PodName     string `json:"podName"`
	IP          string `json:"ip"`
	LeaderCount int32  `json:"leaderCount"`
	State       string `json:"state"`
	// Last time the health transitioned from one to another.
	// TODO: remove nullable, https://github.com/kubernetes/kubernetes/issues/86811
	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// LeaderCountBeforeUpgrade records the leader count before upgrade.
	//
	// It is set when evicting leader and used to wait for most leaders to transfer back after upgrade.
	// It is unset after leader transfer is completed.
	LeaderCountBeforeUpgrade *int32 `json:"leaderCountBeforeUpgrade,omitempty"`
}

TiKVStores is either Up/Down/Offline/Tombstone

func (*TiKVStore) DeepCopy

func (in *TiKVStore) DeepCopy() *TiKVStore

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVStore.

func (*TiKVStore) DeepCopyInto

func (in *TiKVStore) DeepCopyInto(out *TiKVStore)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVTitanCfConfig

type TiKVTitanCfConfig struct {
	// +optional
	MinBlobSize *string `json:"min-blob-size,omitempty" toml:"min-blob-size,omitempty"`
	// +optional
	BlobFileCompression *string `json:"blob-file-compression,omitempty" toml:"blob-file-compression,omitempty"`
	// +optional
	BlobCacheSize *string `json:"blob-cache-size,omitempty" toml:"blob-cache-size,omitempty"`
	// +optional
	MinGcBatchSize *string `json:"min-gc-batch-size,omitempty" toml:"min-gc-batch-size,omitempty"`
	// +optional
	MaxGcBatchSize *string `json:"max-gc-batch-size,omitempty" toml:"max-gc-batch-size,omitempty"`
	// +optional
	DiscardableRatio *float64 `json:"discardable-ratio,omitempty" toml:"discardable-ratio,omitempty"`
	// +optional
	SampleRatio *float64 `json:"sample-ratio,omitempty" toml:"sample-ratio,omitempty"`
	// +optional
	MergeSmallFileThreshold *string `json:"merge-small-file-threshold,omitempty" toml:"merge-small-file-threshold,omitempty"`
	// +optional
	BlobRunMode *string `json:"blob-run-mode,omitempty" toml:"blob-run-mode,omitempty"`
	// optional
	LevelMerge *bool `json:"level_merge,omitempty" toml:"level_merge,omitempty"`
	// optional
	GcMergeRewrite *bool `json:"gc-merge-rewrite,omitempty" toml:"gc-merge-rewrite,omitempty"`
}

TiKVTitanCfConfig is the titian config. +k8s:openapi-gen=true

func (*TiKVTitanCfConfig) DeepCopy

func (in *TiKVTitanCfConfig) DeepCopy() *TiKVTitanCfConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVTitanCfConfig.

func (*TiKVTitanCfConfig) DeepCopyInto

func (in *TiKVTitanCfConfig) DeepCopyInto(out *TiKVTitanCfConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVTitanDBConfig

type TiKVTitanDBConfig struct {
	// +optional
	Enabled *bool `json:"enabled,omitempty" toml:"enabled,omitempty"`
	// +optional
	Dirname *string `json:"dirname,omitempty" toml:"dirname,omitempty"`
	// +optional
	DisableGc *bool `json:"disable-gc,omitempty" toml:"disable-gc,omitempty"`
	// +optional
	MaxBackgroundGc *int64 `json:"max-background-gc,omitempty" toml:"max-background-gc,omitempty"`
	// The value of this field will be truncated to seconds.
	// +optional
	PurgeObsoleteFilesPeriod *string `json:"purge-obsolete-files-period,omitempty" toml:"purge-obsolete-files-period,omitempty"`
}

TiKVTitanDBConfig is the config a titian db. +k8s:openapi-gen=true

func (*TiKVTitanDBConfig) DeepCopy

func (in *TiKVTitanDBConfig) DeepCopy() *TiKVTitanDBConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVTitanDBConfig.

func (*TiKVTitanDBConfig) DeepCopyInto

func (in *TiKVTitanDBConfig) DeepCopyInto(out *TiKVTitanDBConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiKVUnifiedReadPoolConfig

type TiKVUnifiedReadPoolConfig struct {
	// +optional
	MinThreadCount *int32 `json:"min-thread-count,omitempty" toml:"min-thread-count,omitempty"`
	// +optional
	MaxThreadCount *int32 `json:"max-thread-count,omitempty" toml:"max-thread-count,omitempty"`
	// Deprecated in v4.0.0
	// +optional
	StackSize *string `json:"stack-size,omitempty" toml:"stack-size,omitempty"`
	// +optional
	MaxTasksPerWorker *int32 `json:"max-tasks-per-worker,omitempty" toml:"max-tasks-per-worker,omitempty"`
}

+k8s:openapi-gen=true

func (*TiKVUnifiedReadPoolConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVUnifiedReadPoolConfig.

func (*TiKVUnifiedReadPoolConfig) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiProxyConfigWraper added in v1.5.0

type TiProxyConfigWraper struct {
	*config.GenericConfig `json:",inline"`
}

func NewTiProxyConfig added in v1.5.0

func NewTiProxyConfig() *TiProxyConfigWraper

func (*TiProxyConfigWraper) DeepCopy added in v1.5.0

func (in *TiProxyConfigWraper) DeepCopy() *TiProxyConfigWraper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiProxyConfigWraper.

func (*TiProxyConfigWraper) DeepCopyInto added in v1.5.0

func (in *TiProxyConfigWraper) DeepCopyInto(out *TiProxyConfigWraper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiProxyConfigWraper) MarshalJSON added in v1.5.0

func (c *TiProxyConfigWraper) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler interface.

func (*TiProxyConfigWraper) MarshalTOML added in v1.5.0

func (c *TiProxyConfigWraper) MarshalTOML() ([]byte, error)

func (*TiProxyConfigWraper) UnmarshalJSON added in v1.5.0

func (c *TiProxyConfigWraper) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler interface.

type TiProxyMember added in v1.5.0

type TiProxyMember struct {
	Name   string `json:"name"`
	Health bool   `json:"health"`
	// Additional healthinfo if it is healthy.
	// +optional
	Info string `json:"info"`
	// Last time the health transitioned from one to another.
	// TODO: remove nullable, https://github.com/kubernetes/kubernetes/issues/86811
	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}

TiProxyMember is TiProxy member

func (*TiProxyMember) DeepCopy added in v1.5.0

func (in *TiProxyMember) DeepCopy() *TiProxyMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiProxyMember.

func (*TiProxyMember) DeepCopyInto added in v1.5.0

func (in *TiProxyMember) DeepCopyInto(out *TiProxyMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiProxySpec added in v1.4.0

type TiProxySpec struct {
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// Specify a Service Account for TiProxy
	ServiceAccount string `json:"serviceAccount,omitempty"`

	// The desired ready replicas
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// Whether enable SSL connection between tiproxy and TiDB server
	SSLEnableTiDB bool `json:"sslEnableTiDB,omitempty"`

	// TLSClientSecretName is the name of secret which stores tidb server client certificate
	// used by TiProxy to check health status.
	// +optional
	TLSClientSecretName *string `json:"tlsClientSecretName,omitempty"`

	// Base image of the component, image tag is now allowed during validation
	// +kubebuilder:default=pingcap/tiproxy
	// +optional
	BaseImage string `json:"baseImage"`

	// Config is the Configuration of tiproxy-servers
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Config *TiProxyConfigWraper `json:"config,omitempty"`

	// StorageVolumes configure additional storage for TiProxy pods.
	// +optional
	StorageVolumes []StorageVolume `json:"storageVolumes,omitempty"`

	// The storageClassName of the persistent volume for TiProxy data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`
}

TiProxySpec contains details of TiProxy members +k8s:openapi-gen=true

func (*TiProxySpec) DeepCopy added in v1.4.0

func (in *TiProxySpec) DeepCopy() *TiProxySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiProxySpec.

func (*TiProxySpec) DeepCopyInto added in v1.4.0

func (in *TiProxySpec) DeepCopyInto(out *TiProxySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TiProxyStatus added in v1.4.0

type TiProxyStatus struct {
	Synced      bool                                       `json:"synced,omitempty"`
	Phase       MemberPhase                                `json:"phase,omitempty"`
	Members     map[string]TiProxyMember                   `json:"members,omitempty"`
	StatefulSet *apps.StatefulSetStatus                    `json:"statefulSet,omitempty"`
	Volumes     map[StorageVolumeName]*StorageVolumeStatus `json:"volumes,omitempty"`
	// Represents the latest available observations of a component's state.
	// +optional
	// +nullable
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

TiProxyStatus is TiProxy status

func (*TiProxyStatus) DeepCopy added in v1.4.0

func (in *TiProxyStatus) DeepCopy() *TiProxyStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiProxyStatus.

func (*TiProxyStatus) DeepCopyInto added in v1.4.0

func (in *TiProxyStatus) DeepCopyInto(out *TiProxyStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TiProxyStatus) GetConditions added in v1.4.0

func (s *TiProxyStatus) GetConditions() []metav1.Condition

func (*TiProxyStatus) GetPhase added in v1.4.0

func (s *TiProxyStatus) GetPhase() MemberPhase

func (*TiProxyStatus) GetStatefulSet added in v1.4.0

func (s *TiProxyStatus) GetStatefulSet() *appsv1.StatefulSetStatus

func (*TiProxyStatus) GetSynced added in v1.4.0

func (s *TiProxyStatus) GetSynced() bool

func (*TiProxyStatus) GetVolReplaceInProgress added in v1.5.1

func (s *TiProxyStatus) GetVolReplaceInProgress() bool

func (*TiProxyStatus) GetVolumes added in v1.4.0

func (*TiProxyStatus) MemberType added in v1.4.0

func (s *TiProxyStatus) MemberType() MemberType

func (*TiProxyStatus) RemoveCondition added in v1.4.0

func (s *TiProxyStatus) RemoveCondition(conditionType string)

func (*TiProxyStatus) SetCondition added in v1.4.0

func (s *TiProxyStatus) SetCondition(newCondition metav1.Condition)

func (*TiProxyStatus) SetPhase added in v1.4.0

func (s *TiProxyStatus) SetPhase(phase MemberPhase)

func (*TiProxyStatus) SetStatefulSet added in v1.4.0

func (s *TiProxyStatus) SetStatefulSet(sts *appsv1.StatefulSetStatus)

func (*TiProxyStatus) SetSynced added in v1.4.0

func (s *TiProxyStatus) SetSynced(synced bool)

func (*TiProxyStatus) SetVolReplaceInProgress added in v1.5.1

func (s *TiProxyStatus) SetVolReplaceInProgress(status bool)

func (*TiProxyStatus) SetVolumes added in v1.4.0

func (s *TiProxyStatus) SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)

type TidbAutoScalerSpec

type TidbAutoScalerSpec struct {
	BasicAutoScalerSpec `json:",inline"`
}

+k8s:openapi-gen=true TidbAutoScalerSpec describes the spec for tidb auto-scaling

func (*TidbAutoScalerSpec) DeepCopy

func (in *TidbAutoScalerSpec) DeepCopy() *TidbAutoScalerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbAutoScalerSpec.

func (*TidbAutoScalerSpec) DeepCopyInto

func (in *TidbAutoScalerSpec) DeepCopyInto(out *TidbAutoScalerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbAutoScalerStatus

type TidbAutoScalerStatus struct {
	BasicAutoScalerStatus `json:",inline"`
}

+k8s:openapi-gen=true TidbAutoScalerStatus describe the auto-scaling status of tidb

func (*TidbAutoScalerStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbAutoScalerStatus.

func (*TidbAutoScalerStatus) DeepCopyInto

func (in *TidbAutoScalerStatus) DeepCopyInto(out *TidbAutoScalerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbCluster

type TidbCluster struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata"`

	// Spec defines the behavior of a tidb cluster
	Spec TidbClusterSpec `json:"spec"`

	// +k8s:openapi-gen=false
	// Most recently observed status of the tidb cluster
	Status TidbClusterStatus `json:"status,omitempty"`
}

TidbCluster is the control script's spec

+k8s:openapi-gen=true +kubebuilder:resource:shortName="tc" +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` +kubebuilder:printcolumn:name="PD",type=string,JSONPath=`.status.pd.image`,description="The image for PD cluster" +kubebuilder:printcolumn:name="Storage",type=string,JSONPath=`.spec.pd.requests.storage`,description="The storage size specified for PD node" +kubebuilder:printcolumn:name="Ready",type=integer,JSONPath=`.status.pd.statefulSet.readyReplicas`,description="The ready replicas number of PD cluster" +kubebuilder:printcolumn:name="Desire",type=integer,JSONPath=`.spec.pd.replicas`,description="The desired replicas number of PD cluster" +kubebuilder:printcolumn:name="TiKV",type=string,JSONPath=`.status.tikv.image`,description="The image for TiKV cluster" +kubebuilder:printcolumn:name="Storage",type=string,JSONPath=`.spec.tikv.requests.storage`,description="The storage size specified for TiKV node" +kubebuilder:printcolumn:name="Ready",type=integer,JSONPath=`.status.tikv.statefulSet.readyReplicas`,description="The ready replicas number of TiKV cluster" +kubebuilder:printcolumn:name="Desire",type=integer,JSONPath=`.spec.tikv.replicas`,description="The desired replicas number of TiKV cluster" +kubebuilder:printcolumn:name="TiDB",type=string,JSONPath=`.status.tidb.image`,description="The image for TiDB cluster" +kubebuilder:printcolumn:name="Ready",type=integer,JSONPath=`.status.tidb.statefulSet.readyReplicas`,description="The ready replicas number of TiDB cluster" +kubebuilder:printcolumn:name="Desire",type=integer,JSONPath=`.spec.tidb.replicas`,description="The desired replicas number of TiDB cluster" +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].message`,priority=1 +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +genclient:noStatus

func (*TidbCluster) AcrossK8s

func (tc *TidbCluster) AcrossK8s() bool

func (*TidbCluster) AllComponentSpec added in v1.3.7

func (tc *TidbCluster) AllComponentSpec() []ComponentAccessor

func (*TidbCluster) AllComponentStatus added in v1.3.7

func (tc *TidbCluster) AllComponentStatus() []ComponentStatus

func (*TidbCluster) AllTiKVsAreAvailable added in v1.4.0

func (tc *TidbCluster) AllTiKVsAreAvailable(tolerateSingleTiKVOutage bool) bool

func (*TidbCluster) BaseDiscoverySpec

func (tc *TidbCluster) BaseDiscoverySpec() ComponentAccessor

BaseDiscoverySpec returns the base spec of discovery component

func (*TidbCluster) BasePDMSSpec added in v1.6.0

func (tc *TidbCluster) BasePDMSSpec(service *PDMSSpec) ComponentAccessor

BasePDMSSpec returns the base spec of PD Micro-Service servers

func (*TidbCluster) BasePDSpec

func (tc *TidbCluster) BasePDSpec() ComponentAccessor

BasePDSpec returns the base spec of PD servers

func (*TidbCluster) BasePumpSpec

func (tc *TidbCluster) BasePumpSpec() ComponentAccessor

BasePumpSpec returns the base spec of Pump:

func (*TidbCluster) BaseTiCDCSpec

func (tc *TidbCluster) BaseTiCDCSpec() ComponentAccessor

BaseTiCDCSpec returns the base spec of TiCDC servers

func (*TidbCluster) BaseTiDBSpec

func (tc *TidbCluster) BaseTiDBSpec() ComponentAccessor

BaseTiDBSpec returns the base spec of TiDB servers

func (*TidbCluster) BaseTiFlashSpec

func (tc *TidbCluster) BaseTiFlashSpec() ComponentAccessor

BaseTiFlashSpec returns the base spec of TiFlash servers

func (*TidbCluster) BaseTiKVSpec

func (tc *TidbCluster) BaseTiKVSpec() ComponentAccessor

BaseTiKVSpec returns the base spec of TiKV servers

func (*TidbCluster) BaseTiProxySpec added in v1.4.0

func (tc *TidbCluster) BaseTiProxySpec() ComponentAccessor

BaseTiProxySpec returns the base spec of TiProxy servers

func (*TidbCluster) ComponentIsNormal added in v1.3.7

func (tc *TidbCluster) ComponentIsNormal(typ MemberType) bool

func (*TidbCluster) ComponentIsSuspended added in v1.3.7

func (tc *TidbCluster) ComponentIsSuspended(typ MemberType) bool

ComponentIsSuspended return true if the component's phase is `Suspend` and all resources is suspended

func (*TidbCluster) ComponentIsSuspending added in v1.3.7

func (tc *TidbCluster) ComponentIsSuspending(typ MemberType) bool

ComponentIsSuspending return true if the component's phase is `Suspend`

func (*TidbCluster) ComponentSpec added in v1.3.7

func (tc *TidbCluster) ComponentSpec(typ MemberType) ComponentAccessor

func (*TidbCluster) ComponentStatus added in v1.3.7

func (tc *TidbCluster) ComponentStatus(typ MemberType) ComponentStatus

func (*TidbCluster) DeepCopy

func (in *TidbCluster) DeepCopy() *TidbCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbCluster.

func (*TidbCluster) DeepCopyInto

func (in *TidbCluster) DeepCopyInto(out *TidbCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbCluster) DeepCopyObject

func (in *TidbCluster) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*TidbCluster) GetClusterID

func (tc *TidbCluster) GetClusterID() string

func (*TidbCluster) GetHelperSpec

func (tc *TidbCluster) GetHelperSpec() HelperSpec

func (*TidbCluster) GetInstanceName

func (tc *TidbCluster) GetInstanceName() string

func (*TidbCluster) GetPDDeletedFailureReplicas

func (tc *TidbCluster) GetPDDeletedFailureReplicas() int32

func (*TidbCluster) HelperImage

func (tc *TidbCluster) HelperImage() string

func (*TidbCluster) HelperImagePullPolicy

func (tc *TidbCluster) HelperImagePullPolicy() corev1.PullPolicy

func (*TidbCluster) Heterogeneous

func (tc *TidbCluster) Heterogeneous() bool

func (*TidbCluster) IsComponentLeaderEvicting added in v1.4.0

func (tc *TidbCluster) IsComponentLeaderEvicting(compType MemberType) bool

func (*TidbCluster) IsComponentVolumeResizing added in v1.3.6

func (tc *TidbCluster) IsComponentVolumeResizing(compType MemberType) bool

IsComponentVolumeResizing returns true if any volume of component is resizing.

func (*TidbCluster) IsPVReclaimEnabled

func (tc *TidbCluster) IsPVReclaimEnabled() bool

func (*TidbCluster) IsRecoveryMode added in v1.4.0

func (tc *TidbCluster) IsRecoveryMode() bool

func (*TidbCluster) IsTLSClusterEnabled

func (tc *TidbCluster) IsTLSClusterEnabled() bool

func (*TidbCluster) IsTiDBBinlogEnabled

func (tc *TidbCluster) IsTiDBBinlogEnabled() bool

func (*TidbCluster) KeepTiFlash710Ports added in v1.5.1

func (tc *TidbCluster) KeepTiFlash710Ports() bool

func (*TidbCluster) NeedToSyncTiDBInitializer

func (tc *TidbCluster) NeedToSyncTiDBInitializer() bool

func (*TidbCluster) PDAllMembersReady

func (tc *TidbCluster) PDAllMembersReady() bool

PDAllMembersReady return whether all members of PD are ready.

If PD isn't specified, return false.

func (*TidbCluster) PDAllPodsStarted

func (tc *TidbCluster) PDAllPodsStarted() bool

PDAllPodsStarted return whether all pods of PD are started.

If PD isn't specified, return false.

func (*TidbCluster) PDAutoFailovering

func (tc *TidbCluster) PDAutoFailovering() bool

func (*TidbCluster) PDImage

func (tc *TidbCluster) PDImage() string

PDImage return the image used by PD.

If PD isn't specified, return empty string.

func (*TidbCluster) PDIsAvailable

func (tc *TidbCluster) PDIsAvailable() bool

PDIsAvailable return whether PD is available.

If PD isn't specified, return true.

func (*TidbCluster) PDMSImage added in v1.6.0

func (tc *TidbCluster) PDMSImage(spec *PDMSSpec) string

PDMSImage return the image used by specified PD MicroService.

If PDMS isn't specified, return empty string.

func (*TidbCluster) PDMSScaling added in v1.6.0

func (tc *TidbCluster) PDMSScaling(name string) bool

func (*TidbCluster) PDMSStsActualReplicas added in v1.6.0

func (tc *TidbCluster) PDMSStsActualReplicas(componentName string) int32

func (*TidbCluster) PDMSStsDesiredReplicas added in v1.6.0

func (tc *TidbCluster) PDMSStsDesiredReplicas(componentName string) int32

func (*TidbCluster) PDMSVersion added in v1.6.0

func (tc *TidbCluster) PDMSVersion(name string) string

PDMSVersion return the image version used by specified PD MicroService.

If PDMS isn't specified, return empty string.

func (*TidbCluster) PDScaling

func (tc *TidbCluster) PDScaling() bool

func (*TidbCluster) PDStartTimeout added in v1.5.0

func (tc *TidbCluster) PDStartTimeout() int

func (*TidbCluster) PDStsActualReplicas

func (tc *TidbCluster) PDStsActualReplicas() int32

func (*TidbCluster) PDStsDesiredOrdinals

func (tc *TidbCluster) PDStsDesiredOrdinals(excludeFailover bool) sets.Int32

func (*TidbCluster) PDStsDesiredReplicas

func (tc *TidbCluster) PDStsDesiredReplicas() int32

func (*TidbCluster) PDUpgrading

func (tc *TidbCluster) PDUpgrading() bool

func (*TidbCluster) PDVersion

func (tc *TidbCluster) PDVersion() string

PDVersion return the image version used by PD.

If PD isn't specified, return empty string.

func (*TidbCluster) PumpImage

func (tc *TidbCluster) PumpImage() *string

PumpImage return the image used by Pump.

If Pump isn't specified, return nil.

func (*TidbCluster) PumpIsAvailable

func (tc *TidbCluster) PumpIsAvailable() bool

func (*TidbCluster) PumpLogLevel added in v1.4.0

func (tc *TidbCluster) PumpLogLevel() string

func (*TidbCluster) Scheme

func (tc *TidbCluster) Scheme() string

func (*TidbCluster) SkipTLSWhenConnectTiDB

func (tc *TidbCluster) SkipTLSWhenConnectTiDB() bool

func (*TidbCluster) StartScriptVersion added in v1.4.0

func (tc *TidbCluster) StartScriptVersion() StartScriptVersion

func (*TidbCluster) TiCDCAllCapturesReady added in v1.3.8

func (tc *TidbCluster) TiCDCAllCapturesReady() bool

TiCDCAllCapturesReady return whether all captures of TiCDC are ready.

If TiCDC isn't specified, return false.

func (*TidbCluster) TiCDCDeployDesiredReplicas

func (tc *TidbCluster) TiCDCDeployDesiredReplicas() int32

func (*TidbCluster) TiCDCGCTTL

func (tc *TidbCluster) TiCDCGCTTL() int32

func (*TidbCluster) TiCDCGracefulShutdownTimeout added in v1.3.8

func (tc *TidbCluster) TiCDCGracefulShutdownTimeout() time.Duration

TiCDCGracefulShutdownTimeout returns the timeout of gracefully shutdown a TiCDC pod.

func (*TidbCluster) TiCDCImage

func (tc *TidbCluster) TiCDCImage() string

TiCDCImage return the image used by TiCDC.

If TiCDC isn't specified, return empty string.

func (*TidbCluster) TiCDCLogFile

func (tc *TidbCluster) TiCDCLogFile() string

func (*TidbCluster) TiCDCLogLevel

func (tc *TidbCluster) TiCDCLogLevel() string

func (*TidbCluster) TiCDCTimezone

func (tc *TidbCluster) TiCDCTimezone() string

TODO: We Should better do not specified the default value ourself if user not specified the item.

func (*TidbCluster) TiCDCVersion added in v1.3.8

func (tc *TidbCluster) TiCDCVersion() string

TiCDCVersion returns the image version used by TiCDC.

If TiCDC isn't specified, return empty string.

func (*TidbCluster) TiDBAllMembersReady

func (tc *TidbCluster) TiDBAllMembersReady() bool

TiDBAllMembersReady return whether all members of TiDB are ready.

If TiDB isn't specified, return false.

func (*TidbCluster) TiDBAllPodsStarted

func (tc *TidbCluster) TiDBAllPodsStarted() bool

TiDBAllPodsStarted return whether all pods of TiDB are started.

If TiDB isn't specified, return false.

func (*TidbCluster) TiDBImage

func (tc *TidbCluster) TiDBImage() string

TiDBImage return the image used by TiDB.

If TiDB isn't specified, return empty string.

func (*TidbCluster) TiDBScaling

func (tc *TidbCluster) TiDBScaling() bool

func (*TidbCluster) TiDBStsActualReplicas

func (tc *TidbCluster) TiDBStsActualReplicas() int32

func (*TidbCluster) TiDBStsDesiredOrdinals

func (tc *TidbCluster) TiDBStsDesiredOrdinals(excludeFailover bool) sets.Int32

func (*TidbCluster) TiDBStsDesiredReplicas

func (tc *TidbCluster) TiDBStsDesiredReplicas() int32

func (*TidbCluster) TiDBUpgrading

func (tc *TidbCluster) TiDBUpgrading() bool

func (*TidbCluster) TiDBVersion added in v1.4.0

func (tc *TidbCluster) TiDBVersion() string

TiDBVersion returns the image version used by TiDB.

If TiDB isn't specified, return empty string.

func (*TidbCluster) TiFlashAllPodsStarted

func (tc *TidbCluster) TiFlashAllPodsStarted() bool

TiFlashAllPodsStarted return whether all pods of TiFlash are started.

If TiFlash isn't specified, return false.

func (*TidbCluster) TiFlashAllStoresReady

func (tc *TidbCluster) TiFlashAllStoresReady() bool

TiFlashAllPodsStarted return whether all stores of TiFlash are ready.

If TiFlash isn't specified, return false.

func (*TidbCluster) TiFlashContainerPrivilege

func (tc *TidbCluster) TiFlashContainerPrivilege() *bool

func (*TidbCluster) TiFlashImage

func (tc *TidbCluster) TiFlashImage() string

TiFlashImage return the image used by TiFlash.

If TiFlash isn't specified, return empty string.

func (*TidbCluster) TiFlashScaling

func (tc *TidbCluster) TiFlashScaling() bool

func (*TidbCluster) TiFlashStsActualReplicas

func (tc *TidbCluster) TiFlashStsActualReplicas() int32

func (*TidbCluster) TiFlashStsDesiredOrdinals

func (tc *TidbCluster) TiFlashStsDesiredOrdinals(excludeFailover bool) sets.Int32

func (*TidbCluster) TiFlashStsDesiredReplicas

func (tc *TidbCluster) TiFlashStsDesiredReplicas() int32

func (*TidbCluster) TiFlashUpgrading

func (tc *TidbCluster) TiFlashUpgrading() bool

func (*TidbCluster) TiFlashVersion

func (tc *TidbCluster) TiFlashVersion() string

TiFlashVersion returns the image version used by TiFlash.

If TiFlash isn't specified, return empty string.

func (*TidbCluster) TiKVAllPodsStarted

func (tc *TidbCluster) TiKVAllPodsStarted() bool

TiKVAllPodsStarted return whether all pods of TiKV are started.

If TiKV isn't specified, return false.

func (*TidbCluster) TiKVAllStoresReady

func (tc *TidbCluster) TiKVAllStoresReady() bool

TiKVAllStoresReady return whether all stores of TiKV are ready.

If TiKV isn't specified, return false.

func (*TidbCluster) TiKVBootStrapped

func (tc *TidbCluster) TiKVBootStrapped() bool

func (*TidbCluster) TiKVContainerPrivilege

func (tc *TidbCluster) TiKVContainerPrivilege() *bool

func (*TidbCluster) TiKVEvictLeaderTimeout

func (tc *TidbCluster) TiKVEvictLeaderTimeout() time.Duration

func (*TidbCluster) TiKVImage

func (tc *TidbCluster) TiKVImage() string

TiKVImage return the image used by TiKV.

If TiKV isn't specified, return empty string.

func (*TidbCluster) TiKVIsAvailable

func (tc *TidbCluster) TiKVIsAvailable() bool

func (*TidbCluster) TiKVScaling

func (tc *TidbCluster) TiKVScaling() bool

func (*TidbCluster) TiKVStsActualReplicas

func (tc *TidbCluster) TiKVStsActualReplicas() int32

func (*TidbCluster) TiKVStsDesiredOrdinals

func (tc *TidbCluster) TiKVStsDesiredOrdinals(excludeFailover bool) sets.Int32

func (*TidbCluster) TiKVStsDesiredReplicas

func (tc *TidbCluster) TiKVStsDesiredReplicas() int32

func (*TidbCluster) TiKVUpgrading

func (tc *TidbCluster) TiKVUpgrading() bool

func (*TidbCluster) TiKVVersion

func (tc *TidbCluster) TiKVVersion() string

TiKVVersion return the image version used by TiKV.

If TiKV isn't specified, return empty string.

func (*TidbCluster) TiKVWaitLeaderTransferBackTimeout added in v1.5.0

func (tc *TidbCluster) TiKVWaitLeaderTransferBackTimeout() time.Duration

func (*TidbCluster) TiProxyAllMembersReady added in v1.5.0

func (tc *TidbCluster) TiProxyAllMembersReady() bool

func (*TidbCluster) TiProxyImage added in v1.4.0

func (tc *TidbCluster) TiProxyImage() string

TiProxyImage return the image used by TiProxy.

If TiProxy isn't specified, return empty string.

func (*TidbCluster) TiProxyScaling added in v1.5.0

func (tc *TidbCluster) TiProxyScaling() bool

func (*TidbCluster) TiProxyStsActualReplicas added in v1.5.0

func (tc *TidbCluster) TiProxyStsActualReplicas() int32

func (*TidbCluster) TiProxyStsDesiredReplicas added in v1.5.0

func (tc *TidbCluster) TiProxyStsDesiredReplicas() int32

func (*TidbCluster) TiProxyUpgrading added in v1.5.0

func (tc *TidbCluster) TiProxyUpgrading() bool

func (*TidbCluster) TiProxyVersion added in v1.6.0

func (tc *TidbCluster) TiProxyVersion() string

TiProxyVersion returns the image version used by TiProxy.

If TiProxy isn't specified, return empty string.

func (*TidbCluster) Timezone

func (tc *TidbCluster) Timezone() string

func (*TidbCluster) WithoutLocalPD

func (tc *TidbCluster) WithoutLocalPD() bool

func (*TidbCluster) WithoutLocalTiDB

func (tc *TidbCluster) WithoutLocalTiDB() bool

type TidbClusterAutoScaler

type TidbClusterAutoScaler struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata"`

	// Spec describes the state of the TidbClusterAutoScaler
	Spec TidbClusterAutoScalerSpec `json:"spec"`

	// Status describe the status of the TidbClusterAutoScaler
	Status TidbClusterAutoScalerStatus `json:"status,omitempty"`
}

TidbClusterAutoScaler is the control script's spec

+k8s:openapi-gen=true +kubebuilder:resource:shortName="ta" +kubebuiler:printcolums:name="TiDB-MaxReplicas",type=integer,JSONPath=`.spec.tidb.maxReplicas`,description="The maximal replicas of TiDB" +kubebuiler:printcolums:name="TiDB-MinReplicas",type=integer,JSONPath=`.spec.tidb.minReplicas`,description="The minimal replicas of TiDB" +kubebuiler:printcolums:name="TiKV-MaxReplicas",type=integer,JSONPath=`.spec.tikv.maxReplicas`,description="The maximal replicas of TiKV" +kubebuiler:printcolums:name="TiKV-MinReplicas",type=integer,JSONPath=`.spec.tikv.minReplicas`,description="The minimal replicas of TiKV" +kubebuiler:printcolums:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*TidbClusterAutoScaler) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterAutoScaler.

func (*TidbClusterAutoScaler) DeepCopyInto

func (in *TidbClusterAutoScaler) DeepCopyInto(out *TidbClusterAutoScaler)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbClusterAutoScaler) DeepCopyObject

func (in *TidbClusterAutoScaler) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TidbClusterAutoScalerList

type TidbClusterAutoScalerList struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ListMeta `json:"metadata"`

	Items []TidbClusterAutoScaler `json:"items"`
}

+k8s:openapi-gen=true TidbClusterAutoScalerList is TidbClusterAutoScaler list

func (*TidbClusterAutoScalerList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterAutoScalerList.

func (*TidbClusterAutoScalerList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbClusterAutoScalerList) DeepCopyObject

func (in *TidbClusterAutoScalerList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TidbClusterAutoScalerRef

type TidbClusterAutoScalerRef struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

+k8s:openapi-gen=true TidbClusterAutoScalerRef indicates to the target auto-scaler ref

func (*TidbClusterAutoScalerRef) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterAutoScalerRef.

func (*TidbClusterAutoScalerRef) DeepCopyInto

func (in *TidbClusterAutoScalerRef) DeepCopyInto(out *TidbClusterAutoScalerRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbClusterAutoScalerSpec

type TidbClusterAutoScalerSpec struct {
	// TidbClusterRef describe the target TidbCluster
	Cluster TidbClusterRef `json:"cluster"`

	// TiKV represents the auto-scaling spec for tikv
	// +optional
	TiKV *TikvAutoScalerSpec `json:"tikv,omitempty"`

	// TiDB represents the auto-scaling spec for tidb
	// +optional
	TiDB *TidbAutoScalerSpec `json:"tidb,omitempty"`
}

+k8s:openapi-gen=true TidbAutoScalerSpec describes the state of the TidbClusterAutoScaler

func (*TidbClusterAutoScalerSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterAutoScalerSpec.

func (*TidbClusterAutoScalerSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbClusterAutoScalerStatus

type TidbClusterAutoScalerStatus struct {
	// Tikv describes the status of each group for the tikv in the last auto-scaling reconciliation
	// +optional
	TiKV map[string]TikvAutoScalerStatus `json:"tikv,omitempty"`
	// Tidb describes the status of each group for the tidb in the last auto-scaling reconciliation
	// +optional
	TiDB map[string]TidbAutoScalerStatus `json:"tidb,omitempty"`
}

+k8s:openapi-gen=true TidbClusterAutoScalerStatus describe the whole status

func (*TidbClusterAutoScalerStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterAutoScalerStatus.

func (*TidbClusterAutoScalerStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbClusterCondition

type TidbClusterCondition struct {
	// Type of the condition.
	Type TidbClusterConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status"`
	// The last time this condition was updated.
	// +nullable
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
	// Last time the condition transitioned from one status to another.
	// +optional
	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// The reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`
	// A human readable message indicating details about the transition.
	// +optional
	Message string `json:"message,omitempty"`
}

TidbClusterCondition describes the state of a tidb cluster at a certain point.

func (*TidbClusterCondition) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterCondition.

func (*TidbClusterCondition) DeepCopyInto

func (in *TidbClusterCondition) DeepCopyInto(out *TidbClusterCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbClusterConditionType

type TidbClusterConditionType string

TidbClusterConditionType represents a tidb cluster condition value.

const (
	// TidbClusterReady indicates that the tidb cluster is ready or not.
	// This is defined as:
	// - All statefulsets are up to date (currentRevision == updateRevision).
	// - All PD members are healthy.
	// - All TiDB pods are healthy.
	// - All TiKV stores are up.
	// - All TiFlash stores are up.
	TidbClusterReady TidbClusterConditionType = "Ready"
)

type TidbClusterList

type TidbClusterList struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ListMeta `json:"metadata"`

	Items []TidbCluster `json:"items"`
}

TidbClusterList is TidbCluster list +k8s:openapi-gen=true

func (*TidbClusterList) DeepCopy

func (in *TidbClusterList) DeepCopy() *TidbClusterList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterList.

func (*TidbClusterList) DeepCopyInto

func (in *TidbClusterList) DeepCopyInto(out *TidbClusterList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbClusterList) DeepCopyObject

func (in *TidbClusterList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TidbClusterRef

type TidbClusterRef struct {
	// Namespace is the namespace that TidbCluster object locates,
	// default to the same namespace as TidbMonitor/TidbCluster/TidbNGMonitoring/TidbDashboard
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Name is the name of TidbCluster object
	Name string `json:"name"`

	// ClusterDomain is the domain of TidbCluster object
	// +optional
	ClusterDomain string `json:"clusterDomain,omitempty"`
}

+k8s:openapi-gen=true TidbClusterRef reference to a TidbCluster

func (*TidbClusterRef) DeepCopy

func (in *TidbClusterRef) DeepCopy() *TidbClusterRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterRef.

func (*TidbClusterRef) DeepCopyInto

func (in *TidbClusterRef) DeepCopyInto(out *TidbClusterRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbClusterSpec

type TidbClusterSpec struct {
	// Discovery spec
	Discovery DiscoverySpec `json:"discovery,omitempty"`

	// Specify a Service Account
	ServiceAccount string `json:"serviceAccount,omitempty"`

	// PD cluster spec
	// +optional
	PD *PDSpec `json:"pd,omitempty"`

	// PDMS cluster spec
	// +optional
	PDMS []*PDMSSpec `json:"pdms,omitempty"`

	// TiDB cluster spec
	// +optional
	TiDB *TiDBSpec `json:"tidb,omitempty"`

	// TiKV cluster spec
	// +optional
	TiKV *TiKVSpec `json:"tikv,omitempty"`

	// TiFlash cluster spec
	// +optional
	TiFlash *TiFlashSpec `json:"tiflash,omitempty"`

	// TiCDC cluster spec
	// +optional
	TiCDC *TiCDCSpec `json:"ticdc,omitempty"`

	// TiProxy cluster spec
	// +optional
	TiProxy *TiProxySpec `json:"tiproxy,omitempty"`

	// Pump cluster spec
	// +optional
	Pump *PumpSpec `json:"pump,omitempty"`

	// Helper spec
	// +optional
	Helper *HelperSpec `json:"helper,omitempty"`

	// Indicates that the tidb cluster is paused and will not be processed by
	// the controller.
	// +optional
	Paused bool `json:"paused,omitempty"`

	// Whether RecoveryMode is enabled for TiDB cluster to restore
	// Optional: Defaults to false
	// +optional
	RecoveryMode bool `json:"recoveryMode,omitempty"`

	// TiDB cluster version
	// +optional
	Version string `json:"version"`

	// SchedulerName of TiDB cluster Pods
	SchedulerName string `json:"schedulerName,omitempty"`

	// Persistent volume reclaim policy applied to the PVs that consumed by TiDB cluster
	// +kubebuilder:default=Retain
	PVReclaimPolicy *corev1.PersistentVolumeReclaimPolicy `json:"pvReclaimPolicy,omitempty"`

	// ImagePullPolicy of TiDB cluster Pods
	// +kubebuilder:default=IfNotPresent
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// ConfigUpdateStrategy determines how the configuration change is applied to the cluster.
	// UpdateStrategyInPlace will update the ConfigMap of configuration in-place and an extra rolling-update of the
	// cluster component is needed to reload the configuration change.
	// UpdateStrategyRollingUpdate will create a new ConfigMap with the new configuration and rolling-update the
	// related components to use the new ConfigMap, that is, the new configuration will be applied automatically.
	ConfigUpdateStrategy ConfigUpdateStrategy `json:"configUpdateStrategy,omitempty"`

	// Whether enable PVC reclaim for orphan PVC left by statefulset scale-in
	// Optional: Defaults to false
	// +optional
	EnablePVReclaim *bool `json:"enablePVReclaim,omitempty"`

	// Whether enable the TLS connection between TiDB server components
	// Optional: Defaults to nil
	// +optional
	TLSCluster *TLSCluster `json:"tlsCluster,omitempty"`

	// Whether Hostnetwork is enabled for TiDB cluster Pods
	// Optional: Defaults to false
	// +optional
	HostNetwork *bool `json:"hostNetwork,omitempty"`

	// Affinity of TiDB cluster Pods.
	// Will be overwritten by each cluster component's specific affinity setting, e.g. `spec.tidb.affinity`
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// PriorityClassName of TiDB cluster Pods
	// Optional: Defaults to omitted
	// +optional
	PriorityClassName *string `json:"priorityClassName,omitempty"`

	// Base node selectors of TiDB cluster Pods, components may add or override selectors upon this respectively
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Base annotations for TiDB cluster, all Pods in the cluster should have these annotations.
	// Can be overrode by annotations in the specific component spec.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Base labels for TiDB cluster, all Pods in the cluster should have these labels.
	// Can be overrode by labels in the specific component spec.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// Base tolerations of TiDB cluster Pods, components may add more tolerations upon this respectively
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// DNSConfig Specifies the DNS parameters of a pod.
	// +optional
	DNSConfig *corev1.PodDNSConfig `json:"dnsConfig,omitempty"`

	// DNSPolicy Specifies the DNSPolicy parameters of a pod.
	// +optional
	DNSPolicy corev1.DNSPolicy `json:"dnsPolicy,omitempty"`

	// Time zone of TiDB cluster Pods
	// Optional: Defaults to UTC
	// +optional
	Timezone string `json:"timezone,omitempty"`

	// (Deprecated) Services list non-headless services type used in TidbCluster
	// +k8s:openapi-gen=false
	Services []Service `json:"services,omitempty"`

	// EnableDynamicConfiguration indicates whether to append `--advertise-status-addr` to the startup parameters of TiKV.
	// +optional
	EnableDynamicConfiguration *bool `json:"enableDynamicConfiguration,omitempty"`

	// ClusterDomain is the Kubernetes Cluster Domain of TiDB cluster
	// Optional: Defaults to ""
	// +optional
	ClusterDomain string `json:"clusterDomain,omitempty"`

	// AcrossK8s indicates whether deploy TiDB cluster across multiple Kubernetes clusters
	// +optional
	AcrossK8s bool `json:"acrossK8s,omitempty"`

	// Cluster is the external cluster, if configured, the components in this TidbCluster will join to this configured cluster.
	// +optional
	Cluster *TidbClusterRef `json:"cluster,omitempty"`

	// PDAddresses are the external PD addresses, if configured, the PDs in this TidbCluster will join to the configured PD cluster.
	// +optional
	PDAddresses []string `json:"pdAddresses,omitempty"`

	// StatefulSetUpdateStrategy of TiDB cluster StatefulSets
	// +optional
	StatefulSetUpdateStrategy apps.StatefulSetUpdateStrategyType `json:"statefulSetUpdateStrategy,omitempty"`

	// PodManagementPolicy of TiDB cluster StatefulSets
	// +optional
	PodManagementPolicy apps.PodManagementPolicyType `json:"podManagementPolicy,omitempty"`

	// PodSecurityContext of the component
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// TopologySpreadConstraints describes how a group of pods ought to spread across topology
	// domains. Scheduler will schedule pods in a way which abides by the constraints.
	// This field is is only honored by clusters that enables the EvenPodsSpread feature.
	// All topologySpreadConstraints are ANDed.
	// +optional
	// +listType=map
	// +listMapKey=topologyKey
	TopologySpreadConstraints []TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`

	// StartScriptVersion is the version of start script
	// When PD enables microservice mode, pd and pd microservice component will use start script v2.
	//
	// default to "v1"
	// +optional
	// +kubebuilder:validation:Enum:="";"v1";"v2"
	StartScriptVersion StartScriptVersion `json:"startScriptVersion,omitempty"`

	// SuspendAction defines the suspend actions for all component.
	// +optional
	SuspendAction *SuspendAction `json:"suspendAction,omitempty"`

	// PreferIPv6 indicates whether to prefer IPv6 addresses for all components.
	PreferIPv6 bool `json:"preferIPv6,omitempty"`

	// Feature flags used by v2 startup script to enable various features.
	// Examples of supported feature flags:
	// - WaitForDnsNameIpMatch indicates whether PD and TiKV has to wait until local IP address matches the one published to external DNS
	// - PreferPDAddressesOverDiscovery advises start script to use TidbClusterSpec.PDAddresses (if supplied) as argument for pd-server, tikv-server and tidb-server commands
	StartScriptV2FeatureFlags []StartScriptV2FeatureFlag `json:"startScriptV2FeatureFlags,omitempty"`
}

TidbClusterSpec describes the attributes that a user creates on a tidb cluster +k8s:openapi-gen=true

func (*TidbClusterSpec) DeepCopy

func (in *TidbClusterSpec) DeepCopy() *TidbClusterSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterSpec.

func (*TidbClusterSpec) DeepCopyInto

func (in *TidbClusterSpec) DeepCopyInto(out *TidbClusterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbClusterStatus

type TidbClusterStatus struct {
	ClusterID  string                    `json:"clusterID,omitempty"`
	PD         PDStatus                  `json:"pd,omitempty"`
	PDMS       map[string]*PDMSStatus    `json:"pdms,omitempty"`
	TiKV       TiKVStatus                `json:"tikv,omitempty"`
	TiDB       TiDBStatus                `json:"tidb,omitempty"`
	Pump       PumpStatus                `json:"pump,omitempty"`
	TiFlash    TiFlashStatus             `json:"tiflash,omitempty"`
	TiProxy    TiProxyStatus             `json:"tiproxy,omitempty"`
	TiCDC      TiCDCStatus               `json:"ticdc,omitempty"`
	AutoScaler *TidbClusterAutoScalerRef `json:"auto-scaler,omitempty"`
	// Represents the latest available observations of a tidb cluster's state.
	// +optional
	// +nullable
	Conditions []TidbClusterCondition `json:"conditions,omitempty"`
}

TidbClusterStatus represents the current status of a tidb cluster.

func (*TidbClusterStatus) DeepCopy

func (in *TidbClusterStatus) DeepCopy() *TidbClusterStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterStatus.

func (*TidbClusterStatus) DeepCopyInto

func (in *TidbClusterStatus) DeepCopyInto(out *TidbClusterStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbDashboard added in v1.4.0

type TidbDashboard struct {
	metav1.TypeMeta `json:",inline"`

	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata"`

	// Spec contains all spec about tidb dashboard.
	Spec TidbDashboardSpec `json:"spec"`

	// Status is most recently observed status of tidb dashboard.
	//
	// +k8s:openapi-gen=false
	Status TidbDashboardStatus `json:"status,omitempty"`
}

TidbDashboard contains the spec and status of tidb dashboard.

+genclient +k8s:openapi-gen=true +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:resource:shortName="td" +kubebuilder:subresource:status

func (*TidbDashboard) BaseTidbDashboardSpec added in v1.4.0

func (td *TidbDashboard) BaseTidbDashboardSpec() ComponentAccessor

func (*TidbDashboard) DeepCopy added in v1.4.0

func (in *TidbDashboard) DeepCopy() *TidbDashboard

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbDashboard.

func (*TidbDashboard) DeepCopyInto added in v1.4.0

func (in *TidbDashboard) DeepCopyInto(out *TidbDashboard)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbDashboard) DeepCopyObject added in v1.4.0

func (in *TidbDashboard) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TidbDashboardList added in v1.4.0

type TidbDashboardList struct {
	metav1.TypeMeta `json:",inline"`

	// +k8s:openapi-gen=false
	metav1.ListMeta `json:"metadata"`

	Items []TidbDashboard `json:"items"`
}

TidbDashboardList is a TidbDashboard list.

+k8s:openapi-gen=true +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*TidbDashboardList) DeepCopy added in v1.4.0

func (in *TidbDashboardList) DeepCopy() *TidbDashboardList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbDashboardList.

func (*TidbDashboardList) DeepCopyInto added in v1.4.0

func (in *TidbDashboardList) DeepCopyInto(out *TidbDashboardList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbDashboardList) DeepCopyObject added in v1.4.0

func (in *TidbDashboardList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TidbDashboardSpec added in v1.4.0

type TidbDashboardSpec struct {
	// ComponentSpec is common spec.
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// Clusters reference TiDB cluster.
	//
	// +kubebuilder:validation:MaxItems=1
	// +kubebuilder:validation:MinItems=1
	Clusters []TidbClusterRef `json:"clusters"`

	// Persistent volume reclaim policy applied to the PVs that consumed by tidb dashboard.
	//
	// +kubebuilder:default=Retain
	PVReclaimPolicy *corev1.PersistentVolumeReclaimPolicy `json:"pvReclaimPolicy,omitempty"`

	// Base image of the component (image tag is now allowed during validation).
	//
	// +kubebuilder:default=pingcap/tidb-dashboard
	BaseImage string `json:"baseImage,omitempty"`

	// StorageClassName is the default PVC storage class for tidb dashboard.
	// Defaults to Kubernetes default storage class.
	StorageClassName *string `json:"storageClassName,omitempty"`

	// StorageVolumes configures additional PVC for tidb dashboard.
	StorageVolumes []StorageVolume `json:"storageVolumes,omitempty"`

	// PathPrefix is public URL path prefix for reverse proxies.
	PathPrefix *string `json:"pathPrefix,omitempty"`

	// Service defines a Kubernetes service of tidb dashboard web access.
	Service ServiceSpec `json:"service,omitempty"`

	// Telemetry is whether to enable telemetry.
	// When enabled, usage data will be sent to PingCAP for improving user experience.
	// Optional: Defaults to true
	// +optional
	Telemetry *bool `json:"telemetry,omitempty" default:"true"`

	// Experimental is whether to enable experimental features.
	// When enabled, experimental TiDB Dashboard features will be available.
	// These features are incomplete or not well tested. Suggest not to enable in
	// production.
	// Optional: Defaults to false
	// +optional
	Experimental *bool `json:"experimental,omitempty"`

	// PreferIPv6 indicates whether to prefer IPv6 addresses for all components.
	PreferIPv6 bool `json:"preferIPv6,omitempty"`

	//ListenOnLocalhostOnly whether to expose dashboard to 0.0.0.0 or limit it to localhost only
	// which means it will be accessible only via port-forwarding
	// Optional: Defaults to false
	// +optional
	ListenOnLocalhostOnly *bool `json:"listenOnLocalhostOnly,omitempty" default:"false"`

	// DisableKeyVisualizer is whether to disable Key Visualizer.
	// Optional: Defaults to false
	// +optional
	DisableKeyVisualizer *bool `json:"disableKeyVisualizer,omitempty" default:"false"`
}

TidbDashboardSpec is spec of tidb dashboard.

+k8s:openapi-gen=true

func (*TidbDashboardSpec) DeepCopy added in v1.4.0

func (in *TidbDashboardSpec) DeepCopy() *TidbDashboardSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbDashboardSpec.

func (*TidbDashboardSpec) DeepCopyInto added in v1.4.0

func (in *TidbDashboardSpec) DeepCopyInto(out *TidbDashboardSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbDashboardStatus added in v1.4.0

type TidbDashboardStatus struct {
	Synced bool        `json:"synced,omitempty"`
	Phase  MemberPhase `json:"phase,omitempty"`

	StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"`
}

TidbDashboardStatus is status of tidb dashboard.

func (*TidbDashboardStatus) DeepCopy added in v1.4.0

func (in *TidbDashboardStatus) DeepCopy() *TidbDashboardStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbDashboardStatus.

func (*TidbDashboardStatus) DeepCopyInto added in v1.4.0

func (in *TidbDashboardStatus) DeepCopyInto(out *TidbDashboardStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbInitializer

type TidbInitializer struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata"`

	// Spec defines the desired state of TidbInitializer
	Spec TidbInitializerSpec `json:"spec"`

	// +k8s:openapi-gen=false
	// Most recently observed status of the TidbInitializer
	Status TidbInitializerStatus `json:"status,omitempty"`
}

TidbInitializer is a TiDB cluster initializing job

+k8s:openapi-gen=true +kubebuilder:resource:shortName="ti" +kubebuilder:printcolums:name="Phase",type=string,JSONPath=`.status.phase`,description="The current phase of initialization",priority=1 +kubebuilder:printcolums:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

func (*TidbInitializer) DeepCopy

func (in *TidbInitializer) DeepCopy() *TidbInitializer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbInitializer.

func (*TidbInitializer) DeepCopyInto

func (in *TidbInitializer) DeepCopyInto(out *TidbInitializer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbInitializer) DeepCopyObject

func (in *TidbInitializer) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*TidbInitializer) GetPermitHost

func (ti *TidbInitializer) GetPermitHost() string

GetPermitHost retrieves the permit host from TidbInitializer

type TidbInitializerList

type TidbInitializerList struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ListMeta `json:"metadata"`

	Items []TidbInitializer `json:"items"`
}

+k8s:openapi-gen=true

func (*TidbInitializerList) DeepCopy

func (in *TidbInitializerList) DeepCopy() *TidbInitializerList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbInitializerList.

func (*TidbInitializerList) DeepCopyInto

func (in *TidbInitializerList) DeepCopyInto(out *TidbInitializerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbInitializerList) DeepCopyObject

func (in *TidbInitializerList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TidbInitializerSpec

type TidbInitializerSpec struct {
	Image string `json:"image"`

	Clusters TidbClusterRef `json:"cluster"`

	// PodSecurityContext of the component
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// +optional
	ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// permitHost is the host which will only be allowed to connect to the TiDB.
	// +optional
	PermitHost *string `json:"permitHost,omitempty"`

	// InitSql is the SQL statements executed after the TiDB cluster is bootstrapped.
	// +optional
	InitSql *string `json:"initSql,omitempty"`

	// InitSqlConfigMapName reference a configmap that provide init-sql, take high precedence than initSql if set
	// +optional
	InitSqlConfigMap *string `json:"initSqlConfigMap,omitempty"`

	// +optional
	PasswordSecret *string `json:"passwordSecret,omitempty"`

	// +optional
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`

	// Time zone of TiDB initializer Pods
	// +optional
	Timezone string `json:"timezone,omitempty"`

	// TLSClientSecretName is the name of secret which stores tidb server client certificate
	// Optional: Defaults to nil
	// +optional
	TLSClientSecretName *string `json:"tlsClientSecretName,omitempty"`

	// Tolerations of the TiDB initializer Pod
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// Node selectors of TiDB initializer Pod
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
}

+k8s:openapi-gen=true TidbInitializer spec encode the desired state of tidb initializer Job

func (*TidbInitializerSpec) DeepCopy

func (in *TidbInitializerSpec) DeepCopy() *TidbInitializerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbInitializerSpec.

func (*TidbInitializerSpec) DeepCopyInto

func (in *TidbInitializerSpec) DeepCopyInto(out *TidbInitializerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbInitializerStatus

type TidbInitializerStatus struct {
	batchv1.JobStatus `json:",inline"`

	// Phase is a user readable state inferred from the underlying Job status and TidbCluster status
	Phase InitializePhase `json:"phase,omitempty"`
}

+k8s:openapi-gen=true

func (*TidbInitializerStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbInitializerStatus.

func (*TidbInitializerStatus) DeepCopyInto

func (in *TidbInitializerStatus) DeepCopyInto(out *TidbInitializerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbMonitor

type TidbMonitor struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata"`

	// Spec defines the desired state of TidbMonitor
	Spec TidbMonitorSpec `json:"spec"`

	// +k8s:openapi-gen=false
	// Most recently observed status of the TidbMonitor
	Status TidbMonitorStatus `json:"status,omitempty"`
}

TidbMonitor encode the spec and status of the monitoring component of a TiDB cluster

+k8s:openapi-gen=true +kubebuilder:resource:shortName="tm"

func (*TidbMonitor) BaseGrafanaSpec

func (tm *TidbMonitor) BaseGrafanaSpec() MonitorComponentAccessor

func (*TidbMonitor) BasePrometheusSpec

func (tm *TidbMonitor) BasePrometheusSpec() MonitorComponentAccessor

BasePrometheusSpec return the base spec of Prometheus service

func (*TidbMonitor) BaseReloaderSpec

func (tm *TidbMonitor) BaseReloaderSpec() MonitorComponentAccessor

func (*TidbMonitor) DeepCopy

func (in *TidbMonitor) DeepCopy() *TidbMonitor

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbMonitor.

func (*TidbMonitor) DeepCopyInto

func (in *TidbMonitor) DeepCopyInto(out *TidbMonitor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbMonitor) DeepCopyObject

func (in *TidbMonitor) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*TidbMonitor) GetShards

func (tm *TidbMonitor) GetShards() int32

func (*TidbMonitor) Timezone

func (tm *TidbMonitor) Timezone() string

type TidbMonitorList

type TidbMonitorList struct {
	metav1.TypeMeta `json:",inline"`
	// +k8s:openapi-gen=false
	metav1.ListMeta `json:"metadata"`

	Items []TidbMonitor `json:"items"`
}

+k8s:openapi-gen=true TidbMonitorList is TidbMonitor list

func (*TidbMonitorList) DeepCopy

func (in *TidbMonitorList) DeepCopy() *TidbMonitorList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbMonitorList.

func (*TidbMonitorList) DeepCopyInto

func (in *TidbMonitorList) DeepCopyInto(out *TidbMonitorList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbMonitorList) DeepCopyObject

func (in *TidbMonitorList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TidbMonitorRef

type TidbMonitorRef struct {
	// Namespace is the namespace that TidbMonitor object locates,
	// default to the same namespace with TidbClusterAutoScaler
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Name is the name of TidbMonitor object
	Name string `json:"name"`

	// GrafanaEnabled indicate whether the grafana is enabled for this target tidbmonitor
	// +optional
	GrafanaEnabled bool `json:"grafanaEnabled,omitempty"`
}

+k8s:openapi-gen=true TidbMonitorRef reference to a TidbMonitor

func (*TidbMonitorRef) DeepCopy

func (in *TidbMonitorRef) DeepCopy() *TidbMonitorRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbMonitorRef.

func (*TidbMonitorRef) DeepCopyInto

func (in *TidbMonitorRef) DeepCopyInto(out *TidbMonitorRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbMonitorSpec

type TidbMonitorSpec struct {
	// +optional
	// monitored TiDB cluster info
	Clusters []TidbClusterRef `json:"clusters,omitempty"`

	// Prometheus spec
	Prometheus PrometheusSpec `json:"prometheus"`

	// Grafana spec
	// +optional
	Grafana *GrafanaSpec `json:"grafana,omitempty"`

	// Reloader spec
	Reloader ReloaderSpec `json:"reloader"`

	// Initializer spec
	Initializer InitializerSpec `json:"initializer"`

	// monitored DM cluster spec
	// +optional
	DM *DMMonitorSpec `json:"dm,omitempty"`

	// Thanos spec
	// +optional
	Thanos *ThanosSpec `json:"thanos,omitempty"`

	//PrometheusReloader set prometheus reloader configuration
	//+optional
	PrometheusReloader *PrometheusReloaderSpec `json:"prometheusReloader,omitempty"`

	// Persistent volume reclaim policy applied to the PVs that consumed by TiDB cluster
	// +kubebuilder:default=Retain
	PVReclaimPolicy *corev1.PersistentVolumeReclaimPolicy `json:"pvReclaimPolicy,omitempty"`

	// ImagePullPolicy of TidbMonitor Pods
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// If Persistent enabled, storageClassName must be set to an existing storage.
	// Defaults to false.
	// +optional
	Persistent bool `json:"persistent,omitempty"`

	// The storageClassName of the persistent volume for TidbMonitor data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`

	// Size of the persistent volume.
	// +optional
	Storage string `json:"storage,omitempty"`

	// NodeSelector of the TidbMonitor.
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Annotations for the TidbMonitor.
	// Optional: Defaults to cluster-level setting
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Labels for the TidbMonitor.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// Tolerations of the TidbMonitor.
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// kubePrometheusURL is where tidb-monitoring get the  common metrics of kube-prometheus.
	// Ref: https://github.com/coreos/kube-prometheus
	// +optional
	KubePrometheusURL *string `json:"kubePrometheusURL,omitempty"`

	// alertmanagerURL is where tidb-monitoring push alerts to.
	// Ref: https://prometheus.io/docs/alerting/alertmanager/
	// +optional
	AlertmanagerURL *string `json:"alertmanagerURL,omitempty"`

	// alertManagerRulesVersion is the version of the tidb cluster that used for alert rules.
	// default to current tidb cluster version, for example: v3.0.15
	// +optional
	AlertManagerRulesVersion *string `json:"alertManagerRulesVersion,omitempty"`

	// Additional containers of the TidbMonitor.
	// +optional
	AdditionalContainers []corev1.Container `json:"additionalContainers,omitempty"`

	// ClusterScoped indicates whether this monitor should manage Kubernetes cluster-wide TiDB clusters
	ClusterScoped bool `json:"clusterScoped,omitempty"`

	// The labels to add to any time series or alerts when communicating with
	// external systems (federation, remote storage, Alertmanager).
	ExternalLabels map[string]string `json:"externalLabels,omitempty"`

	// Name of Prometheus external label used to denote replica name.
	// Defaults to the value of `prometheus_replica`. External label will
	// _not_ be added when value is set to empty string (`""`).
	ReplicaExternalLabelName *string `json:"replicaExternalLabelName,omitempty"`

	// Replicas is the number of desired replicas.
	// Defaults to 1.
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`

	// EXPERIMENTAL: Number of shards to distribute targets onto. Number of
	// replicas multiplied by shards is the total number of Pods created. Note
	// that scaling down shards will not reshard data onto remaining instances,
	// it must be manually moved. Increasing shards will not reshard data
	// either but it will continue to be available from the same instances. To
	// query globally use Thanos sidecar and Thanos querier or remote write
	// data to a central location. Sharding is done on the content of the
	// `__address__` target meta-label.
	Shards *int32 `json:"shards,omitempty"`

	// Additional volumes of TidbMonitor pod.
	// +optional
	AdditionalVolumes []corev1.Volume `json:"additionalVolumes,omitempty"`

	// PodSecurityContext of TidbMonitor pod.
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// EnableAlertRules adds alert rules to the Prometheus config even
	// if `AlertmanagerURL` is not configured.
	// +optional
	EnableAlertRules bool `json:"enableAlertRules,omitempty"`

	// Time zone of TidbMonitor
	// Optional: Defaults to UTC
	// +optional
	Timezone string `json:"timezone,omitempty"`

	// PreferIPv6 indicates whether to prefer IPv6 addresses for all components.
	PreferIPv6 bool `json:"preferIPv6,omitempty"`
}

+k8s:openapi-gen=true TidbMonitor spec encode the desired state of tidb monitoring component

func (*TidbMonitorSpec) DeepCopy

func (in *TidbMonitorSpec) DeepCopy() *TidbMonitorSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbMonitorSpec.

func (*TidbMonitorSpec) DeepCopyInto

func (in *TidbMonitorSpec) DeepCopyInto(out *TidbMonitorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbMonitorStatus

type TidbMonitorStatus struct {
	// Storage status for deployment
	DeploymentStorageStatus *DeploymentStorageStatus `json:"deploymentStorageStatus,omitempty"`

	StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"`
}

func (*TidbMonitorStatus) DeepCopy

func (in *TidbMonitorStatus) DeepCopy() *TidbMonitorStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbMonitorStatus.

func (*TidbMonitorStatus) DeepCopyInto

func (in *TidbMonitorStatus) DeepCopyInto(out *TidbMonitorStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbNGMonitoring

type TidbNGMonitoring struct {
	metav1.TypeMeta `json:",inline"`

	// +k8s:openapi-gen=false
	metav1.ObjectMeta `json:"metadata"`

	// Spec contains all spec about tidb ng monitor
	Spec TidbNGMonitoringSpec `json:"spec"`

	// Status is most recently observed status of tidb ng monitor
	//
	// +k8s:openapi-gen=false
	Status TidbNGMonitoringStatus `json:"status,omitempty"`
}

TidbNGMonitoring contains the spec and status of tidb ng monitor

+genclient +k8s:openapi-gen=true +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:resource:shortName="tngm" +kubebuilder:subresource:status

func (*TidbNGMonitoring) AllComponentSpec added in v1.3.7

func (ngm *TidbNGMonitoring) AllComponentSpec() []ComponentAccessor

func (*TidbNGMonitoring) BaseNGMonitoringSpec

func (tngm *TidbNGMonitoring) BaseNGMonitoringSpec() ComponentAccessor

func (*TidbNGMonitoring) ComponentSpec added in v1.3.7

func (ngm *TidbNGMonitoring) ComponentSpec(typ MemberType) ComponentAccessor

func (*TidbNGMonitoring) DeepCopy

func (in *TidbNGMonitoring) DeepCopy() *TidbNGMonitoring

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbNGMonitoring.

func (*TidbNGMonitoring) DeepCopyInto

func (in *TidbNGMonitoring) DeepCopyInto(out *TidbNGMonitoring)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbNGMonitoring) DeepCopyObject

func (in *TidbNGMonitoring) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*TidbNGMonitoring) GetInstanceName

func (tngm *TidbNGMonitoring) GetInstanceName() string

func (*TidbNGMonitoring) NGMonitoringImage

func (tngm *TidbNGMonitoring) NGMonitoringImage() string

NGMonitoringImage return the image used by NGMonitoring.

type TidbNGMonitoringList

type TidbNGMonitoringList struct {
	metav1.TypeMeta `json:",inline"`

	// +k8s:openapi-gen=false
	metav1.ListMeta `json:"metadata"`

	Items []TidbNGMonitoring `json:"items"`
}

TidbNGMonitoringList is TidbNGMonitoring list

+k8s:openapi-gen=true +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*TidbNGMonitoringList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbNGMonitoringList.

func (*TidbNGMonitoringList) DeepCopyInto

func (in *TidbNGMonitoringList) DeepCopyInto(out *TidbNGMonitoringList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TidbNGMonitoringList) DeepCopyObject

func (in *TidbNGMonitoringList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TidbNGMonitoringSpec

type TidbNGMonitoringSpec struct {
	// ComponentSpec is common spec.
	// NOTE: the same field will be overridden by component's spec.
	ComponentSpec `json:",inline"`

	// Clusters reference TiDB cluster
	//
	// +kubebuilder:validation:MaxItems=1
	// +kubebuilder:validation:MinItems=1
	Clusters []TidbClusterRef `json:"clusters"`

	// Paused pause controller if it is true
	Paused bool `json:"paused,omitempty"`

	// Persistent volume reclaim policy applied to the PVs that consumed by tidb ng monitoring
	//
	// +kubebuilder:default=Retain
	PVReclaimPolicy *corev1.PersistentVolumeReclaimPolicy `json:"pvReclaimPolicy,omitempty"`

	// ClusterDomain is the Kubernetes Cluster Domain of tidb ng monitoring
	ClusterDomain string `json:"clusterDomain,omitempty"`

	// NGMonitoring is spec of ng monitoring
	NGMonitoring NGMonitoringSpec `json:"ngMonitoring"`

	// PreferIPv6 indicates whether to prefer IPv6 addresses for all components.
	PreferIPv6 bool `json:"preferIPv6,omitempty"`
}

TidbNGMonitoringSpec is spec of tidb ng monitoring

+k8s:openapi-gen=true

func (*TidbNGMonitoringSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbNGMonitoringSpec.

func (*TidbNGMonitoringSpec) DeepCopyInto

func (in *TidbNGMonitoringSpec) DeepCopyInto(out *TidbNGMonitoringSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TidbNGMonitoringStatus

type TidbNGMonitoringStatus struct {
	// NGMonitoring is status of ng monitoring
	NGMonitoring NGMonitoringStatus `json:"ngMonitoring,omitempty"`
}

TidbNGMonitoringStatus is status of tidb ng monitoring

func (*TidbNGMonitoringStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbNGMonitoringStatus.

func (*TidbNGMonitoringStatus) DeepCopyInto

func (in *TidbNGMonitoringStatus) DeepCopyInto(out *TidbNGMonitoringStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TikvAutoScalerSpec

type TikvAutoScalerSpec struct {
	BasicAutoScalerSpec `json:",inline"`
}

+k8s:openapi-gen=true TikvAutoScalerSpec describes the spec for tikv auto-scaling

func (*TikvAutoScalerSpec) DeepCopy

func (in *TikvAutoScalerSpec) DeepCopy() *TikvAutoScalerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TikvAutoScalerSpec.

func (*TikvAutoScalerSpec) DeepCopyInto

func (in *TikvAutoScalerSpec) DeepCopyInto(out *TikvAutoScalerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TikvAutoScalerStatus

type TikvAutoScalerStatus struct {
	BasicAutoScalerStatus `json:",inline"`
}

+k8s:openapi-gen=true TikvAutoScalerStatus describe the auto-scaling status of tikv

func (*TikvAutoScalerStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TikvAutoScalerStatus.

func (*TikvAutoScalerStatus) DeepCopyInto

func (in *TikvAutoScalerStatus) DeepCopyInto(out *TikvAutoScalerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TopologySpreadConstraint

type TopologySpreadConstraint struct {
	// TopologyKey is the key of node labels. Nodes that have a label with this key
	// and identical values are considered to be in the same topology.
	// We consider each <key, value> as a "bucket", and try to put balanced number
	// of pods into each bucket.
	// WhenUnsatisfiable is default set to DoNotSchedule
	// LabelSelector is generated by component type
	// See pkg/apis/pingcap/v1alpha1/tidbcluster_component.go#TopologySpreadConstraints()
	TopologyKey string `json:"topologyKey"`

	// MaxSkew describes the degree to which pods may be unevenly distributed.
	// When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference
	// between the number of matching pods in the target topology and the global minimum.
	// The global minimum is the minimum number of matching pods in an eligible domain
	// or zero if the number of eligible domains is less than MinDomains.
	// For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
	// labelSelector spread as 2/2/1:
	// In this case, the global minimum is 1.
	// +-------+-------+-------+
	// | zone1 | zone2 | zone3 |
	// +-------+-------+-------+
	// |  P P  |  P P  |   P   |
	// +-------+-------+-------+
	// - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;
	// scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2)
	// violate MaxSkew(1).
	// - if MaxSkew is 2, incoming pod can be scheduled onto any zone.
	// When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence
	// to topologies that satisfy it.
	// Default value is 1.
	// +kubebuilder:default=1
	// +optional
	MaxSkew int32 `json:"maxSkew" protobuf:"varint,1,opt,name=maxSkew"`

	// MinDomains indicates a minimum number of eligible domains.
	// When the number of eligible domains with matching topology keys is less than minDomains,
	// Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
	// And when the number of eligible domains with matching topology keys equals or greater than minDomains,
	// this value has no effect on scheduling.
	// As a result, when the number of eligible domains is less than minDomains,
	// scheduler won't schedule more than maxSkew Pods to those domains.
	// If value is nil, the constraint behaves as if MinDomains is equal to 1.
	// Valid values are integers greater than 0.
	// When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
	//
	// For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
	// labelSelector spread as 2/2/2:
	// +-------+-------+-------+
	// | zone1 | zone2 | zone3 |
	// +-------+-------+-------+
	// |  P P  |  P P  |  P P  |
	// +-------+-------+-------+
	// The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
	// In this situation, new pod with the same labelSelector cannot be scheduled,
	// because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
	// it will violate MaxSkew.
	// +optional
	MinDomains *int32 `json:"minDomains,omitempty" protobuf:"varint,5,opt,name=minDomains"`

	// NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector
	// when calculating pod topology spread skew. Options are:
	// - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
	// - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
	//
	// If this value is nil, the behavior is equivalent to the Honor policy.
	// +optional
	NodeAffinityPolicy *corev1.NodeInclusionPolicy `json:"nodeAffinityPolicy,omitempty" protobuf:"bytes,6,opt,name=nodeAffinityPolicy"`

	// MatchLabels is used to overwrite generated corev1.TopologySpreadConstraints.LabelSelector
	// corev1.TopologySpreadConstraint generated in component_spec.go will set a
	// LabelSelector automatically with some KV.
	// Historically, it is l["comp"] = "" for component tiproxy. And we will use
	// MatchLabels to keep l["comp"] = "" for old clusters with tiproxy
	// +optional
	MatchLabels label.Label `json:"matchLabels"`
}

TopologySpreadConstraint specifies how to spread matching pods among the given topology. It is a minimal version of corev1.TopologySpreadConstraint to avoid to add too many fields of API Refer to https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints

func (*TopologySpreadConstraint) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologySpreadConstraint.

func (*TopologySpreadConstraint) DeepCopyInto

func (in *TopologySpreadConstraint) DeepCopyInto(out *TopologySpreadConstraint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TxnLocalLatches

type TxnLocalLatches struct {
	// +optional
	Enabled *bool `toml:"enabled,omitempty" json:"enabled,omitempty"`
	// +optional
	Capacity *uint `toml:"capacity,omitempty" json:"capacity,omitempty"`
}

TxnLocalLatches is the TxnLocalLatches section of the config. +k8s:openapi-gen=true

func (*TxnLocalLatches) DeepCopy

func (in *TxnLocalLatches) DeepCopy() *TxnLocalLatches

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TxnLocalLatches.

func (*TxnLocalLatches) DeepCopyInto

func (in *TxnLocalLatches) DeepCopyInto(out *TxnLocalLatches)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UnjoinedMember

type UnjoinedMember struct {
	PodName   string                    `json:"podName,omitempty"`
	PVCUID    types.UID                 `json:"pvcUID,omitempty"`
	PVCUIDSet map[types.UID]EmptyStruct `json:"pvcUIDSet,omitempty"`
	// +nullable
	CreatedAt metav1.Time `json:"createdAt,omitempty"`
}

UnjoinedMember is the pd unjoin cluster member information

func (*UnjoinedMember) DeepCopy

func (in *UnjoinedMember) DeepCopy() *UnjoinedMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnjoinedMember.

func (*UnjoinedMember) DeepCopyInto

func (in *UnjoinedMember) DeepCopyInto(out *UnjoinedMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type User

type User struct {
	// +optional
	Password string `json:"password,omitempty" toml:"password"`
	// +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"`
}

User is the configuration of users. +k8s:openapi-gen=false

func (*User) DeepCopy

func (in *User) DeepCopy() *User

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User.

func (*User) DeepCopyInto

func (in *User) DeepCopyInto(out *User)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkerConfig

type WorkerConfig struct {
	// Log level.
	// Optional: Defaults to info
	// +optional
	LogLevel *string `toml:"log-level,omitempty" json:"log-level,omitempty"`
	// File log config.
	// +optional
	LogFile *string `toml:"log-file,omitempty" json:"log-file,omitempty"`
	// Log format. one of json or text.
	// +optional
	LogFormat *string `toml:"log-format,omitempty" json:"log-format,omitempty"`

	// KeepAliveTTL is the keepalive TTL when dm-worker writes to the embedded etcd of dm-master
	// Optional: Defaults to 10
	// +optional
	KeepAliveTTL *int64 `toml:"keepalive-ttl,omitempty" json:"keepalive-ttl,omitempty"`
	// dm-worker's security config
	// +optional
	DMSecurityConfig `toml:",inline" json:",inline"`
}

WorkerConfig is the configuration of dm-worker-server +k8s:openapi-gen=true

func (*WorkerConfig) DeepCopy

func (in *WorkerConfig) DeepCopy() *WorkerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerConfig.

func (*WorkerConfig) DeepCopyInto

func (in *WorkerConfig) DeepCopyInto(out *WorkerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkerConfigWraper

type WorkerConfigWraper struct {
	*config.GenericConfig `json:",inline"`
}

func NewWorkerConfig

func NewWorkerConfig() *WorkerConfigWraper

func (*WorkerConfigWraper) DeepCopy

func (in *WorkerConfigWraper) DeepCopy() *WorkerConfigWraper

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerConfigWraper.

func (*WorkerConfigWraper) DeepCopyInto

func (in *WorkerConfigWraper) DeepCopyInto(out *WorkerConfigWraper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WorkerConfigWraper) MarshalJSON

func (c *WorkerConfigWraper) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler interface.

func (*WorkerConfigWraper) MarshalTOML

func (c *WorkerConfigWraper) MarshalTOML() ([]byte, error)

func (*WorkerConfigWraper) UnmarshalJSON

func (c *WorkerConfigWraper) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler interface. If the data is a object, we must use the Deprecated WorkerConfig to Unmarshal for compatibility, if we use a map[string]interface{} to Unmarshal directly, we can not distinct the type between integer and float for toml.

type WorkerFailureMember

type WorkerFailureMember struct {
	PodName string `json:"podName,omitempty"`
	// +nullable
	CreatedAt metav1.Time `json:"createdAt,omitempty"`
}

WorkerFailureMember is the dm-worker failure member information

func (*WorkerFailureMember) DeepCopy

func (in *WorkerFailureMember) DeepCopy() *WorkerFailureMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerFailureMember.

func (*WorkerFailureMember) DeepCopyInto

func (in *WorkerFailureMember) DeepCopyInto(out *WorkerFailureMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkerMember

type WorkerMember struct {
	Name  string `json:"name,omitempty"`
	Addr  string `json:"addr,omitempty"`
	Stage string `json:"stage"`
	// Last time the health transitioned from one to another.
	// +nullable
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}

WorkerMember is dm-worker member status

func (*WorkerMember) DeepCopy

func (in *WorkerMember) DeepCopy() *WorkerMember

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerMember.

func (*WorkerMember) DeepCopyInto

func (in *WorkerMember) DeepCopyInto(out *WorkerMember)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkerSpec

type WorkerSpec struct {
	ComponentSpec               `json:",inline"`
	corev1.ResourceRequirements `json:",inline"`

	// The desired ready replicas
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// Base image of the component, image tag is now allowed during validation
	// +kubebuilder:default=pingcap/dm
	// +optional
	BaseImage string `json:"baseImage,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 storageClassName of the persistent volume for dm-worker data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`

	// StorageSize is the request storage size for dm-worker.
	// Defaults to "10Gi".
	// +optional
	StorageSize string `json:"storageSize,omitempty"`

	// Subdirectory within the volume to store dm-worker Data. By default, the data
	// is stored in the root directory of volume which is mounted at
	// /var/lib/dm-worker.
	// Specifying this will change the data directory to a subdirectory, e.g.
	// /var/lib/dm-worker/data if you set the value to "data".
	// It's dangerous to change this value for a running cluster as it will
	// upgrade your cluster to use a new storage directory.
	// Defaults to "" (volume's root).
	// +optional
	DataSubDir string `json:"dataSubDir,omitempty"`

	// Config is the Configuration of dm-worker-servers
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	Config *WorkerConfigWraper `json:"config,omitempty"`

	// RecoverFailover indicates that Operator can recover the failover Pods
	// +optional
	RecoverFailover bool `json:"recoverFailover,omitempty"`

	// Failover is the configurations of failover
	// +optional
	Failover *Failover `json:"failover,omitempty"`
}

+k8s:openapi-gen=true WorkerSpec contains details of dm-worker members

func (*WorkerSpec) DeepCopy

func (in *WorkerSpec) DeepCopy() *WorkerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerSpec.

func (*WorkerSpec) DeepCopyInto

func (in *WorkerSpec) DeepCopyInto(out *WorkerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkerStatus

type WorkerStatus struct {
	Synced         bool                           `json:"synced,omitempty"`
	Phase          MemberPhase                    `json:"phase,omitempty"`
	StatefulSet    *apps.StatefulSetStatus        `json:"statefulSet,omitempty"`
	Members        map[string]WorkerMember        `json:"members,omitempty"`
	FailureMembers map[string]WorkerFailureMember `json:"failureMembers,omitempty"`
	FailoverUID    types.UID                      `json:"failoverUID,omitempty"`
	Image          string                         `json:"image,omitempty"`
	// Volumes contains the status of all volumes.
	Volumes map[StorageVolumeName]*StorageVolumeStatus `json:"volumes,omitempty"`
	// Represents the latest available observations of a component's state.
	// +optional
	// +nullable
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

WorkerStatus is dm-worker status

func (*WorkerStatus) DeepCopy

func (in *WorkerStatus) DeepCopy() *WorkerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerStatus.

func (*WorkerStatus) DeepCopyInto

func (in *WorkerStatus) DeepCopyInto(out *WorkerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WorkerStatus) GetConditions added in v1.3.6

func (s *WorkerStatus) GetConditions() []metav1.Condition

func (*WorkerStatus) GetPhase added in v1.3.6

func (s *WorkerStatus) GetPhase() MemberPhase

func (*WorkerStatus) GetStatefulSet added in v1.3.7

func (s *WorkerStatus) GetStatefulSet() *appsv1.StatefulSetStatus

func (*WorkerStatus) GetSynced added in v1.3.6

func (s *WorkerStatus) GetSynced() bool

func (*WorkerStatus) GetVolReplaceInProgress added in v1.5.1

func (s *WorkerStatus) GetVolReplaceInProgress() bool

func (*WorkerStatus) GetVolumes added in v1.3.6

func (s *WorkerStatus) GetVolumes() map[StorageVolumeName]*StorageVolumeStatus

func (*WorkerStatus) MemberType added in v1.3.7

func (s *WorkerStatus) MemberType() MemberType

func (*WorkerStatus) RemoveCondition added in v1.3.6

func (s *WorkerStatus) RemoveCondition(conditionType string)

func (*WorkerStatus) SetCondition added in v1.3.6

func (s *WorkerStatus) SetCondition(newCondition metav1.Condition)

func (*WorkerStatus) SetPhase added in v1.3.7

func (s *WorkerStatus) SetPhase(phase MemberPhase)

func (*WorkerStatus) SetStatefulSet added in v1.3.7

func (s *WorkerStatus) SetStatefulSet(sts *appsv1.StatefulSetStatus)

func (*WorkerStatus) SetSynced added in v1.3.7

func (s *WorkerStatus) SetSynced(synced bool)

func (*WorkerStatus) SetVolReplaceInProgress added in v1.5.1

func (s *WorkerStatus) SetVolReplaceInProgress(status bool)

func (*WorkerStatus) SetVolumes added in v1.4.0

func (s *WorkerStatus) SetVolumes(vols map[StorageVolumeName]*StorageVolumeStatus)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL