v1alpha1

package
v2.0.0-...-2b81667 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 95

Documentation

Overview

+groupName=core.pingcap.com +k8s:openapi-gen=true +k8s:deepcopy-gen=package

+kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;patch;delete

+kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core,resources=persistentvolumeclaims,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core,resources=persistentvolumes,verbs=get;list;watch +kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core,resources=events,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core,resources=secrets,verbs=get;list;watch +kubebuilder:rbac:groups=core,resources=nodes,verbs=get;list;watch

+kubebuilder:rbac:groups=apps,resources=controllerrevisions,verbs=get;list;watch;create;update;patch;delete

+kubebuilder:rbac:groups=storage.k8s.io,resources=storageclasses,verbs=get;list;watch +kubebuilder:rbac:groups=storage.k8s.io,resources=volumeattributesclasses,verbs=get;list;watch

+kubebuilder:rbac:groups=core.pingcap.com,resources=clusters,verbs=get;list;watch;update +kubebuilder:rbac:groups=core.pingcap.com,resources=clusters/status,verbs=get;update;patch

+kubebuilder:rbac:groups=core.pingcap.com,resources=pdgroups,verbs=get;list;watch;delete;update +kubebuilder:rbac:groups=core.pingcap.com,resources=pdgroups/status,verbs=get;list;watch;update +kubebuilder:rbac:groups=core.pingcap.com,resources=pds,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core.pingcap.com,resources=pds/status,verbs=get;list;watch;update;patch

+kubebuilder:rbac:groups=core.pingcap.com,resources=tikvgroups,verbs=get;list;watch;delete;update +kubebuilder:rbac:groups=core.pingcap.com,resources=tikvgroups/status,verbs=get;list;watch;update +kubebuilder:rbac:groups=core.pingcap.com,resources=tikvs,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core.pingcap.com,resources=tikvs/status,verbs=get;list;watch;update;patch

+kubebuilder:rbac:groups=core.pingcap.com,resources=tiflashgroups,verbs=get;list;watch;delete;update +kubebuilder:rbac:groups=core.pingcap.com,resources=tiflashgroups/status,verbs=get;list;watch;update +kubebuilder:rbac:groups=core.pingcap.com,resources=tiflashes,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core.pingcap.com,resources=tiflashes/status,verbs=get;list;watch;update;patch

+kubebuilder:rbac:groups=core.pingcap.com,resources=tidbgroups,verbs=get;list;watch;delete;update +kubebuilder:rbac:groups=core.pingcap.com,resources=tidbgroups/status,verbs=get;list;watch;update +kubebuilder:rbac:groups=core.pingcap.com,resources=tidbs,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core.pingcap.com,resources=tidbs/status,verbs=get;list;watch;update;patch

+kubebuilder:rbac:groups=core.pingcap.com,resources=ticdcgroups,verbs=get;list;watch;delete;update +kubebuilder:rbac:groups=core.pingcap.com,resources=ticdcgroups/status,verbs=get;list;watch;update +kubebuilder:rbac:groups=core.pingcap.com,resources=ticdcs,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core.pingcap.com,resources=ticdcs/status,verbs=get;list;watch;update;patch

+kubebuilder:rbac:verbs=get,urls=/metrics

Package v1alpha1 is the v1alpha1 version of core tidb operator api

Index

Constants

View Source
const (
	// ClusterCondAvailable means the cluster is available, i.e. the cluster can be used.
	// But it does not mean all members in the cluster are healthy.
	ClusterCondAvailable = "Available"

	// ClusterCondProgressing means the cluster is progressing, i.e. the cluster is being created, updated, scaled, etc.
	ClusterCondProgressing = "Progressing"
	ClusterCreationReason  = "ClusterCreation"
	ClusterDeletionReason  = "ClusterDeletion"
	ClusterAvailableReason = "ClusterAvailable"

	ClusterCondSuspended = "Suspended"
	ClusterSuspendReason = "ClusterSuspend"
)
View Source
const (
	// CondSuspended is a condition to display whether the group or instance is suspended
	CondSuspended     = "Suspended"
	ReasonSuspended   = "Suspended"
	ReasonSuspending  = "Suspending"
	ReasonUnsuspended = "Unsuspended"
)
View Source
const (
	ReasonUnknown = "Unknown"
	// Ready means all managed resources are ready.
	// NOTE: It does not mean all managed resources are up to date.
	//
	// condition
	CondRunning = "Running"
	CondReady   = "Ready"
	// reason for both
	ReasonReady   = CondReady
	ReasonRunning = CondRunning
	// reason for group
	ReasonNotAllInstancesReady = "NotAllInstancesReady"
	// reason for instance
	ReasonPodNotCreated      = "PodNotCreated"
	ReasonPodNotReady        = "PodNotReady"
	ReasonPodNotRunning      = "PodNotRunning"
	ReasonPodTerminating     = "PodTerminating"
	ReasonInstanceNotHealthy = "InstanceNotHealthy"

	// Synced means all specs of managed resources are up to date and
	// nothing need to do in controller but only status updation.
	CondSynced = "Synced"
	// reason for both
	ReasonSynced = CondSynced
	// reason for group
	ReasonNotAllInstancesUpToDate = "NotAllInstancesUpToDate"
	// reason for instance
	ReasonPodNotUpToDate = "PodNotUpToDate"
	ReasonPodNotDeleted  = "PodNotDeleted"

	// Deprecated: not used anymore
	ReasonUnready  = "Unready"
	ReasonUnsynced = "Unsynced"
)
View Source
const (
	// ReasonOfflineProcessing means the store is being offlined.
	ReasonOfflineProcessing = "Processing"
	// ReasonOfflineCanceling means the store is being offlined.
	ReasonOfflineCanceling = "Canceling"
	// ReasonOfflineCompleted means the store has been successfully offlined and removed from PD.
	ReasonOfflineCompleted = "Completed"

	// ReasonOfflineFailed means the offline operation failed.
	// Deprecated: cannot indicate its delete failure or cancel failure
	ReasonOfflineFailed = "Failed"
)
View Source
const (
	// KeyPrefix defines key prefix of well known labels and annotations
	KeyPrefix = "pingcap.com/"

	// LabelKeyManagedBy means resources are managed by tidb operator
	LabelKeyManagedBy         = KeyPrefix + "managed-by"
	LabelValManagedByOperator = "tidb-operator"

	// LabelKeyCluster means which tidb cluster the resource belongs to
	LabelKeyCluster = KeyPrefix + "cluster"
	// LabelKeyComponent means the component of the resource
	LabelKeyComponent = KeyPrefix + "component"
	// LabelKeyGroup means the component group of the resource
	LabelKeyGroup = KeyPrefix + "group"
	// LabelKeyInstance means the instance of the resource
	LabelKeyInstance = KeyPrefix + "instance"
	// LabelKeyName means the name of the resource
	LabelKeyName = KeyPrefix + "name"

	// LabelKeyPodSpecHash is the hash of the pod spec.
	LabelKeyPodSpecHash = KeyPrefix + "pod-spec-hash"

	// LabelKeyInstanceRevisionHash is the revision hash of the instance
	LabelKeyInstanceRevisionHash = KeyPrefix + "instance-revision-hash"

	// LabelKeyConfigHash is the hash of the user-specified config (i.e., `.Spec.Config`),
	// which will be used to determine whether the config has changed.
	// Since the tidb operator will overlay the user-specified config with some operator-managed fields,
	// if we hash the overlayed config, with the evolving TiDB Operator, the hash may change,
	// potentially triggering an unexpected rolling update.
	// Instead, we choose to hash the user-specified config,
	// and the worst case is that users expect a reboot but it doesn't happen.
	LabelKeyConfigHash = KeyPrefix + "config-hash"

	// LabelKeyVolumeName is used to distinguish different volumes, e.g. data volumes, log volumes, etc.
	// This label will be added to the PVCs created by the tidb operator.
	LabelKeyVolumeName = KeyPrefix + "volume-name"
)

TODO(liubo02): move to meta

View Source
const (
	// Label value for meta.LabelKeyComponent
	LabelValComponentPD              = string(meta.ComponentPD)
	LabelValComponentTiDB            = string(meta.ComponentTiDB)
	LabelValComponentTiKV            = string(meta.ComponentTiKV)
	LabelValComponentTiKVWorker      = string(meta.ComponentTiKVWorker)
	LabelValComponentTiFlash         = string(meta.ComponentTiFlash)
	LabelValComponentTiCDC           = string(meta.ComponentTiCDC)
	LabelValComponentTSO             = string(meta.ComponentTSO)
	LabelValComponentScheduling      = string(meta.ComponentScheduling)
	LabelValComponentRouter          = string(meta.ComponentRouter)
	LabelValComponentResourceManager = string(meta.ComponentResourceManager)
	LabelValComponentTiProxy         = string(meta.ComponentTiProxy)
	// Deprecated: use LabelValComponentScheduling
	LabelValComponentScheduler = string(meta.ComponentScheduler)

	// LabelKeyClusterID is the unique identifier of the cluster.
	// This label is used for backward compatibility with TiDB Operator v1, so it has a different prefix.
	LabelKeyClusterID = "tidb.pingcap.com/cluster-id"
	// LabelKeyMemberID is the unique identifier of a PD member.
	// This label is used for backward compatibility with TiDB Operator v1, so it has a different prefix.
	LabelKeyMemberID = "tidb.pingcap.com/member-id"
	// LabelKeyStoreID is the unique identifier of a TiKV or TiFlash store.
	// This label is used for backward compatibility with TiDB Operator v1, so it has a different prefix.
	LabelKeyStoreID = "tidb.pingcap.com/store-id"
)
View Source
const (
	// AnnoKeyPrefix defines key prefix of well known annotations
	AnnoKeyPrefix = "core.pingcap.com/"

	// all bool anno will use this val as default
	AnnoValTrue = "true"

	// means the instance is marked as deleted and will be deleted later
	AnnoKeyDeferDelete = AnnoKeyPrefix + "defer-delete"

	// Last instance template is recorded to check whether the pod should be restarted because of changes of instance template
	AnnoKeyLastInstanceTemplate = AnnoKeyPrefix + "last-instance-template"

	// Features is recorded to check whether the pod should be restarted because of changes of features
	AnnoKeyFeatures = AnnoKeyPrefix + "features"

	// Priority is the manually specified priority for the scale-in/update operation, the val is a non-negative integer.
	// 0 is the highest priority to be chosen to be deleted.
	// unset is the lowest priority.
	// Priority is the highest doesn't mean the instance must be chosen. For example, operator will try to ensure the topology spreading.
	AnnoKeyPriority = AnnoKeyPrefix + "priority"
)
View Source
const (
	// VolumeNameConfig defines volume name for main config file
	VolumeNameConfig = meta.NamePrefix + "config"
	// VolumeNamePrestopChecker defines volume name for pre stop checker cmd
	VolumeNamePrestopChecker = meta.NamePrefix + "prestop-checker"
	// VolumeNameBootstrapSQL is the volume name for bootstrap sql
	VolumeNameBootstrapSQL = meta.NamePrefix + "tidb-bootstrap-sql"
	// VolumeNameTiDBAuthToken is the volume name for tidb auth token
	VolumeNameTiDBAuthToken = meta.NamePrefix + "tidb-auth-token"
	// VolumeNameTiDBSlowLogDefault defines default volume name of tidb slowlog
	// Users may claim another volume for tidb slowlog and the default one will be removed
	VolumeNameTiDBSlowLogDefault = meta.NamePrefix + "slowlog"
	// VolumeNameSEM is the volume name for tidb sem config
	VolumeNameSEM = meta.NamePrefix + "sem"
	// VolumeNameKubeResource defines volume name for kubernetes resource syncer
	VolumeNameKubeResource = meta.NamePrefix + "kube-resource"

	// TLS
	//
	// VolumeNameClusterTLS defines volume name for the TLS secret used between components in the TiDB cluster
	VolumeNameClusterTLS = meta.NamePrefix + "tls"
	// VolumeNameClusterClientTLS defines volume name for any one-time job accessing the TiDB cluster components
	VolumeNameClusterClientTLS = meta.NamePrefix + "cluster-client-tls"
	// VolumeNameMySQLTLS is the volume name for the TLS secret used by TLS communication between TiDB server and MySQL client.
	VolumeNameMySQLTLS = meta.NamePrefix + "tidb-sql-tls"
	// VolumeNameTiProxyMySQLTLS is the volume name for the TLS secret used by TLS communication between TiProxy and MySQL client.
	VolumeNameTiProxyMySQLTLS = meta.NamePrefix + "tiproxy-sql-tls"
	// VolumeNameTiProxyHTTPTLS is the volume name for the TLS secret used by TLS communication between TiProxy HTTP server and HTTP client.
	VolumeNameTiProxyHTTPTLS = meta.NamePrefix + "tiproxy-http-tls"
	// VolumeNameTiProxyTiDBTLS is the volume name for the TLS secret used by TLS communication between TiProxy and TiDB server.
	VolumeNameTiProxyTiDBTLS = meta.NamePrefix + "tiproxy-tidb-tls"

	VolumeNameTiDBSessionTokenSigningTLS = meta.NamePrefix + "session-token-signing-tls"
)

All volume names

View Source
const (
	// Main component containers of the tidb cluster
	// These names are well known so the name prefix is not added.
	ContainerNamePD              = "pd"
	ContainerNameTiKV            = "tikv"
	ContainerNameTiKVWorker      = "tikv-worker"
	ContainerNameTiDB            = "tidb"
	ContainerNameTiFlash         = "tiflash"
	ContainerNameTiCDC           = "ticdc"
	ContainerNameTSO             = "tso"
	ContainerNameScheduling      = "scheduling"
	ContainerNameRouter          = "router"
	ContainerNameResourceManager = "resource-manager"
	ContainerNameTiProxy         = "tiproxy"
	// Deprecated: use ContainerNameScheduling
	ContainerNameScheduler = "scheduler"

	// An init container to copy pre stop checker cmd to main container
	ContainerNamePrestopChecker = meta.NamePrefix + "prestop-checker"

	// TiDB
	//
	// Container to redirect slowlog
	ContainerNameTiDBSlowLog = meta.NamePrefix + "slowlog"

	// TiFlash
	//
	// Container to redirect server log
	ContainerNameTiFlashServerLog = meta.NamePrefix + "serverlog"
	// Container to redirect error log
	ContainerNameTiFlashErrorLog = meta.NamePrefix + "errorlog"

	// TiCDC
	//
	// An sidecar container to load secrets into main container
	ContainerNameResourceSyncer = meta.NamePrefix + "resource-syncer"
)

All container names

View Source
const (
	// config dir path
	DirPathConfigPD              = "/etc/pd"
	DirPathConfigTiKV            = "/etc/tikv"
	DirPathConfigTiKVWorker      = "/etc/tikv-worker"
	DirPathConfigTiDB            = "/etc/tidb"
	DirPathConfigTiFlash         = "/etc/tiflash"
	DirPathConfigTiCDC           = "/etc/ticdc"
	DirPathConfigTSO             = "/etc/tso"
	DirPathConfigScheduling      = "/etc/scheduling"
	DirPathConfigRouter          = "/etc/router"
	DirPathConfigResourceManager = "/etc/resource-manager"
	DirPathConfigTiProxy         = "/etc/tiproxy"
	// Deprecated: use DirPathConfigScheduling
	DirPathConfigScheduler = "/etc/scheduler"

	// DirPathPrestop defines dir path of pre stop checker cmd
	DirPathPrestop = "/prestop"
	// Dir path of bootstrap sql
	DirPathBootstrapSQL = "/etc/tidb-bootstrap"
	// Dir path of tidb auth token
	DirPathTiDBAuthToken = "/var/lib/tidb-auth-token" // #nosec
	// Default dir path of tidb slowlog
	DirPathTiDBSlowLogDefault = "/var/log/tidb"
	// Dir path of sem config
	DirPathSEMConfig = "/etc/sem"
	// Dir path for kubernetes resource
	DirPathKubeResource = "/var/lib/kube-resource"

	// TLS
	//
	// Dir path of cluster tls file
	DirPathClusterTLSPD              = "/var/lib/pd-tls"
	DirPathClusterTLSTiKV            = "/var/lib/tikv-tls"
	DirPathClusterTLSTiKVWorker      = "/var/lib/tikv-worker-tls"
	DirPathClusterTLSTiDB            = "/var/lib/tidb-tls"
	DirPathClusterTLSTiFlash         = "/var/lib/tiflash-tls"
	DirPathClusterClientTLS          = "/var/lib/cluster-client-tls"
	DirPathClusterTLSTiCDC           = "/var/lib/ticdc-tls"
	DirPathClusterTLSTSO             = "/var/lib/tso-tls"
	DirPathClusterTLSScheduling      = "/var/lib/scheduling-tls"
	DirPathClusterTLSRouter          = "/var/lib/router-tls"
	DirPathClusterTLSResourceManager = "/var/lib/resource-manager-tls"
	DirPathClusterTLSTiProxy         = "/var/lib/tiproxy-tls"
	// Deprecated: use DirPathClusterTLSScheduling
	DirPathClusterTLSScheduler = "/var/lib/scheduler-tls"

	// DirPathMySQLTLS is the dir path of tls file for tidb and mysql client
	DirPathMySQLTLS = "/var/lib/tidb-sql-tls"
	// DirPathTiProxyMySQLTLS is the dir path of tls file for tiproxy and mysql client
	DirPathTiProxyMySQLTLS = "/var/lib/tiproxy-sql-tls"
	// DirPathTiProxyHTTPTLS is the dir path of tls file for tiproxy http server
	DirPathTiProxyHTTPTLS = "/var/lib/tiproxy-http-tls"
	// DirPathTiProxyTiDBTLS is the dir path of tls file for tiproxy and tidb
	DirPathTiProxyTiDBTLS = "/var/lib/tiproxy-tidb-tls"

	DirPathTiDBSessionTokenSigningTLS = "/var/lib/tidb-session-token-signing-tls"
)

All well known dir path

View Source
const (
	// FileNameConfig defines default name of config file
	FileNameConfig = "config.toml"
	// FileNameConfigTiFlashProxy defines default name of tiflash proxy config file
	FileNameConfigTiFlashProxy = "proxy.toml"
	// FileNameBootstrapSQL defines default file name of bootstrap sql
	FileNameBootstrapSQL = "bootstrap.sql"
	// FileNameTiDBAuthTokenJWKS defines default file name of auth token jwks
	FileNameTiDBAuthTokenJWKS = "tidb_auth_token_jwks.json" // #nosec
	// FileNameTiDBSlowLog defines default file name of tidb slowlog
	FileNameTiDBSlowLog = "slowlog"
	// FileNameSEMConfig defines default file name of tidb sem config
	FileNameSEMConfig = "sem.json"
)

All file names

View Source
const (
	PDPortNameClient    = "client"
	PDPortNamePeer      = "peer"
	DefaultPDPortClient = 2379
	DefaultPDPortPeer   = 2380

	// DefaultPDMinReadySeconds is default min ready seconds of pd
	DefaultPDMinReadySeconds = 5
)
View Source
const (
	ResourceManagerPortNameClient    = "client"
	DefaultResourceManagerPortClient = 3379

	// DefaultResourceManagerMinReadySeconds is default min ready seconds of resource manager
	DefaultResourceManagerMinReadySeconds = 5
)
View Source
const (
	RouterPortNameClient    = "client"
	DefaultRouterPortClient = 2379

	// DefaultRouterMinReadySeconds is default min ready seconds of router
	DefaultRouterMinReadySeconds = 5
)
View Source
const (
	// Deprecated: use SchedulingPortNameClient
	SchedulerPortNameClient = "client"
	// Deprecated: use DefaultSchedulingPortClient
	DefaultSchedulerPortClient = 3379

	// DefaultSchedulerMinReadySeconds is default min ready seconds of scheduling
	DefaultSchedulerMinReadySeconds = DefaultSchedulingMinReadySeconds
)
View Source
const (
	SchedulingPortNameClient    = "client"
	DefaultSchedulingPortClient = 3379

	// DefaultSchedulingMinReadySeconds is default min ready seconds of scheduling
	DefaultSchedulingMinReadySeconds = 5
)
View Source
const (
	TiCDCPortName    = "ticdc" // main port
	DefaultTiCDCPort = 8300

	// DefaultTiCDCMinReadySeconds is default min ready seconds of ticdc
	DefaultTiCDCMinReadySeconds = 5
)
View Source
const (
	TiCDCGroupCondAvailable   = "Available"
	TiCDCGroupAvailableReason = "TiCDCGroupAvailable"
)
View Source
const (
	TiDBPortNameClient    = "mysql-client"
	TiDBPortNameStatus    = "status"
	DefaultTiDBPortClient = 4000
	DefaultTiDBPortStatus = 10080

	// DefaultTiDBMinReadySeconds is default min ready seconds of tidb
	DefaultTiDBMinReadySeconds = 10
)
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 (
	TiDBGroupCondAvailable   = "Available"
	TiDBGroupAvailableReason = "TiDBGroupAvailable"
)
View Source
const (
	TiFlashPortNameFlash       = "tiflash"
	TiFlashPortNameProxy       = "proxy"
	TiFlashPortNameMetrics     = "metrics"
	TiFlashPortNameProxyStatus = "proxy-metrics" // both used for metrics and status, same name as v1

	DefaultTiFlashPortFlash       = 3930
	DefaultTiFlashPortProxy       = 20170
	DefaultTiFlashPortMetrics     = 8234
	DefaultTiFlashPortProxyStatus = 20292

	// DefaultTiFlashMinReadySeconds is default min ready seconds of tiflash
	DefaultTiFlashMinReadySeconds = 5
)
View Source
const (
	TiKVPortNameClient    = "client"
	TiKVPortNameStatus    = "status"
	DefaultTiKVPortClient = 20160
	DefaultTiKVPortStatus = 20180

	// DefaultTiKVMinReadySeconds is default min ready seconds of tikv
	DefaultTiKVMinReadySeconds = 5
)
View Source
const (
	// LeadersEvicted means all leaders are evicted
	//
	// condition
	TiKVCondLeadersEvicted = "LeadersEvicted"
	// reason
	ReasonNotEvicted     = "NotEvicted"
	ReasonEvicting       = "Evicting"
	ReasonEvicted        = "Evicted"
	ReasonStoreIsRemoved = "StoreIsRemoved"
)
View Source
const (

	// StoreStatePreparing means there are no regions on this store.
	// In this state, the store is ready to serve.
	StoreStatePreparing = "Preparing"
	// StoreStateServing means the number of regions reaches a certain proportion.
	// In this state, the store is ready to serve.
	StoreStateServing  = "Serving"
	StoreStateRemoving = "Removing"
	StoreStateRemoved  = "Removed"
)
View Source
const (
	TiKVWorkerPortNameAPI = "api"

	DefaultTiKVWorkerPortAPI = 19000

	// DefaultTiKVWorkerMinReadySeconds is default min ready seconds of tikv-worker
	DefaultTiKVWorkerMinReadySeconds = 10
)
View Source
const (
	TiProxyPortNameClient = "mysql-client"
	TiProxyPortNameAPI    = "api"
	TiProxyPortNamePeer   = "peer"

	DefaultTiProxyPortClient = 6000
	DefaultTiProxyPortAPI    = 3080
	DefaultTiProxyPortPeer   = 3081

	// DefaultTiProxyMinReadySeconds is default min ready seconds of tiproxy
	DefaultTiProxyMinReadySeconds = 10
)
View Source
const (
	TiProxyGroupCondAvailable   = "Available"
	TiProxyGroupAvailableReason = "TiProxyGroupAvailable"
)
View Source
const (
	TSOPortNameClient    = "client"
	DefaultTSOPortClient = 3379

	// DefaultTSOMinReadySeconds is default min ready seconds of tso
	DefaultTSOMinReadySeconds = 5
)
View Source
const (
	AnnoKeyInitialClusterNum = "pd.core.pingcap.com/initial-cluster-num"
)
View Source
const (
	// Keep compatible with the bootstrap sql in v1
	ConfigMapKeyBootstrapSQL = "bootstrap-sql"
)

All config map keys

View Source
const GroupName = "core.pingcap.com"

GroupName specifies the group name used to register the objects.

View Source
const (
	// PDCondInitialized means the operator detects that the PD instance has joined the cluster
	PDCondInitialized = "Initialized"
)
View Source
const (
	// This policy is defined to evenly spread all instances of a group
	// e.g. we may hope tikvs can evenly spread in 3 az
	SchedulePolicyTypeEvenlySpread = "EvenlySpread"
)
View Source
const (
	// StoreOfflinedConditionType represents if the store complete the offline.
	StoreOfflinedConditionType = "Offlined"
)

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// Deprecated: use Install instead
	AddToScheme = localSchemeBuilder.AddToScheme
	Install     = localSchemeBuilder.AddToScheme
)
View Source
var ErrFieldIsManagedByOperator = errors.New("field is managed by operator, cannot be set in config file")
View Source
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"}

GroupVersion specifies the group and the version used to register the objects.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects Deprecated: use GroupVersion instead.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CAReference

type CAReference struct {
	// +optional
	Name string `json:"name,omitempty"`
}

CAReference defines the reference to CA It may support secret and configmap, but now only secret is supported

func (*CAReference) DeepCopy

func (in *CAReference) DeepCopy() *CAReference

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

func (*CAReference) DeepCopyInto

func (in *CAReference) DeepCopyInto(out *CAReference)

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

type CertKeyPairReference

type CertKeyPairReference struct {
	// +optional
	Name string `json:"name,omitempty"`
}

CertKeyPairReference defines the secret reference to CertKeyPair

func (*CertKeyPairReference) DeepCopy

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

func (*CertKeyPairReference) DeepCopyInto

func (in *CertKeyPairReference) DeepCopyInto(out *CertKeyPairReference)

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

type ClientAuthType

type ClientAuthType string

ClientAuthType defines the auth type of the server. Now only two types are supported to check whether CA is needed. NOTE: A new type "RequireAndVerifyClientCert" may be introduced in the future to force mTLS. NOTE: It's not same as https://pkg.go.dev/crypto/tls#ClientAuthType

const (
	// NoCientCert means the server doesn't enable mtls. The CA can be omitted.
	ClientAuthTypeNoClientCert ClientAuthType = "NoClientCert"
	// VerifyClientCertIfNeed means the server needs CA to verify client certs.
	// However, the server may not verify client certs. It depends on the config of the server.
	// For example, TiDBs may not verify cert even if client auth type is VerifyClientCertIfNeed.
	ClientAuthTypeVerifyClientCertIfNeed ClientAuthType = "VerifyClientCertIfNeed"
)

type ClientTLS

type ClientTLS struct {
	// Enabled means whether enable tls
	Enabled bool `json:"enabled"`

	// Defaults to true
	// +kubebuilder:default=true
	// +optional
	Mutual bool `json:"mutual,omitempty"`

	// If true, we will skip CA verification, it means CA can be omitted
	// Defaults to false
	// +optional
	InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty"`

	// TLSSecret defines secret references for tls config
	TLSSecret `json:",inline"`
}

ClientTLS defines tls config for clients 1. No TLS: Enabled=false(CA and CertKeyPair are not needed) 2. No mTLS: Enabled=true,Mutual=false(CA is needed) 3. No mTLS and skip CA: Enabled=true,Mutual=false,InsecureSkipTLSVerify=true(CA and CertKeyPair are not needed) 4. mTLS: Enabled=true,Mutual=true(Both are needed) 5. mTLS and skip CA: Enabled=true,Mutual=true,InsecureSkipTLSVerify=true(CertKeyPair is needed)

func (*ClientTLS) DeepCopy

func (in *ClientTLS) DeepCopy() *ClientTLS

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

func (*ClientTLS) DeepCopyInto

func (in *ClientTLS) DeepCopyInto(out *ClientTLS)

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

type Cluster

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

	Spec   ClusterSpec   `json:"spec,omitempty"`
	Status ClusterStatus `json:"status,omitempty"`
}

Cluster defines a TiDB cluster +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 37",message="name must not exceed 37 characters"

func (*Cluster) DeepCopy

func (in *Cluster) DeepCopy() *Cluster

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

func (*Cluster) DeepCopyInto

func (in *Cluster) DeepCopyInto(out *Cluster)

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

func (*Cluster) DeepCopyObject

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

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

type ClusterList

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

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

ClusterList defines a list of TiDB clusters

func (*ClusterList) DeepCopy

func (in *ClusterList) DeepCopy() *ClusterList

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

func (*ClusterList) DeepCopyInto

func (in *ClusterList) DeepCopyInto(out *ClusterList)

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

func (*ClusterList) DeepCopyObject

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

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

type ClusterReference

type ClusterReference struct {
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="cluster name is immutable"
	// +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
	Name string `json:"name"`
}

ClusterReference is a reference to cluster NOTE: namespace may be added into the reference in the future

func (*ClusterReference) DeepCopy

func (in *ClusterReference) DeepCopy() *ClusterReference

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

func (*ClusterReference) DeepCopyInto

func (in *ClusterReference) DeepCopyInto(out *ClusterReference)

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

type ClusterSecurity

type ClusterSecurity struct {
	// TLS defines tls configs for the whole cluster
	TLS *ClusterTLSConfig `json:"tls,omitempty"`
	// SessionTokenSigningCertKeyPair is the name of the K8s secret, where stores certificates for signing the TiDB session token,
	// which is used by TiProxy for session migration.
	// You can generate certificates and create a secret by: kubectl create secret generic <secret-name> --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key>
	// Note: this field will only be used when the feature gate `SessionTokenSigning` is enabled.
	SessionTokenSigningCertKeyPair *corev1.LocalObjectReference `json:"sessionTokenSigningCertKeyPair,omitempty"`
}

func (*ClusterSecurity) DeepCopy

func (in *ClusterSecurity) DeepCopy() *ClusterSecurity

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

func (*ClusterSecurity) DeepCopyInto

func (in *ClusterSecurity) DeepCopyInto(out *ClusterSecurity)

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

type ClusterSpec

type ClusterSpec struct {
	// SuspendAction defines the suspend actions for the cluster.
	SuspendAction *SuspendAction `json:"suspendAction,omitempty"`

	// Whether enable the TLS connection between TiDB cluster components.
	TLSCluster *TLSCluster `json:"tlsCluster,omitempty"`

	// BootstrapSQL refers to a 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.
	// Only v6.5.1+ supports this feature.
	BootstrapSQL *corev1.LocalObjectReference `json:"bootstrapSQL,omitempty"`

	// UpgradePolicy defines the upgrade policy for the cluster.
	UpgradePolicy UpgradePolicy `json:"upgradePolicy,omitempty"`

	// Paused specifies whether to pause the reconciliation loop for all components of the cluster.
	Paused bool `json:"paused,omitempty"`

	// RevisionHistoryLimit is the maximum number of revisions that will
	// be maintained in each Group's revision history.
	// The revision history consists of all revisions not represented by a currently applied version.
	// The default value is 10.
	// +kubebuilder:validation:Minimum=0
	RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`

	// +kubebuilder:validation:XValidation:rule="oldSelf.exists(fg, fg.name == 'FeatureModification') || self.filter(fg, fg.name != 'FeatureModification') == oldSelf",message="can only enable FeatureModification if it's not enabled"
	// +kubebuilder:validation:XValidation:rule="self.exists(fg, fg.name == 'FeatureModification') || !oldSelf.exists(fg, fg.name == 'FeatureModification')",message="cannot disable FeatureModification"
	// +listType=map
	// +listMapKey=name
	FeatureGates []meta.FeatureGate `json:"featureGates,omitempty"`

	// CustomizedPDServiceName is the internal pd service name which will be created by the cluster.
	// If MultiPDGroup feature is not enabled, this field doesn't work.
	// If MultiPDGroup feature is enabled, the default service name is ${clusterName}-pd.
	// This field is useful to keep use legacy pd service name when enable MultiPDGroup.
	CustomizedPDServiceName *string `json:"customizedPDServiceName,omitempty"`

	// DNS defines the dns names used by components
	DNS *DNS `json:"dns,omitempty"`

	// Security defines the security config of the whole cluster
	Security *ClusterSecurity `json:"security,omitempty"`
}

ClusterSpec is the spec of the cluster. +kubebuilder:validation:XValidation:rule="oldSelf == null || !has(self.bootstrapSQL) || (has(oldSelf.bootstrapSQL) && self.bootstrapSQL.name == oldSelf.bootstrapSQL.name)",message="bootstrapSQL can only be set at creation, can be unset, but cannot be changed to a different value" +kubebuilder:validation:XValidation:rule="oldSelf == null || (has(oldSelf.tlsCluster) == has(self.tlsCluster)) && (!has(self.tlsCluster) || self.tlsCluster.enabled == oldSelf.tlsCluster.enabled)",message="tlsCluster is immutable"

func (*ClusterSpec) DeepCopy

func (in *ClusterSpec) DeepCopy() *ClusterSpec

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

func (*ClusterSpec) DeepCopyInto

func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec)

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

type ClusterStatus

type ClusterStatus struct {
	// observedGeneration is the most recent generation observed for this Cluster. It corresponds to the
	// Cluster's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`

	// Components is the status of each component in the cluster.
	// +patchMergeKey=kind
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=kind
	Components []ComponentStatus `json:"components,omitempty" patchStrategy:"merge" patchMergeKey:"kind" protobuf:"bytes,1,rep,name=components"`

	// Conditions contains the current status of the cluster.
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`

	// ID is the cluster id.
	ID string `json:"id"`

	// PD means url of the pd service, it's prepared for internal use
	// e.g. https://pd:2379
	PD string `json:"pd,omitempty"`

	// FeatureGates of this cluster
	// +listType=map
	// +listMapKey=name
	FeatureGates []meta.FeatureGateStatus `json:"featureGates,omitempty"`
}

func (*ClusterStatus) DeepCopy

func (in *ClusterStatus) DeepCopy() *ClusterStatus

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

func (*ClusterStatus) DeepCopyInto

func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus)

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

type ClusterTLSConfig

type ClusterTLSConfig struct {
	// Client defines the client tls for the tidb operator to visit components
	Client *InternalClientTLS `json:"client,omitempty"`
}

func (*ClusterTLSConfig) DeepCopy

func (in *ClusterTLSConfig) DeepCopy() *ClusterTLSConfig

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

func (*ClusterTLSConfig) DeepCopyInto

func (in *ClusterTLSConfig) DeepCopyInto(out *ClusterTLSConfig)

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

type CommonStatus

type CommonStatus struct {
	// Conditions contain details of the current state.
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// ObservedGeneration is the most recent generation observed by the controller.
	// It's used to determine whether the controller has reconciled the latest spec.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// CurrentRevision is the revision of the Controller that created the resource.
	CurrentRevision string `json:"currentRevision,omitempty"`

	// UpdateRevision is the revision of the Controller that should modify the resource.
	UpdateRevision string `json:"updateRevision,omitempty"`

	// CollisionCount is the count of hash collisions. The controller
	// uses this field as a collision avoidance mechanism when it needs to create the name for the
	// newest ControllerRevision.
	// +optional
	CollisionCount *int32 `json:"collisionCount,omitempty"`
}

CommonStatus defines common status fields for instances and groups managed by TiDB Operator.

func (*CommonStatus) DeepCopy

func (in *CommonStatus) DeepCopy() *CommonStatus

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

func (*CommonStatus) DeepCopyInto

func (in *CommonStatus) DeepCopyInto(out *CommonStatus)

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

type CompactorReference

type CompactorReference corev1.LocalObjectReference

func (*CompactorReference) DeepCopy

func (in *CompactorReference) DeepCopy() *CompactorReference

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

func (*CompactorReference) DeepCopyInto

func (in *CompactorReference) DeepCopyInto(out *CompactorReference)

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

type ComponentKind

type ComponentKind string
const (
	ComponentKindPD         ComponentKind = "PD"
	ComponentKindTiKV       ComponentKind = "TiKV"
	ComponentKindTiDB       ComponentKind = "TiDB"
	ComponentKindTiFlash    ComponentKind = "TiFlash"
	ComponentKindTiCDC      ComponentKind = "TiCDC"
	ComponentKindTiProxy    ComponentKind = "TiProxy"
	ComponentKindTiKVWorker ComponentKind = "TiKVWorker"
)

type ComponentStatus

type ComponentStatus struct {
	// Kind is the kind of the component, e.g., PD, TiKV, TiDB, TiFlash.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=PD;TiKV;TiDB;TiFlash;TiCDC;TiProxy;TiKVWorker
	Kind ComponentKind `json:"kind"`

	// Replicas is the number of desired replicas of the component.
	// +kubebuilder:validation:Required
	Replicas int32 `json:"replicas"`
}

ComponentStatus is the status of a component in the cluster.

func (*ComponentStatus) DeepCopy

func (in *ComponentStatus) DeepCopy() *ComponentStatus

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

func (*ComponentStatus) DeepCopyInto

func (in *ComponentStatus) DeepCopyInto(out *ComponentStatus)

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

type ComponentTLSConfig

type ComponentTLSConfig struct {
	Cluster *InternalTLS `json:"cluster,omitempty"`
}

ComponentTLSConfig defines the tls config of a component

func (*ComponentTLSConfig) DeepCopy

func (in *ComponentTLSConfig) DeepCopy() *ComponentTLSConfig

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

func (*ComponentTLSConfig) DeepCopyInto

func (in *ComponentTLSConfig) DeepCopyInto(out *ComponentTLSConfig)

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

type ConfigFile

type ConfigFile string

type ConfigUpdateStrategy

type ConfigUpdateStrategy string

ConfigUpdateStrategy represents the strategy to update configuration.

const (
	// ConfigUpdateStrategyHotReload updates config without restarting.
	ConfigUpdateStrategyHotReload ConfigUpdateStrategy = "HotReload"

	// ConfigUpdateStrategyRestart performs a restart to apply changed configs.
	ConfigUpdateStrategyRestart ConfigUpdateStrategy = "Restart"
)

type CoprocessorReference

type CoprocessorReference corev1.LocalObjectReference

func (*CoprocessorReference) DeepCopy

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

func (*CoprocessorReference) DeepCopyInto

func (in *CoprocessorReference) DeepCopyInto(out *CoprocessorReference)

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

type DNS

type DNS struct {
	// Mode is the dns mode, it determines the dns format used by the tidb cluster
	// +kubebuilder:default="InCluster"
	// +default="InCluster"
	Mode DNSMode `json:"mode"`

	// ClusterDomain is the domain suffix of the dns
	// It only works when the mode is FQDN
	// +kubebuilder:default="cluster.local"
	// +default="cluster.local"
	ClusterDomain string `json:"clusterDomain,omitempty"`
}

func (*DNS) DeepCopy

func (in *DNS) DeepCopy() *DNS

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

func (*DNS) DeepCopyInto

func (in *DNS) DeepCopyInto(out *DNS)

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

type DNSMode

type DNSMode string

DNSMode determines the dns format used by the tidb clusters. +kubebuilder:validation:Enum=FQDN;InCluster

const (
	// If mode is FQDN, all dns names will be in FQDN format,
	// like "*.${svc}.${ns}.svc.${clusterDomain}"
	DNSModeFQDN DNSMode = "FQDN"
	// This mode is the default mode,
	// the format is "*.${svc}.${ns}"
	// The cluster in this mode will produce many dns queries than other modes.
	DNSModeInCluster DNSMode = "InCluster"
)

type GroupStatus

type GroupStatus struct {
	// Version is the version of all instances in the group.
	// It will be same as the `spec.version` only when all instances are upgraded to the desired version.
	Version string `json:"version,omitempty"`

	// Selector is the label selector for scale subresource.
	Selector string `json:"selector"`

	// Replicas is the number of Instance created by the controller.
	Replicas int32 `json:"replicas"`

	// ReadyReplicas is the number of Instances created for this ComponentGroup with a Ready Condition.
	ReadyReplicas int32 `json:"readyReplicas"`

	// CurrentReplicas is the number of Instances created by the Group controller from the Group version
	// indicated by currentRevision.
	CurrentReplicas int32 `json:"currentReplicas"`

	// UpdatedReplicas is the number of Instances created by the Group controller from the Group version
	// indicated by updateRevision.
	UpdatedReplicas int32 `json:"updatedReplicas"`
}

GroupStatus defines the common status fields for all component groups.

func (*GroupStatus) DeepCopy

func (in *GroupStatus) DeepCopy() *GroupStatus

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

func (*GroupStatus) DeepCopyInto

func (in *GroupStatus) DeepCopyInto(out *GroupStatus)

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

type InternalClientTLS

type InternalClientTLS struct {
	// If true, we will skip CA verification, it means CA can be omitted
	// Defaults to false
	// +optional
	InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty"`
	// TLSSecret defines the secret references.
	// Now we have to ensure all client CAs(except tiproxy) are same because now all internal tls certs are for both client auth and server auth.
	// NOTE: if CN verification is specified in the config file, users should ensure that CN of this CertKeyPair is verfied.
	TLSSecret `json:",inline"`
}

InternalClientTLS defines the tls config for the tidb operator to visit components. Components may want to authenticate all clients by verifying their CN. NOTE: This secret have to be read by the tidb operator, it may be optimized in the future to avoid reading all secrets NOTE: Client cert rotation is not supported.

func (*InternalClientTLS) DeepCopy

func (in *InternalClientTLS) DeepCopy() *InternalClientTLS

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

func (*InternalClientTLS) DeepCopyInto

func (in *InternalClientTLS) DeepCopyInto(out *InternalClientTLS)

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

type InternalTLS

type InternalTLS struct {
	// TLSSecret defines the secret references.
	// Now we have to ensure all CAs are same because all internal
	// components use a same CA to authenticate all servers. (e.g. TiDB uses a same CA to visit PD and TiKV)
	TLSSecret `json:",inline"`
}

InternalTLS defines a tls config between components. This config of all components can only be enabled or disabled at the same time.

func (*InternalTLS) DeepCopy

func (in *InternalTLS) DeepCopy() *InternalTLS

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

func (*InternalTLS) DeepCopyInto

func (in *InternalTLS) DeepCopyInto(out *InternalTLS)

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

type NamedPersistentVolumeClaimOverlay

type NamedPersistentVolumeClaimOverlay struct {
	Name                  string                       `json:"name"`
	PersistentVolumeClaim PersistentVolumeClaimOverlay `json:"volumeClaim"`
}

func (*NamedPersistentVolumeClaimOverlay) DeepCopy

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

func (*NamedPersistentVolumeClaimOverlay) DeepCopyInto

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

type ObjectMeta

type ObjectMeta struct {
	// Name must be unique within a namespace. Is required when creating resources, although
	// some resources may allow a client to request the generation of an appropriate name
	// automatically. Name is primarily intended for creation idempotence and configuration
	// definition.
	// Cannot be updated.
	// More info: http://kubernetes.io/docs/user-guide/identifiers#names
	// +optional
	Name string `json:"name,omitempty"`
	// Map of string keys and values that can be used to organize and categorize
	// (scope and select) objects. May match selectors of replication controllers
	// and services.
	// More info: http://kubernetes.io/docs/user-guide/labels
	// +optional
	// +kubebuilder:validation:MaxProperties=512
	Labels map[string]string `json:"labels,omitempty"`

	// Annotations is an unstructured key value map stored with a resource that may be
	// set by external tools to store and retrieve arbitrary metadata. They are not
	// queryable and should be preserved when modifying objects.
	// More info: http://kubernetes.io/docs/user-guide/annotations
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
}

ObjectMeta is defined for replacing the embedded metav1.ObjectMeta Now only labels and annotations are allowed

func (*ObjectMeta) DeepCopy

func (in *ObjectMeta) DeepCopy() *ObjectMeta

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

func (*ObjectMeta) DeepCopyInto

func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta)

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

type Overlay

type Overlay struct {
	Pod *PodOverlay `json:"pod,omitempty"`
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	PersistentVolumeClaims []NamedPersistentVolumeClaimOverlay `json:"volumeClaims,omitempty"`
}

Overlay defines some templates of k8s native resources. Users can specify this field to overlay the spec of managed resources(pod, pvcs, ...).

func (*Overlay) DeepCopy

func (in *Overlay) DeepCopy() *Overlay

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

func (*Overlay) DeepCopyInto

func (in *Overlay) DeepCopyInto(out *Overlay)

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

type PD

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

	Spec   PDSpec   `json:"spec,omitempty"`
	Status PDStatus `json:"status,omitempty"`
}

PD defines a PD instance. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*PD) DeepCopy

func (in *PD) DeepCopy() *PD

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

func (*PD) DeepCopyInto

func (in *PD) DeepCopyInto(out *PD)

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

func (*PD) DeepCopyObject

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

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

type PDGroup

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

	Spec   PDGroupSpec   `json:"spec,omitempty"`
	Status PDGroupStatus `json:"status,omitempty"`
}

PDGroup defines a group of similar PD instances. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*PDGroup) DeepCopy

func (in *PDGroup) DeepCopy() *PDGroup

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

func (*PDGroup) DeepCopyInto

func (in *PDGroup) DeepCopyInto(out *PDGroup)

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

func (*PDGroup) DeepCopyObject

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

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

type PDGroupList

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

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

PDGroupList defines a list of PD groups

func (*PDGroupList) DeepCopy

func (in *PDGroupList) DeepCopy() *PDGroupList

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

func (*PDGroupList) DeepCopyInto

func (in *PDGroupList) DeepCopyInto(out *PDGroupList)

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

func (*PDGroupList) DeepCopyObject

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

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

type PDGroupSpec

type PDGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`

	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// Bootstrapped means that pd cluster has been bootstrapped,
	// and there is no need to initialize a new cluster.
	// In other words, this PD group will just join an existing cluster.
	// Normally, this field is automatically changed by operator.
	// If it's true, it cannot be set to false for security
	// +kubebuilder:validation:XValidation:rule="!oldSelf || self",message="bootstrapped cannot be changed from true to false"
	Bootstrapped bool `json:"bootstrapped,omitempty"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod
	// be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	Template PDTemplate `json:"template"`
}

PDGroupSpec describes the common attributes of a PDGroup +kubebuilder:validation:XValidation:rule="self.bootstrapped || (self.replicas == oldSelf.replicas)",message="replicas cannot be changed when bootstrapped is false"

func (*PDGroupSpec) DeepCopy

func (in *PDGroupSpec) DeepCopy() *PDGroupSpec

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

func (*PDGroupSpec) DeepCopyInto

func (in *PDGroupSpec) DeepCopyInto(out *PDGroupSpec)

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

type PDGroupStatus

type PDGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*PDGroupStatus) DeepCopy

func (in *PDGroupStatus) DeepCopy() *PDGroupStatus

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

func (*PDGroupStatus) DeepCopyInto

func (in *PDGroupStatus) DeepCopyInto(out *PDGroupStatus)

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

type PDList

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

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

PDList defines a list of PD instances

func (*PDList) DeepCopy

func (in *PDList) DeepCopy() *PDList

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

func (*PDList) DeepCopyInto

func (in *PDList) DeepCopyInto(out *PDList)

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

func (*PDList) DeepCopyObject

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

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

type PDMode

type PDMode string
const (
	// Normal mode of PD, all services are provided by a single component
	PDModeNormal PDMode = ""
	// Micro Service Mode of PD, some services(TSO,Scheduling) are separated from PD
	// See https://docs.pingcap.com/tidb/stable/pd-microservices/
	PDModeMS PDMode = "ms"
)

type PDPorts

type PDPorts struct {
	// Client defines port for pd's api service
	Client *Port `json:"client,omitempty"`
	// Peer defines port for peer communication
	Peer *Port `json:"peer,omitempty"`
}

func (*PDPorts) DeepCopy

func (in *PDPorts) DeepCopy() *PDPorts

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

func (*PDPorts) DeepCopyInto

func (in *PDPorts) DeepCopyInto(out *PDPorts)

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

type PDServer

type PDServer struct {
	// Ports defines all ports listened by pd
	Ports PDPorts `json:"ports,omitempty"`
}

func (*PDServer) DeepCopy

func (in *PDServer) DeepCopy() *PDServer

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

func (*PDServer) DeepCopyInto

func (in *PDServer) DeepCopyInto(out *PDServer)

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

type PDSpec

type PDSpec struct {
	// Cluster is a reference of tidb cluster
	Cluster ClusterReference `json:"cluster"`

	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// Topology defines the topology domain of this pd instance
	// It will be translated into a node affinity config
	// Topology cannot be changed
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`

	// Subdomain means the subdomain of the exported pd dns.
	// A same pd cluster will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// PDTemplateSpec embedded some fields managed by PDGroup
	PDTemplateSpec `json:",inline"`
}

PDSpec describes the common attributes of a PD instance +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

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 {
	CommonStatus `json:",inline"`

	// ID is the member id of this pd instance
	ID string `json:"id"`

	// IsLeader indicates whether this pd is the leader
	// NOTE: it's a snapshot from PD, not always up to date
	// TODO(liubo02): change to use condition
	IsLeader bool `json:"isLeader"`
}

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.

type PDTemplate

type PDTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       PDTemplateSpec `json:"spec"`
}

func (*PDTemplate) DeepCopy

func (in *PDTemplate) DeepCopy() *PDTemplate

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

func (*PDTemplate) DeepCopyInto

func (in *PDTemplate) DeepCopyInto(out *PDTemplate)

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

type PDTemplateSpec

type PDTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`
	// Image is pd's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/pd
	Image *string `json:"image,omitempty"`

	// Mode of pd, default is normal
	// Now it cannot be changed after creation. It may be supported in the future.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="pd mode is immutable now, it may be supported later"
	Mode PDMode `json:"mode,omitempty"`
	// Server defines server config for PD
	Server         PDServer             `json:"server,omitempty"`
	Resources      ResourceRequirements `json:"resources,omitempty"`
	UpdateStrategy UpdateStrategy       `json:"updateStrategy,omitempty"`

	// Config defines config file of PD
	Config ConfigFile `json:"config,omitempty"`

	// Security defines security config
	Security *Security `json:"security,omitempty"`

	// Volumes defines persistent volumes of PD
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes"`
	// Overlay defines a k8s native resource template patch
	// All resources(pod, pvcs, ...) managed by PD can be overlaid by this field
	Overlay *Overlay `json:"overlay,omitempty"`
}

PDTemplateSpec can only be specified in PDGroup TODO: It's name may need to be changed to distinguish from PodTemplateSpec +kubebuilder:validation:XValidation:rule="(!has(oldSelf.mode) && !has(self.mode)) || (has(oldSelf.mode) && has(self.mode))",fieldPath=".mode",message="pd mode can only be set when creating now" +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes" +kubebuilder:validation:XValidation:rule="has(self.volumes) && ('data' in self.volumes.map(v, v.name))",message="data volume must be configured"

func (*PDTemplateSpec) DeepCopy

func (in *PDTemplateSpec) DeepCopy() *PDTemplateSpec

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

func (*PDTemplateSpec) DeepCopyInto

func (in *PDTemplateSpec) DeepCopyInto(out *PDTemplateSpec)

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

type PersistentVolumeClaimOverlay

type PersistentVolumeClaimOverlay struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       *corev1.PersistentVolumeClaimSpec `json:"spec,omitempty"`
}

func (*PersistentVolumeClaimOverlay) DeepCopy

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

func (*PersistentVolumeClaimOverlay) DeepCopyInto

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

type PodOverlay

type PodOverlay struct {
	// +kubebuilder:validation:XValidation:rule="!has(self.labels) || self.labels.all(key, !key.startsWith('pingcap.com/'))",message="cannot overlay pod labels starting with 'pingcap.com/'"
	ObjectMeta `json:"metadata,omitempty"`
	Spec       *corev1.PodSpec `json:"spec,omitempty"`
}

func (*PodOverlay) DeepCopy

func (in *PodOverlay) DeepCopy() *PodOverlay

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

func (*PodOverlay) DeepCopyInto

func (in *PodOverlay) DeepCopyInto(out *PodOverlay)

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

type Port

type Port struct {
	Port int32 `json:"port"`
}

Port defines a listen port

func (*Port) DeepCopy

func (in *Port) DeepCopy() *Port

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

func (*Port) DeepCopyInto

func (in *Port) DeepCopyInto(out *Port)

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

type ResourceManager

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

	Spec   ResourceManagerSpec   `json:"spec,omitempty"`
	Status ResourceManagerStatus `json:"status,omitempty"`
}

ResourceManager defines a ResourceManager instance +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*ResourceManager) DeepCopy

func (in *ResourceManager) DeepCopy() *ResourceManager

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

func (*ResourceManager) DeepCopyInto

func (in *ResourceManager) DeepCopyInto(out *ResourceManager)

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

func (*ResourceManager) DeepCopyObject

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

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

type ResourceManagerGroup

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

	Spec   ResourceManagerGroupSpec   `json:"spec,omitempty"`
	Status ResourceManagerGroupStatus `json:"status,omitempty"`
}

ResourceManagerGroup defines a group of similar ResourceManager instances +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*ResourceManagerGroup) DeepCopy

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

func (*ResourceManagerGroup) DeepCopyInto

func (in *ResourceManagerGroup) DeepCopyInto(out *ResourceManagerGroup)

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

func (*ResourceManagerGroup) DeepCopyObject

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

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

type ResourceManagerGroupList

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

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

ResourceManagerGroupList defines a list of ResourceManager groups

func (*ResourceManagerGroupList) DeepCopy

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

func (*ResourceManagerGroupList) DeepCopyInto

func (in *ResourceManagerGroupList) DeepCopyInto(out *ResourceManagerGroupList)

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

func (*ResourceManagerGroupList) DeepCopyObject

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

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

type ResourceManagerGroupSpec

type ResourceManagerGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	Template ResourceManagerTemplate `json:"template"`
}

func (*ResourceManagerGroupSpec) DeepCopy

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

func (*ResourceManagerGroupSpec) DeepCopyInto

func (in *ResourceManagerGroupSpec) DeepCopyInto(out *ResourceManagerGroupSpec)

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

type ResourceManagerGroupStatus

type ResourceManagerGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*ResourceManagerGroupStatus) DeepCopy

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

func (*ResourceManagerGroupStatus) DeepCopyInto

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

type ResourceManagerList

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

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

ResourceManagerList defines a list of ResourceManager instances

func (*ResourceManagerList) DeepCopy

func (in *ResourceManagerList) DeepCopy() *ResourceManagerList

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

func (*ResourceManagerList) DeepCopyInto

func (in *ResourceManagerList) DeepCopyInto(out *ResourceManagerList)

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

func (*ResourceManagerList) DeepCopyObject

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

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

type ResourceManagerPorts

type ResourceManagerPorts struct {
	// Client defines port for ResourceManager's api service
	Client *Port `json:"client,omitempty"`
}

func (*ResourceManagerPorts) DeepCopy

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

func (*ResourceManagerPorts) DeepCopyInto

func (in *ResourceManagerPorts) DeepCopyInto(out *ResourceManagerPorts)

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

type ResourceManagerServer

type ResourceManagerServer struct {
	// Ports defines all ports listened by ResourceManager
	Ports ResourceManagerPorts `json:"ports,omitempty"`
}

func (*ResourceManagerServer) DeepCopy

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

func (*ResourceManagerServer) DeepCopyInto

func (in *ResourceManagerServer) DeepCopyInto(out *ResourceManagerServer)

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

type ResourceManagerSpec

type ResourceManagerSpec struct {
	// Cluster is a reference of tidb cluster
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// Topology defines the topology domain of this ResourceManager instance
	// It will be translated into a node affinity config
	// Topology cannot be changed
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`

	// Subdomain means the subdomain of the exported ResourceManager dns.
	// A same ResourceManager cluster will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// ResourceManagerTemplateSpec embedded some fields managed by ResourceManagerGroup
	ResourceManagerTemplateSpec `json:",inline"`
}

func (*ResourceManagerSpec) DeepCopy

func (in *ResourceManagerSpec) DeepCopy() *ResourceManagerSpec

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

func (*ResourceManagerSpec) DeepCopyInto

func (in *ResourceManagerSpec) DeepCopyInto(out *ResourceManagerSpec)

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

type ResourceManagerStatus

type ResourceManagerStatus struct {
	CommonStatus `json:",inline"`
}

func (*ResourceManagerStatus) DeepCopy

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

func (*ResourceManagerStatus) DeepCopyInto

func (in *ResourceManagerStatus) DeepCopyInto(out *ResourceManagerStatus)

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

type ResourceManagerTemplate

type ResourceManagerTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       ResourceManagerTemplateSpec `json:"spec"`
}

func (*ResourceManagerTemplate) DeepCopy

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

func (*ResourceManagerTemplate) DeepCopyInto

func (in *ResourceManagerTemplate) DeepCopyInto(out *ResourceManagerTemplate)

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

type ResourceManagerTemplateSpec

type ResourceManagerTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`

	// Image is pd's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/pd
	Image *string `json:"image,omitempty"`

	// Server defines server config for ResourceManager
	Server ResourceManagerServer `json:"server,omitempty"`

	Resources ResourceRequirements `json:"resources,omitempty"`

	UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

	// Config defines config file of ResourceManager
	Config ConfigFile `json:"config,omitempty"`

	// Security defines security config
	Security *Security `json:"security,omitempty"`

	// Volumes defines persistent volumes of ResourceManager
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes,omitempty"`

	// Overlay defines a k8s native resource template patch
	// All resources(pod, pvcs, ...) managed by ResourceManager can be overlayed by this field
	Overlay *Overlay `json:"overlay,omitempty"`
}

func (*ResourceManagerTemplateSpec) DeepCopy

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

func (*ResourceManagerTemplateSpec) DeepCopyInto

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

type ResourceRequirements

type ResourceRequirements struct {
	CPU    *resource.Quantity `json:"cpu,omitempty"`
	Memory *resource.Quantity `json:"memory,omitempty"`
}

ResourceRequirements describes the compute resource requirements. It's simplified from corev1.ResourceRequirements to fit the most common use cases. This field will be translated to requests=limits for all resources. If users need to specify more advanced resource requirements, just try to use overlay to override it

func (*ResourceRequirements) DeepCopy

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

func (*ResourceRequirements) DeepCopyInto

func (in *ResourceRequirements) DeepCopyInto(out *ResourceRequirements)

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

type Router

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

	Spec   RouterSpec   `json:"spec,omitempty"`
	Status RouterStatus `json:"status,omitempty"`
}

Router defines a Router instance +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*Router) DeepCopy

func (in *Router) DeepCopy() *Router

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

func (*Router) DeepCopyInto

func (in *Router) DeepCopyInto(out *Router)

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

func (*Router) DeepCopyObject

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

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

type RouterGroup

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

	Spec   RouterGroupSpec   `json:"spec,omitempty"`
	Status RouterGroupStatus `json:"status,omitempty"`
}

RouterGroup defines a group of similar Router instances +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*RouterGroup) DeepCopy

func (in *RouterGroup) DeepCopy() *RouterGroup

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

func (*RouterGroup) DeepCopyInto

func (in *RouterGroup) DeepCopyInto(out *RouterGroup)

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

func (*RouterGroup) DeepCopyObject

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

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

type RouterGroupList

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

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

RouterGroupList defines a list of Router groups

func (*RouterGroupList) DeepCopy

func (in *RouterGroupList) DeepCopy() *RouterGroupList

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

func (*RouterGroupList) DeepCopyInto

func (in *RouterGroupList) DeepCopyInto(out *RouterGroupList)

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

func (*RouterGroupList) DeepCopyObject

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

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

type RouterGroupSpec

type RouterGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	Template RouterTemplate `json:"template"`
}

RouterGroupSpec describes the common attributes of a RouterGroup

func (*RouterGroupSpec) DeepCopy

func (in *RouterGroupSpec) DeepCopy() *RouterGroupSpec

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

func (*RouterGroupSpec) DeepCopyInto

func (in *RouterGroupSpec) DeepCopyInto(out *RouterGroupSpec)

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

type RouterGroupStatus

type RouterGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*RouterGroupStatus) DeepCopy

func (in *RouterGroupStatus) DeepCopy() *RouterGroupStatus

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

func (*RouterGroupStatus) DeepCopyInto

func (in *RouterGroupStatus) DeepCopyInto(out *RouterGroupStatus)

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

type RouterList

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

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

RouterList defines a list of Router instances

func (*RouterList) DeepCopy

func (in *RouterList) DeepCopy() *RouterList

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

func (*RouterList) DeepCopyInto

func (in *RouterList) DeepCopyInto(out *RouterList)

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

func (*RouterList) DeepCopyObject

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

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

type RouterPorts

type RouterPorts struct {
	// Client defines port for Router's api service
	Client *Port `json:"client,omitempty"`
}

func (*RouterPorts) DeepCopy

func (in *RouterPorts) DeepCopy() *RouterPorts

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

func (*RouterPorts) DeepCopyInto

func (in *RouterPorts) DeepCopyInto(out *RouterPorts)

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

type RouterServer

type RouterServer struct {
	// Ports defines all ports listened by Router
	Ports RouterPorts `json:"ports,omitempty"`
}

func (*RouterServer) DeepCopy

func (in *RouterServer) DeepCopy() *RouterServer

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

func (*RouterServer) DeepCopyInto

func (in *RouterServer) DeepCopyInto(out *RouterServer)

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

type RouterSpec

type RouterSpec struct {
	// Cluster is a reference of tidb cluster
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// Topology defines the topology domain of this Router instance
	// It will be translated into a node affinity config
	// Topology cannot be changed
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`

	// Subdomain means the subdomain of the exported Router dns.
	// A same Router cluster will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// RouterTemplateSpec embedded some fields managed by RouterGroup
	RouterTemplateSpec `json:",inline"`
}

RouterSpec describes the common attributes of a Router instance +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

func (*RouterSpec) DeepCopy

func (in *RouterSpec) DeepCopy() *RouterSpec

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

func (*RouterSpec) DeepCopyInto

func (in *RouterSpec) DeepCopyInto(out *RouterSpec)

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

type RouterStatus

type RouterStatus struct {
	CommonStatus `json:",inline"`
}

func (*RouterStatus) DeepCopy

func (in *RouterStatus) DeepCopy() *RouterStatus

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

func (*RouterStatus) DeepCopyInto

func (in *RouterStatus) DeepCopyInto(out *RouterStatus)

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

type RouterTemplate

type RouterTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       RouterTemplateSpec `json:"spec"`
}

func (*RouterTemplate) DeepCopy

func (in *RouterTemplate) DeepCopy() *RouterTemplate

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

func (*RouterTemplate) DeepCopyInto

func (in *RouterTemplate) DeepCopyInto(out *RouterTemplate)

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

type RouterTemplateSpec

type RouterTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`

	// Image is pd's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/pd
	Image *string `json:"image,omitempty"`

	// Server defines server config for Router
	Server RouterServer `json:"server,omitempty"`

	Resources ResourceRequirements `json:"resources,omitempty"`

	UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

	// Config defines config file of Router
	Config ConfigFile `json:"config,omitempty"`

	// Security defines security config
	Security *Security `json:"security,omitempty"`

	// Volumes defines persistent volumes of Router
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes,omitempty"`

	// Overlay defines a k8s native resource template patch
	// All resources(pod, pvcs, ...) managed by Router can be overlayed by this field
	Overlay *Overlay `json:"overlay,omitempty"`
}

RouterTemplateSpec can only be specified in RouterGroup TODO: It's name may need to be changed to distinguish from PodTemplateSpec +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes"

func (*RouterTemplateSpec) DeepCopy

func (in *RouterTemplateSpec) DeepCopy() *RouterTemplateSpec

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

func (*RouterTemplateSpec) DeepCopyInto

func (in *RouterTemplateSpec) DeepCopyInto(out *RouterTemplateSpec)

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

type SEM

type SEM struct {
	// Config defines the configmap reference of the sem config
	// By default, we use the 'sem.json' as the file key of configmap
	Config corev1.LocalObjectReference `json:"config"`
}

func (*SEM) DeepCopy

func (in *SEM) DeepCopy() *SEM

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

func (*SEM) DeepCopyInto

func (in *SEM) DeepCopyInto(out *SEM)

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

type SchedulePolicy

type SchedulePolicy struct {
	Type         SchedulePolicyType          `json:"type"`
	EvenlySpread *SchedulePolicyEvenlySpread `json:"evenlySpread,omitempty"`
}

SchedulePolicy defines how instances of the group schedules its pod.

func (*SchedulePolicy) DeepCopy

func (in *SchedulePolicy) DeepCopy() *SchedulePolicy

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

func (*SchedulePolicy) DeepCopyInto

func (in *SchedulePolicy) DeepCopyInto(out *SchedulePolicy)

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

type SchedulePolicyEvenlySpread

type SchedulePolicyEvenlySpread struct {
	// All instances of a group will evenly spread in different topologies
	Topologies []ScheduleTopology `json:"topologies"`
}

func (*SchedulePolicyEvenlySpread) DeepCopy

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

func (*SchedulePolicyEvenlySpread) DeepCopyInto

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

type SchedulePolicyType

type SchedulePolicyType string

type ScheduleTopology

type ScheduleTopology struct {
	// Topology means the topo for scheduling
	Topology Topology `json:"topology"`
	// Weight defines how many pods will be scheduled to this topo
	// default is 1
	// +kubebuilder:validation:Minimum=1
	Weight *int32 `json:"weight,omitempty"`
}

func (*ScheduleTopology) DeepCopy

func (in *ScheduleTopology) DeepCopy() *ScheduleTopology

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

func (*ScheduleTopology) DeepCopyInto

func (in *ScheduleTopology) DeepCopyInto(out *ScheduleTopology)

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

type Scheduler

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

	Spec   SchedulerSpec   `json:"spec,omitempty"`
	Status SchedulerStatus `json:"status,omitempty"`
}

Scheduler defines a Scheduler instance Deprecated: use Scheduling +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*Scheduler) DeepCopy

func (in *Scheduler) DeepCopy() *Scheduler

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

func (*Scheduler) DeepCopyInto

func (in *Scheduler) DeepCopyInto(out *Scheduler)

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

func (*Scheduler) DeepCopyObject

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

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

type SchedulerGroup

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

	Spec   SchedulerGroupSpec   `json:"spec,omitempty"`
	Status SchedulerGroupStatus `json:"status,omitempty"`
}

SchedulerGroup defines a group of similar Scheduler instances Deprecated: use SchedulingGroup +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*SchedulerGroup) DeepCopy

func (in *SchedulerGroup) DeepCopy() *SchedulerGroup

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

func (*SchedulerGroup) DeepCopyInto

func (in *SchedulerGroup) DeepCopyInto(out *SchedulerGroup)

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

func (*SchedulerGroup) DeepCopyObject

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

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

type SchedulerGroupList

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

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

SchedulerGroupList defines a list of Scheduler groups Deprecated: use SchedulingGroupList

func (*SchedulerGroupList) DeepCopy

func (in *SchedulerGroupList) DeepCopy() *SchedulerGroupList

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

func (*SchedulerGroupList) DeepCopyInto

func (in *SchedulerGroupList) DeepCopyInto(out *SchedulerGroupList)

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

func (*SchedulerGroupList) DeepCopyObject

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

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

type SchedulerGroupSpec

type SchedulerGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	Template SchedulerTemplate `json:"template"`
}

SchedulerGroupSpec describes the common attributes of a SchedulerGroup Deprecated: use SchedulingGroupSpec

func (*SchedulerGroupSpec) DeepCopy

func (in *SchedulerGroupSpec) DeepCopy() *SchedulerGroupSpec

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

func (*SchedulerGroupSpec) DeepCopyInto

func (in *SchedulerGroupSpec) DeepCopyInto(out *SchedulerGroupSpec)

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

type SchedulerGroupStatus deprecated

type SchedulerGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

Deprecated: use SchedulingGroupStatus

func (*SchedulerGroupStatus) DeepCopy

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

func (*SchedulerGroupStatus) DeepCopyInto

func (in *SchedulerGroupStatus) DeepCopyInto(out *SchedulerGroupStatus)

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

type SchedulerList

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

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

SchedulerList defines a list of Scheduler instances Deprecated: use SchedulingList

func (*SchedulerList) DeepCopy

func (in *SchedulerList) DeepCopy() *SchedulerList

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

func (*SchedulerList) DeepCopyInto

func (in *SchedulerList) DeepCopyInto(out *SchedulerList)

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

func (*SchedulerList) DeepCopyObject

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

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

type SchedulerPorts deprecated

type SchedulerPorts struct {
	// Client defines port for Scheduler's api service
	Client *Port `json:"client,omitempty"`
}

Deprecated: use SchedulingPorts

func (*SchedulerPorts) DeepCopy

func (in *SchedulerPorts) DeepCopy() *SchedulerPorts

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

func (*SchedulerPorts) DeepCopyInto

func (in *SchedulerPorts) DeepCopyInto(out *SchedulerPorts)

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

type SchedulerServer deprecated

type SchedulerServer struct {
	// Ports defines all ports listened by Scheduler
	Ports SchedulerPorts `json:"ports,omitempty"`
}

Deprecated: use SchedulingServer

func (*SchedulerServer) DeepCopy

func (in *SchedulerServer) DeepCopy() *SchedulerServer

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

func (*SchedulerServer) DeepCopyInto

func (in *SchedulerServer) DeepCopyInto(out *SchedulerServer)

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

type SchedulerSpec

type SchedulerSpec struct {
	// Cluster is a reference of tidb cluster
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// Topology defines the topology domain of this Scheduler instance
	// It will be translated into a node affinity config
	// Topology cannot be changed
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`

	// Subdomain means the subdomain of the exported Scheduler dns.
	// A same Scheduler cluster will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// SchedulerTemplateSpec embedded some fields managed by SchedulerGroup
	SchedulerTemplateSpec `json:",inline"`
}

SchedulerSpec describes the common attributes of a Scheduler instance Deprecated: use SchedulingSpec +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

func (*SchedulerSpec) DeepCopy

func (in *SchedulerSpec) DeepCopy() *SchedulerSpec

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

func (*SchedulerSpec) DeepCopyInto

func (in *SchedulerSpec) DeepCopyInto(out *SchedulerSpec)

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

type SchedulerStatus deprecated

type SchedulerStatus struct {
	CommonStatus `json:",inline"`
}

Deprecated: use SchedulingStatus

func (*SchedulerStatus) DeepCopy

func (in *SchedulerStatus) DeepCopy() *SchedulerStatus

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

func (*SchedulerStatus) DeepCopyInto

func (in *SchedulerStatus) DeepCopyInto(out *SchedulerStatus)

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

type SchedulerTemplate

type SchedulerTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       SchedulerTemplateSpec `json:"spec"`
}

SchedulerTemplate defines template of Scheduler Deprecated: use SchedulingTemplate

func (*SchedulerTemplate) DeepCopy

func (in *SchedulerTemplate) DeepCopy() *SchedulerTemplate

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

func (*SchedulerTemplate) DeepCopyInto

func (in *SchedulerTemplate) DeepCopyInto(out *SchedulerTemplate)

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

type SchedulerTemplateSpec

type SchedulerTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`

	// Image is scheduler's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/pd
	Image *string `json:"image,omitempty"`

	// Server defines server config for Scheduler
	Server SchedulerServer `json:"server,omitempty"`

	Resources ResourceRequirements `json:"resources,omitempty"`

	UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

	// Config defines config file of Scheduler
	// See https://docs.pingcap.com/tidb/stable/scheduling-configuration-file/
	Config ConfigFile `json:"config,omitempty"`

	// Security defines security config
	Security *Security `json:"security,omitempty"`

	// Volumes defines persistent volumes of Scheduler
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes,omitempty"`

	// Overlay defines a k8s native resource template patch
	// All resources(pod, pvcs, ...) managed by Scheduler can be overlayed by this field
	Overlay *Overlay `json:"overlay,omitempty"`
}

SchedulerTemplateSpec can only be specified in SchedulerGroup Deprecated: use SchedulingTemplateSpec +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes"

func (*SchedulerTemplateSpec) DeepCopy

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

func (*SchedulerTemplateSpec) DeepCopyInto

func (in *SchedulerTemplateSpec) DeepCopyInto(out *SchedulerTemplateSpec)

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

type Scheduling

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

	Spec   SchedulingSpec   `json:"spec,omitempty"`
	Status SchedulingStatus `json:"status,omitempty"`
}

Scheduling defines a Scheduling instance +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*Scheduling) DeepCopy

func (in *Scheduling) DeepCopy() *Scheduling

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

func (*Scheduling) DeepCopyInto

func (in *Scheduling) DeepCopyInto(out *Scheduling)

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

func (*Scheduling) DeepCopyObject

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

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

type SchedulingGroup

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

	Spec   SchedulingGroupSpec   `json:"spec,omitempty"`
	Status SchedulingGroupStatus `json:"status,omitempty"`
}

SchedulingGroup defines a group of similar Scheduling instances +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*SchedulingGroup) DeepCopy

func (in *SchedulingGroup) DeepCopy() *SchedulingGroup

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

func (*SchedulingGroup) DeepCopyInto

func (in *SchedulingGroup) DeepCopyInto(out *SchedulingGroup)

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

func (*SchedulingGroup) DeepCopyObject

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

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

type SchedulingGroupList

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

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

SchedulingGroupList defines a list of Scheduling groups

func (*SchedulingGroupList) DeepCopy

func (in *SchedulingGroupList) DeepCopy() *SchedulingGroupList

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

func (*SchedulingGroupList) DeepCopyInto

func (in *SchedulingGroupList) DeepCopyInto(out *SchedulingGroupList)

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

func (*SchedulingGroupList) DeepCopyObject

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

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

type SchedulingGroupSpec

type SchedulingGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	Template SchedulingTemplate `json:"template"`
}

SchedulingGroupSpec describes the common attributes of a SchedulingGroup

func (*SchedulingGroupSpec) DeepCopy

func (in *SchedulingGroupSpec) DeepCopy() *SchedulingGroupSpec

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

func (*SchedulingGroupSpec) DeepCopyInto

func (in *SchedulingGroupSpec) DeepCopyInto(out *SchedulingGroupSpec)

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

type SchedulingGroupStatus

type SchedulingGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*SchedulingGroupStatus) DeepCopy

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

func (*SchedulingGroupStatus) DeepCopyInto

func (in *SchedulingGroupStatus) DeepCopyInto(out *SchedulingGroupStatus)

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

type SchedulingList

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

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

SchedulingList defines a list of Scheduling instances

func (*SchedulingList) DeepCopy

func (in *SchedulingList) DeepCopy() *SchedulingList

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

func (*SchedulingList) DeepCopyInto

func (in *SchedulingList) DeepCopyInto(out *SchedulingList)

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

func (*SchedulingList) DeepCopyObject

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

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

type SchedulingPorts

type SchedulingPorts struct {
	// Client defines port for Scheduling's api service
	Client *Port `json:"client,omitempty"`
}

func (*SchedulingPorts) DeepCopy

func (in *SchedulingPorts) DeepCopy() *SchedulingPorts

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

func (*SchedulingPorts) DeepCopyInto

func (in *SchedulingPorts) DeepCopyInto(out *SchedulingPorts)

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

type SchedulingServer

type SchedulingServer struct {
	// Ports defines all ports listened by Scheduling
	Ports SchedulingPorts `json:"ports,omitempty"`
}

func (*SchedulingServer) DeepCopy

func (in *SchedulingServer) DeepCopy() *SchedulingServer

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

func (*SchedulingServer) DeepCopyInto

func (in *SchedulingServer) DeepCopyInto(out *SchedulingServer)

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

type SchedulingSpec

type SchedulingSpec struct {
	// Cluster is a reference of tidb cluster
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// Topology defines the topology domain of this Scheduling instance
	// It will be translated into a node affinity config
	// Topology cannot be changed
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`

	// Subdomain means the subdomain of the exported Scheduling dns.
	// A same Scheduling cluster will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// SchedulingTemplateSpec embedded some fields managed by SchedulingGroup
	SchedulingTemplateSpec `json:",inline"`
}

SchedulingSpec describes the common attributes of a Scheduling instance +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

func (*SchedulingSpec) DeepCopy

func (in *SchedulingSpec) DeepCopy() *SchedulingSpec

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

func (*SchedulingSpec) DeepCopyInto

func (in *SchedulingSpec) DeepCopyInto(out *SchedulingSpec)

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

type SchedulingStatus

type SchedulingStatus struct {
	CommonStatus `json:",inline"`
}

func (*SchedulingStatus) DeepCopy

func (in *SchedulingStatus) DeepCopy() *SchedulingStatus

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

func (*SchedulingStatus) DeepCopyInto

func (in *SchedulingStatus) DeepCopyInto(out *SchedulingStatus)

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

type SchedulingTemplate

type SchedulingTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       SchedulingTemplateSpec `json:"spec"`
}

func (*SchedulingTemplate) DeepCopy

func (in *SchedulingTemplate) DeepCopy() *SchedulingTemplate

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

func (*SchedulingTemplate) DeepCopyInto

func (in *SchedulingTemplate) DeepCopyInto(out *SchedulingTemplate)

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

type SchedulingTemplateSpec

type SchedulingTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`

	// Image is pd's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/pd
	Image *string `json:"image,omitempty"`

	// Server defines server config for Scheduling
	Server SchedulingServer `json:"server,omitempty"`

	Resources ResourceRequirements `json:"resources,omitempty"`

	UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

	// Config defines config file of Scheduling
	// See https://docs.pingcap.com/tidb/stable/scheduling-configuration-file/
	Config ConfigFile `json:"config,omitempty"`

	// Security defines security config
	Security *Security `json:"security,omitempty"`

	// Volumes defines persistent volumes of Scheduling
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes,omitempty"`

	// Overlay defines a k8s native resource template patch
	// All resources(pod, pvcs, ...) managed by Scheduling can be overlayed by this field
	Overlay *Overlay `json:"overlay,omitempty"`
}

SchedulingTemplateSpec can only be specified in SchedulingGroup TODO: It's name may need to be changed to distinguish from PodTemplateSpec +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes"

func (*SchedulingTemplateSpec) DeepCopy

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

func (*SchedulingTemplateSpec) DeepCopyInto

func (in *SchedulingTemplateSpec) DeepCopyInto(out *SchedulingTemplateSpec)

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

type Security

type Security struct {
	// TLS defines the tls configs of components
	TLS *ComponentTLSConfig `json:"tls,omitempty"`
}

Security defines the security config of a component

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 StoreStatus

type StoreStatus struct {
	// ID is the store id.
	ID string `json:"id,omitempty"`

	// State is the store state.
	State string `json:"state,omitempty"`
}

StoreStatus defines the common status fields for all stores.

func (*StoreStatus) DeepCopy

func (in *StoreStatus) DeepCopy() *StoreStatus

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

func (*StoreStatus) DeepCopyInto

func (in *StoreStatus) DeepCopyInto(out *StoreStatus)

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

type SuspendAction

type SuspendAction struct {
	// SuspendCompute indicates delete the pods but keep the PVCs.
	SuspendCompute bool `json:"suspendCompute,omitempty"`
}

func (*SuspendAction) DeepCopy

func (in *SuspendAction) DeepCopy() *SuspendAction

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

func (*SuspendAction) DeepCopyInto

func (in *SuspendAction) DeepCopyInto(out *SuspendAction)

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

type TLS

type TLS struct {
	// Enabled means whether enable tls
	Enabled bool `json:"enabled"`

	// Defaults to VerifyClientCertIfNeed
	// +optional
	ClientAuth ClientAuthType `json:"clientAuth,omitempty"`

	// TLSSecret defines secret references for tls config
	TLSSecret `json:",inline"`
}

TLS defines the tls config of a server which can be disabled or enabled 1. No TLS: Enabled=false(CA and CertKeyPair are not needed) 2. No mTLS: Enabled=true,ClientAuth=NoCientCert(CA is not needed) 3. mTLS: Enabled=true,ClientAuth=VerifyClientCertIfNeed(Both are needed)

func (*TLS) DeepCopy

func (in *TLS) DeepCopy() *TLS

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

func (*TLS) DeepCopyInto

func (in *TLS) DeepCopyInto(out *TLS)

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://docs.pingcap.com/tidb/stable/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 group which contains the certificates created above.
	//      The name of this Secret must be: <groupName>-<componentName>-cluster-secret.
	//        For PD: kubectl create secret generic <groupName>-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 <groupName>-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 <groupName>-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 TiBR: kubectl create secret generic <tibrName>-tibr-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 TiBRGC: kubectl create secret generic <tibrgcName>-tibrgc-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 is used to enable mutual TLS connection between TiDB cluster components. https://docs.pingcap.com/tidb/stable/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 TLSSecret

type TLSSecret struct {
	// CA defines the ref of the secret which contains ca.crt
	// +optional
	CA *CAReference `json:"ca,omitempty"`
	// CertKeyPair defines the ref of the secret which contains tls.crt and tls.key
	// +optional
	CertKeyPair *CertKeyPairReference `json:"certKeyPair,omitempty"`
}

TLSSecret defines the secret references. CA and CertKeyPair should be allowed to be stored in different secrets so that we can use cert-manager(trust-manager) to rotate CAs. For compatibility, we keep the default behavior: - For Internal TLS: defaults to <groupName>-<componentName>-cluster-secret - For Internal Client TLS, defaults to <clusterName>-cluster-client-secret: - For TiDB MySQL TLS: defaults to <groupName>-tidb-server-secret - For TiProxy MySQL TLS: defaults to <groupName>-tiproxy-server-secret - For TiProxy backend TLS: defaults to <groupName>-tiproxy-tidb-secret

func (*TLSSecret) DeepCopy

func (in *TLSSecret) DeepCopy() *TLSSecret

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

func (*TLSSecret) DeepCopyInto

func (in *TLSSecret) DeepCopyInto(out *TLSSecret)

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

type TSO

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

	Spec   TSOSpec   `json:"spec,omitempty"`
	Status TSOStatus `json:"status,omitempty"`
}

TSO defines a TSO instance. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*TSO) DeepCopy

func (in *TSO) DeepCopy() *TSO

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

func (*TSO) DeepCopyInto

func (in *TSO) DeepCopyInto(out *TSO)

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

func (*TSO) DeepCopyObject

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

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

type TSOGroup

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

	Spec   TSOGroupSpec   `json:"spec,omitempty"`
	Status TSOGroupStatus `json:"status,omitempty"`
}

TSOGroup defines a group of similar TSO instances. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*TSOGroup) DeepCopy

func (in *TSOGroup) DeepCopy() *TSOGroup

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

func (*TSOGroup) DeepCopyInto

func (in *TSOGroup) DeepCopyInto(out *TSOGroup)

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

func (*TSOGroup) DeepCopyObject

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

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

type TSOGroupList

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

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

TSOGroupList defines a list of TSO groups

func (*TSOGroupList) DeepCopy

func (in *TSOGroupList) DeepCopy() *TSOGroupList

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

func (*TSOGroupList) DeepCopyInto

func (in *TSOGroupList) DeepCopyInto(out *TSOGroupList)

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

func (*TSOGroupList) DeepCopyObject

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

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

type TSOGroupSpec

type TSOGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`
	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	Template TSOTemplate `json:"template"`
}

TSOGroupSpec describes the common attributes of a TSOGroup.

func (*TSOGroupSpec) DeepCopy

func (in *TSOGroupSpec) DeepCopy() *TSOGroupSpec

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

func (*TSOGroupSpec) DeepCopyInto

func (in *TSOGroupSpec) DeepCopyInto(out *TSOGroupSpec)

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

type TSOGroupStatus

type TSOGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*TSOGroupStatus) DeepCopy

func (in *TSOGroupStatus) DeepCopy() *TSOGroupStatus

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

func (*TSOGroupStatus) DeepCopyInto

func (in *TSOGroupStatus) DeepCopyInto(out *TSOGroupStatus)

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

type TSOList

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

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

TSOList defines a list of TSO instances

func (*TSOList) DeepCopy

func (in *TSOList) DeepCopy() *TSOList

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

func (*TSOList) DeepCopyInto

func (in *TSOList) DeepCopyInto(out *TSOList)

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

func (*TSOList) DeepCopyObject

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

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

type TSOPorts

type TSOPorts struct {
	// Client defines port for tso's api service
	Client *Port `json:"client,omitempty"`
}

func (*TSOPorts) DeepCopy

func (in *TSOPorts) DeepCopy() *TSOPorts

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

func (*TSOPorts) DeepCopyInto

func (in *TSOPorts) DeepCopyInto(out *TSOPorts)

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

type TSOServer

type TSOServer struct {
	// Ports defines all ports listened by tso
	Ports TSOPorts `json:"ports,omitempty"`
}

func (*TSOServer) DeepCopy

func (in *TSOServer) DeepCopy() *TSOServer

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

func (*TSOServer) DeepCopyInto

func (in *TSOServer) DeepCopyInto(out *TSOServer)

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

type TSOSpec

type TSOSpec struct {
	// Cluster is a reference of tidb cluster
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// Topology defines the topology domain of this tso instance
	// It will be translated into a node affinity config
	// Topology cannot be changed
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`

	// Subdomain means the subdomain of the exported tso dns.
	// A same tso cluster will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// TSOTemplateSpec embedded some fields managed by TSOGroup
	TSOTemplateSpec `json:",inline"`
}

TSOSpec describes the common attributes of a TSO instance +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

func (*TSOSpec) DeepCopy

func (in *TSOSpec) DeepCopy() *TSOSpec

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

func (*TSOSpec) DeepCopyInto

func (in *TSOSpec) DeepCopyInto(out *TSOSpec)

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

type TSOStatus

type TSOStatus struct {
	CommonStatus `json:",inline"`

	// IsDefaultPrimary indicates whether this TSO instance is the primary for the default keyspace group.
	IsDefaultPrimary bool `json:"isDefaultPrimary"`
}

func (*TSOStatus) DeepCopy

func (in *TSOStatus) DeepCopy() *TSOStatus

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

func (*TSOStatus) DeepCopyInto

func (in *TSOStatus) DeepCopyInto(out *TSOStatus)

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

type TSOTemplate

type TSOTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       TSOTemplateSpec `json:"spec"`
}

func (*TSOTemplate) DeepCopy

func (in *TSOTemplate) DeepCopy() *TSOTemplate

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

func (*TSOTemplate) DeepCopyInto

func (in *TSOTemplate) DeepCopyInto(out *TSOTemplate)

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

type TSOTemplateSpec

type TSOTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`

	// Image is pd's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/pd
	Image *string `json:"image,omitempty"`

	// Server defines server config for TSO
	Server TSOServer `json:"server,omitempty"`

	Resources ResourceRequirements `json:"resources,omitempty"`

	// Config defines config file of TSO
	// See https://docs.pingcap.com/tidb/stable/tso-configuration-file/
	Config         ConfigFile     `json:"config,omitempty"`
	UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

	// Security defines security config
	Security *Security `json:"security,omitempty"`

	// Volumes defines persistent volumes of TSO
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes,omitempty"`

	// Overlay defines a k8s native resource template patch
	// All resources(pod, pvcs, ...) managed by TSO can be overlayed by this field
	Overlay *Overlay `json:"overlay,omitempty"`
}

TSOTemplateSpec can only be specified in TSOGroup TODO: It's name may need to be changed to distinguish from PodTemplateSpec +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes"

func (*TSOTemplateSpec) DeepCopy

func (in *TSOTemplateSpec) DeepCopy() *TSOTemplateSpec

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

func (*TSOTemplateSpec) DeepCopyInto

func (in *TSOTemplateSpec) DeepCopyInto(out *TSOTemplateSpec)

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

type TiCDC

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

	Spec   TiCDCSpec   `json:"spec,omitempty"`
	Status TiCDCStatus `json:"status,omitempty"`
}

TiCDC defines a TiCDC instance +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*TiCDC) DeepCopy

func (in *TiCDC) DeepCopy() *TiCDC

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

func (*TiCDC) DeepCopyInto

func (in *TiCDC) DeepCopyInto(out *TiCDC)

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

func (*TiCDC) DeepCopyObject

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

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

type TiCDCGroup

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

	Spec   TiCDCGroupSpec   `json:"spec,omitempty"`
	Status TiCDCGroupStatus `json:"status,omitempty"`
}

TiCDCGroup defines a group of similar TiCDC instances. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*TiCDCGroup) DeepCopy

func (in *TiCDCGroup) DeepCopy() *TiCDCGroup

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

func (*TiCDCGroup) DeepCopyInto

func (in *TiCDCGroup) DeepCopyInto(out *TiCDCGroup)

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

func (*TiCDCGroup) DeepCopyObject

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

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

type TiCDCGroupList

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

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

TiCDCGroupList defines a list of TiCDC groups

func (*TiCDCGroupList) DeepCopy

func (in *TiCDCGroupList) DeepCopy() *TiCDCGroupList

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

func (*TiCDCGroupList) DeepCopyInto

func (in *TiCDCGroupList) DeepCopyInto(out *TiCDCGroupList)

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

func (*TiCDCGroupList) DeepCopyObject

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

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

type TiCDCGroupSpec

type TiCDCGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	Template TiCDCTemplate `json:"template"`
}

TiCDCGroupSpec describes the common attributes of a TiCDCGroup

func (*TiCDCGroupSpec) DeepCopy

func (in *TiCDCGroupSpec) DeepCopy() *TiCDCGroupSpec

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

func (*TiCDCGroupSpec) DeepCopyInto

func (in *TiCDCGroupSpec) DeepCopyInto(out *TiCDCGroupSpec)

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

type TiCDCGroupStatus

type TiCDCGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*TiCDCGroupStatus) DeepCopy

func (in *TiCDCGroupStatus) DeepCopy() *TiCDCGroupStatus

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

func (*TiCDCGroupStatus) DeepCopyInto

func (in *TiCDCGroupStatus) DeepCopyInto(out *TiCDCGroupStatus)

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

type TiCDCList

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

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

TiCDCList defines a list of TiCDC instances

func (*TiCDCList) DeepCopy

func (in *TiCDCList) DeepCopy() *TiCDCList

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

func (*TiCDCList) DeepCopyInto

func (in *TiCDCList) DeepCopyInto(out *TiCDCList)

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

func (*TiCDCList) DeepCopyObject

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

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

type TiCDCPorts

type TiCDCPorts struct {
	// Port defines main port for TiCDC.
	Port *Port `json:"port,omitempty"`
}

func (*TiCDCPorts) DeepCopy

func (in *TiCDCPorts) DeepCopy() *TiCDCPorts

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

func (*TiCDCPorts) DeepCopyInto

func (in *TiCDCPorts) DeepCopyInto(out *TiCDCPorts)

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

type TiCDCPreStop

type TiCDCPreStop struct {
	// Image of pre stop checker
	// Default is pingcap/prestop-checker:latest
	Image *string `json:"image,omitempty"`
}

func (*TiCDCPreStop) DeepCopy

func (in *TiCDCPreStop) DeepCopy() *TiCDCPreStop

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

func (*TiCDCPreStop) DeepCopyInto

func (in *TiCDCPreStop) DeepCopyInto(out *TiCDCPreStop)

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

type TiCDCServer

type TiCDCServer struct {
	// Ports defines all ports listened by TiCDC
	Ports TiCDCPorts `json:"ports,omitempty"`
}

func (*TiCDCServer) DeepCopy

func (in *TiCDCServer) DeepCopy() *TiCDCServer

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

func (*TiCDCServer) DeepCopyInto

func (in *TiCDCServer) DeepCopyInto(out *TiCDCServer)

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

type TiCDCSpec

type TiCDCSpec struct {
	// Cluster is a reference of tidb cluster
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// Topology defines the topology domain of this TiCDC instance
	// It will be translated into a node affinity config
	// Topology cannot be changed
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`

	// Subdomain means the subdomain of the exported TiCDC DNS.
	// A same TiCDC cluster will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// TiCDCTemplateSpec embedded some fields managed by TiCDCGroup
	TiCDCTemplateSpec `json:",inline"`
}

TiCDCSpec describes the common attributes of a TiCDC instance +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

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 {
	CommonStatus `json:",inline"`

	// ID is the member id of this TiCDC instance
	ID string `json:"id"`

	// should we need to save IsOwner in status?
	// but this value may be changed when scaling in or rolling update
	// TODO(liubo02): change to use condition
	IsOwner bool `json:"isOwner"`
}

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.

type TiCDCSyncer

type TiCDCSyncer struct {
	// Image of resource syncer
	// Default is pingcap/tidb-operator-resource-syncer
	Image *string `json:"image,omitempty"`

	// Additional labels to select.
	// Only resources with these labels will be synced into pods
	// - pingcap.com/managed-by: tidb-operator
	// - pingcap.com/component: ticdc
	// - pingcap.com/cluster: ${cluster}
	// - additional labels
	Labels map[string]string `json:"labels,omitempty"`
}

func (*TiCDCSyncer) DeepCopy

func (in *TiCDCSyncer) DeepCopy() *TiCDCSyncer

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

func (*TiCDCSyncer) DeepCopyInto

func (in *TiCDCSyncer) DeepCopyInto(out *TiCDCSyncer)

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

type TiCDCTemplate

type TiCDCTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       TiCDCTemplateSpec `json:"spec"`
}

func (*TiCDCTemplate) DeepCopy

func (in *TiCDCTemplate) DeepCopy() *TiCDCTemplate

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

func (*TiCDCTemplate) DeepCopyInto

func (in *TiCDCTemplate) DeepCopyInto(out *TiCDCTemplate)

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

type TiCDCTemplateSpec

type TiCDCTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`
	// Image is TiCDC's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/ticdc
	Image *string `json:"image,omitempty"`
	// Server defines server config for TiCDC
	Server         TiCDCServer          `json:"server,omitempty"`
	Resources      ResourceRequirements `json:"resources,omitempty"`
	UpdateStrategy UpdateStrategy       `json:"updateStrategy,omitempty"`
	// Config defines config file of TiCDC
	Config ConfigFile `json:"config,omitempty"`

	// Security defines security config
	Security *Security `json:"security,omitempty"`

	// Volumes defines persistent volumes of TiCDC, it is optional.
	// If you want to use ephemeral storage or mount sink TLS certs, you can use "overlay" instead.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes,omitempty"`
	// Overlay defines a k8s native resource template patch
	// All resources(pod, pvcs, ...) managed by TiCDC can be overlayed by this field
	Overlay *Overlay `json:"overlay,omitempty"`

	// PreStop defines preStop config
	PreStop *TiCDCPreStop `json:"preStop,omitempty"`

	// Syncer defines syncer config
	Syncer *TiCDCSyncer `json:"syncer,omitempty"`
}

TiCDCTemplateSpec can only be specified in TiCDCGroup +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes"

func (*TiCDCTemplateSpec) DeepCopy

func (in *TiCDCTemplateSpec) DeepCopy() *TiCDCTemplateSpec

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

func (*TiCDCTemplateSpec) DeepCopyInto

func (in *TiCDCTemplateSpec) DeepCopyInto(out *TiCDCTemplateSpec)

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

type TiDB

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

	Spec   TiDBSpec   `json:"spec,omitempty"`
	Status TiDBStatus `json:"status,omitempty"`
}

TiDB defines a TiDB instance. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*TiDB) DeepCopy

func (in *TiDB) DeepCopy() *TiDB

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

func (*TiDB) DeepCopyInto

func (in *TiDB) DeepCopyInto(out *TiDB)

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

func (*TiDB) DeepCopyObject

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

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

type TiDBAuthToken

type TiDBAuthToken struct {
	// Secret name of jwks
	JWKs corev1.LocalObjectReference `json:"jwks"`
}

func (*TiDBAuthToken) DeepCopy

func (in *TiDBAuthToken) DeepCopy() *TiDBAuthToken

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

func (*TiDBAuthToken) DeepCopyInto

func (in *TiDBAuthToken) DeepCopyInto(out *TiDBAuthToken)

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

type TiDBGroup

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

	Spec   TiDBGroupSpec   `json:"spec,omitempty"`
	Status TiDBGroupStatus `json:"status,omitempty"`
}

TiDBGroup defines a group of similar TiDB instances. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*TiDBGroup) DeepCopy

func (in *TiDBGroup) DeepCopy() *TiDBGroup

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

func (*TiDBGroup) DeepCopyInto

func (in *TiDBGroup) DeepCopyInto(out *TiDBGroup)

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

func (*TiDBGroup) DeepCopyObject

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

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

type TiDBGroupList

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

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

TiDBGroupList defines a list of TiDB groups

func (*TiDBGroupList) DeepCopy

func (in *TiDBGroupList) DeepCopy() *TiDBGroupList

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

func (*TiDBGroupList) DeepCopyInto

func (in *TiDBGroupList) DeepCopyInto(out *TiDBGroupList)

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

func (*TiDBGroupList) DeepCopyObject

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

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

type TiDBGroupSpec

type TiDBGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`

	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	// MaxSurge specifies the maximum number of additional instances that may be created during rolling restart.
	// It only takes effect when the update requires restarting TiDB instances.
	// Defaults to 1.
	// +kubebuilder:validation:Minimum=1
	// +optional
	MaxSurge *int32 `json:"maxSurge,omitempty"`

	// Template is the instance template
	Template TiDBTemplate `json:"template"`
}

TiDBGroupSpec describes the common attributes of a TiDBGroup.

func (*TiDBGroupSpec) DeepCopy

func (in *TiDBGroupSpec) DeepCopy() *TiDBGroupSpec

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

func (*TiDBGroupSpec) DeepCopyInto

func (in *TiDBGroupSpec) DeepCopyInto(out *TiDBGroupSpec)

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

type TiDBGroupStatus

type TiDBGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*TiDBGroupStatus) DeepCopy

func (in *TiDBGroupStatus) DeepCopy() *TiDBGroupStatus

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

func (*TiDBGroupStatus) DeepCopyInto

func (in *TiDBGroupStatus) DeepCopyInto(out *TiDBGroupStatus)

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

type TiDBList

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

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

TiDBList defines a list of TiDB instances.

func (*TiDBList) DeepCopy

func (in *TiDBList) DeepCopy() *TiDBList

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

func (*TiDBList) DeepCopyInto

func (in *TiDBList) DeepCopyInto(out *TiDBList)

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

func (*TiDBList) DeepCopyObject

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

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

type TiDBMode

type TiDBMode string

TiDBMode defines the mode of a TiDB instance +kubebuilder:validation:Enum=Normal;StandBy

const (
	// TiDBModeNormal means the tidb is in the default normal mode
	TiDBModeNormal TiDBMode = "Normal"
	// TiDBModeStandBy means the tidb is waiting for activating
	TiDBModeStandBy TiDBMode = "StandBy"
)

type TiDBPorts

type TiDBPorts struct {
	// Client defines port for TiDB's SQL service.
	Client *Port `json:"client,omitempty"`
	// Status defines port for TiDB status API.
	Status *Port `json:"status,omitempty"`
}

func (*TiDBPorts) DeepCopy

func (in *TiDBPorts) DeepCopy() *TiDBPorts

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

func (*TiDBPorts) DeepCopyInto

func (in *TiDBPorts) DeepCopyInto(out *TiDBPorts)

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

type TiDBPreStop

type TiDBPreStop struct {
	// SleepSeconds is the seconds to sleep before sending the SIGTERM to the tidb container.
	// It's useful to achieve a graceful shutdown of the tidb container.
	// Operator will calculate the tidb pod's `terminationGracePeriod` based on this field:
	// `terminationGracePeriod` = `preStopHookSleepSeconds` + 15(gracefulCloseConnectionsTimeout) + 5(buffer)
	// Default is 10 seconds.
	SleepSeconds int32 `json:"sleepSeconds,omitempty"`
}

func (*TiDBPreStop) DeepCopy

func (in *TiDBPreStop) DeepCopy() *TiDBPreStop

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

func (*TiDBPreStop) DeepCopyInto

func (in *TiDBPreStop) DeepCopyInto(out *TiDBPreStop)

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

type TiDBProb

type TiDBProb struct {
	// "tcp" will use TCP socket to connect component port.
	// "command" will probe the status api of tidb.
	// +kubebuilder:validation:Enum=tcp;command
	Type *string `json:"type,omitempty"`
}

func (*TiDBProb) DeepCopy

func (in *TiDBProb) DeepCopy() *TiDBProb

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

func (*TiDBProb) DeepCopyInto

func (in *TiDBProb) DeepCopyInto(out *TiDBProb)

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

type TiDBProbes

type TiDBProbes struct {
	// Readiness defines the readiness probe for TiDB.
	// The default handler is a TCP socket on the client port.
	Readiness *TiDBProb `json:"readiness,omitempty"`
}

func (*TiDBProbes) DeepCopy

func (in *TiDBProbes) DeepCopy() *TiDBProbes

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

func (*TiDBProbes) DeepCopyInto

func (in *TiDBProbes) DeepCopyInto(out *TiDBProbes)

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

type TiDBSecurity

type TiDBSecurity struct {
	// TLS defines the tls configs of TiDB
	TLS *TiDBTLSConfig `json:"tls,omitempty"`

	// Whether enable `tidb_auth_token` authentication method.
	// To enable this feature, a secret named `<groupName>-tidb-auth-token-jwks-secret` must be created to store the JWKs.
	// ref: https://docs.pingcap.com/tidb/stable/security-compatibility-with-mysql#tidb_auth_token
	// Defaults to false.
	AuthToken *TiDBAuthToken `json:"authToken,omitempty"`

	// SEM defines the security enhancement mode config of TiDB
	// If this field is set, security.enable-sem = true will be set automatically
	// Users still can disable sem in config file explicitly
	SEM *SEM `json:"sem,omitempty"`
}

func (*TiDBSecurity) DeepCopy

func (in *TiDBSecurity) DeepCopy() *TiDBSecurity

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

func (*TiDBSecurity) DeepCopyInto

func (in *TiDBSecurity) DeepCopyInto(out *TiDBSecurity)

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

type TiDBServer

type TiDBServer struct {
	// Port defines all ports listened by TiDB.
	Ports TiDBPorts `json:"ports,omitempty"`

	// Labels defines the server labels of the TiDB server.
	// Operator will set these `labels` by API.
	// If a label in this field is conflict with the config file, this field takes precedence.
	// NOTE: Different from other components, TiDB will replace all labels but not only add/update.
	// NOTE: these label keys are managed by TiDB Operator, it will be set automatically and you can not modify them:
	//  - host
	//  - region
	//  - zone
	// +kubebuilder:validation:XValidation:rule="!('host' in self) && !('region' in self) && !('zone' in self)",message="labels cannot contain 'host', 'region', or 'zone' keys"
	Labels map[string]string `json:"labels,omitempty"`
}

func (*TiDBServer) DeepCopy

func (in *TiDBServer) DeepCopy() *TiDBServer

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

func (*TiDBServer) DeepCopyInto

func (in *TiDBServer) DeepCopyInto(out *TiDBServer)

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

type TiDBSlowLog

type TiDBSlowLog struct {
	// Image to tail slowlog to stdout
	// Default is busybox:1.37.0
	Image *string `json:"image,omitempty"`

	// ResourceRequirements defines the resource requirements for the slow log sidecar.
	Resources ResourceRequirements `json:"resources,omitempty"`
}

func (*TiDBSlowLog) DeepCopy

func (in *TiDBSlowLog) DeepCopy() *TiDBSlowLog

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

func (*TiDBSlowLog) DeepCopyInto

func (in *TiDBSlowLog) DeepCopyInto(out *TiDBSlowLog)

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

type TiDBSpec

type TiDBSpec struct {
	Cluster ClusterReference `json:"cluster"`

	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// Topology defines the topology domain of this TiDB instance.
	// It will be translated into a node affnity config.
	// Topology cannot be changed.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`

	// Subdomain means the subdomain of the exported TiDB dns.
	// A same TiDB cluster will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// TiDBTemplateSpec embedded some fields managed by TiDBGroup.
	// +kubebuilder:validation:XValidation:rule="!has(self.mode) || self.mode == 'Normal' || !has(self.keyspace) || self.keyspace.size() == 0",message="keyspace cannot be set if mode is StandBy"
	TiDBTemplateSpec `json:",inline"`
}

TiDBSpec is the spec of a TiDB instance +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

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.

type TiDBStatus

type TiDBStatus struct {
	CommonStatus `json:",inline"`
}

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.

type TiDBTLSConfig

type TiDBTLSConfig struct {
	// When enabled, TiDB will accept TLS encrypted connections from MySQL clients.
	// 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://docs.pingcap.com/tidb/stable/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 a K8s Secret object which contains the TiDB server-side certificate created above.
	//      The name of this Secret must be: <groupName>-tidb-server-secret.
	//        kubectl create secret generic <groupName>-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: <groupName>-tidb-client-secret.
	//        kubectl create secret generic <groupName>-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`.
	// +kubebuilder:validation:XValidation:rule="oldSelf == null || self.enabled == oldSelf.enabled",message="field .mysql.enabled is immutable"
	MySQL *TLS `json:"mysql,omitempty"`

	// ComponentTLSConfig is tls config to access internal components
	ComponentTLSConfig `json:",inline"`
}

func (*TiDBTLSConfig) DeepCopy

func (in *TiDBTLSConfig) DeepCopy() *TiDBTLSConfig

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

func (*TiDBTLSConfig) DeepCopyInto

func (in *TiDBTLSConfig) DeepCopyInto(out *TiDBTLSConfig)

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

type TiDBTemplate

type TiDBTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       TiDBTemplateSpec `json:"spec"`
}

func (*TiDBTemplate) DeepCopy

func (in *TiDBTemplate) DeepCopy() *TiDBTemplate

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

func (*TiDBTemplate) DeepCopyInto

func (in *TiDBTemplate) DeepCopyInto(out *TiDBTemplate)

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

type TiDBTemplateSpec

type TiDBTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`

	// Image is tidb's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/tidb
	Image *string `json:"image,omitempty"`

	// Server defines the server configuration of TiDB.
	Server TiDBServer `json:"server,omitempty"`

	// Probes defines probes for TiDB.
	Probes TiDBProbes `json:"probes,omitempty"`

	// Resources defines resource required by TiDB.
	Resources ResourceRequirements `json:"resources,omitempty"`

	// Config defines config file of TiDB.
	Config ConfigFile `json:"config,omitempty"`

	// UpdateStrategy defines strategy when some fields are updated
	UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

	// Security defines security configs of TiDB
	Security *TiDBSecurity `json:"security,omitempty"`

	// Volumes defines data volume of TiDB, it is optional.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes,omitempty"`

	// Keyspace defines the keyspace name of a TiDB instance
	// Keyspace can only be set when mode is changed from StandBy to Normal
	// If mode is Normal, it cannot be changed again
	// For classic tidb, keyspace name is not supported and should not be set
	Keyspace string `json:"keyspace,omitempty"`

	// Mode defines the mode of a TiDB instance
	// +kubebuilder:default="Normal"
	Mode TiDBMode `json:"mode,omitempty"`

	// SlowLog defines the separate slow log configuration for TiDB.
	// When enabled, a sidecar container will be created to output the slow log to its stdout.
	SlowLog *TiDBSlowLog `json:"slowLog,omitempty"`

	// PreStop defines the preStop config for the tidb container.
	PreStop *TiDBPreStop `json:"preStop,omitempty"`

	// Overlay defines a k8s native resource template patch.
	// All resources(pod, pvcs, ...) managed by TiDB can be overlayed by this field.
	Overlay *Overlay `json:"overlay,omitempty"`
}

TiDBTemplateSpec can only be specified in TiDBGroup. +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes"

func (*TiDBTemplateSpec) DeepCopy

func (in *TiDBTemplateSpec) DeepCopy() *TiDBTemplateSpec

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

func (*TiDBTemplateSpec) DeepCopyInto

func (in *TiDBTemplateSpec) DeepCopyInto(out *TiDBTemplateSpec)

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

type TiFlash

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

	Spec   TiFlashSpec   `json:"spec,omitempty"`
	Status TiFlashStatus `json:"status,omitempty"`
}

TiFlash defines a TiFlash instance. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*TiFlash) DeepCopy

func (in *TiFlash) DeepCopy() *TiFlash

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

func (*TiFlash) DeepCopyInto

func (in *TiFlash) DeepCopyInto(out *TiFlash)

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

func (*TiFlash) DeepCopyObject

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

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

type TiFlashGroup

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

	Spec   TiFlashGroupSpec   `json:"spec,omitempty"`
	Status TiFlashGroupStatus `json:"status,omitempty"`
}

TiFlashGroup defines a group of similar TiFlash instances +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*TiFlashGroup) DeepCopy

func (in *TiFlashGroup) DeepCopy() *TiFlashGroup

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

func (*TiFlashGroup) DeepCopyInto

func (in *TiFlashGroup) DeepCopyInto(out *TiFlashGroup)

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

func (*TiFlashGroup) DeepCopyObject

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

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

type TiFlashGroupList

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

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

TiFlashGroupList defines a list of TiFlash groups

func (*TiFlashGroupList) DeepCopy

func (in *TiFlashGroupList) DeepCopy() *TiFlashGroupList

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

func (*TiFlashGroupList) DeepCopyInto

func (in *TiFlashGroupList) DeepCopyInto(out *TiFlashGroupList)

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

func (*TiFlashGroupList) DeepCopyObject

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

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

type TiFlashGroupSpec

type TiFlashGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`
	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	// Template defines tiflash instance template
	Template TiFlashTemplate `json:"template"`
}

func (*TiFlashGroupSpec) DeepCopy

func (in *TiFlashGroupSpec) DeepCopy() *TiFlashGroupSpec

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

func (*TiFlashGroupSpec) DeepCopyInto

func (in *TiFlashGroupSpec) DeepCopyInto(out *TiFlashGroupSpec)

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

type TiFlashGroupStatus

type TiFlashGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*TiFlashGroupStatus) DeepCopy

func (in *TiFlashGroupStatus) DeepCopy() *TiFlashGroupStatus

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

func (*TiFlashGroupStatus) DeepCopyInto

func (in *TiFlashGroupStatus) DeepCopyInto(out *TiFlashGroupStatus)

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

type TiFlashList

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

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

TiFlashList defines a list of TiFlash instances.

func (*TiFlashList) DeepCopy

func (in *TiFlashList) DeepCopy() *TiFlashList

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

func (*TiFlashList) DeepCopyInto

func (in *TiFlashList) DeepCopyInto(out *TiFlashList)

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

func (*TiFlashList) DeepCopyObject

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

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

type TiFlashLogTailer

type TiFlashLogTailer struct {
	// Image to tail log to stdout
	// Default is busybox:1.37.0
	Image *string `json:"image,omitempty"`

	// ResourceRequirements defines the resource requirements for the log sidecar.
	Resources ResourceRequirements `json:"resources,omitempty"`
}

func (*TiFlashLogTailer) DeepCopy

func (in *TiFlashLogTailer) DeepCopy() *TiFlashLogTailer

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

func (*TiFlashLogTailer) DeepCopyInto

func (in *TiFlashLogTailer) DeepCopyInto(out *TiFlashLogTailer)

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

type TiFlashPorts

type TiFlashPorts struct {
	Flash   *Port `json:"flash,omitempty"`
	Metrics *Port `json:"metrics,omitempty"`

	Proxy       *Port `json:"proxy,omitempty"`
	ProxyStatus *Port `json:"proxyStatus,omitempty"`
}

func (*TiFlashPorts) DeepCopy

func (in *TiFlashPorts) DeepCopy() *TiFlashPorts

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

func (*TiFlashPorts) DeepCopyInto

func (in *TiFlashPorts) DeepCopyInto(out *TiFlashPorts)

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

type TiFlashServer

type TiFlashServer struct {
	// Ports defines all ports listened by tiflash
	Ports TiFlashPorts `json:"ports,omitempty"`

	// Labels defines the server labels of the TiFlash server.
	// Operator will set these `labels` by API.
	// If a label in this field is conflict with the config file, this field takes precedence.
	// NOTE: If a label is removed, operator will not delete it automatically.
	// NOTE: these label keys are managed by TiDB Operator, it will be set automatically and you can not modify them:
	//  - host
	//  - region
	//  - zone
	// +kubebuilder:validation:XValidation:rule="!('host' in self) && !('region' in self) && !('zone' in self)",message="labels cannot contain 'host', 'region', or 'zone' keys"
	Labels map[string]string `json:"labels,omitempty"`
}

func (*TiFlashServer) DeepCopy

func (in *TiFlashServer) DeepCopy() *TiFlashServer

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

func (*TiFlashServer) DeepCopyInto

func (in *TiFlashServer) DeepCopyInto(out *TiFlashServer)

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

type TiFlashSpec

type TiFlashSpec struct {
	// Cluster is a reference of tidb cluster
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`
	// Topology defines the topology domain of this pd instance
	// It will be translated into a node affinity config
	// Topology cannot be changed
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`
	// Subdomain means the subdomain of the exported TiFlash dns.
	// A same TiFlash group will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// Offline marks the store as offline in PD to begin data migration.
	// When true, the store will be marked as offline in PD.
	// When false, the store will be marked as online in PD (if possible).
	// +optional
	Offline *bool `json:"offline,omitempty"`

	// TiFlashTemplateSpec embedded some fields managed by TiFlashGroup
	TiFlashTemplateSpec `json:",inline"`
}

+kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

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.

type TiFlashStatus

type TiFlashStatus struct {
	CommonStatus `json:",inline"`
	StoreStatus  `json:",inline"`
}

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.

type TiFlashTemplate

type TiFlashTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       TiFlashTemplateSpec `json:"spec"`
}

func (*TiFlashTemplate) DeepCopy

func (in *TiFlashTemplate) DeepCopy() *TiFlashTemplate

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

func (*TiFlashTemplate) DeepCopyInto

func (in *TiFlashTemplate) DeepCopyInto(out *TiFlashTemplate)

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

type TiFlashTemplateSpec

type TiFlashTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`
	// Image is tiflash's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/tiflash
	Image *string `json:"image,omitempty"`
	// Server defines the server config of TiFlash
	Server TiFlashServer `json:"server,omitempty"`
	// Resources defines resource required by TiFlash
	Resources ResourceRequirements `json:"resources,omitempty"`

	// Config defines config file of TiFlash
	Config ConfigFile `json:"config,omitempty"`

	UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

	// ProxyConfig defines config file of TiFlash proxy
	ProxyConfig ConfigFile `json:"proxyConfig,omitempty"`

	// Security defines security config
	Security *Security `json:"security,omitempty"`

	// Volumes defines data volume of TiFlash
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes"`

	// LogTailer defines the sidercar log tailer config of TiFlash.
	// We always use sidecar to tail the log of TiFlash now.
	LogTailer *TiFlashLogTailer `json:"logTailer,omitempty"`

	// Overlay defines a k8s native resource template patch
	// All resources(pod, pvcs, ...) managed by TiFlash can be overlayed by this field
	Overlay *Overlay `json:"overlay,omitempty"`
}

+kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes" +kubebuilder:validation:XValidation:rule="has(self.volumes) && ('data' in self.volumes.map(v, v.name))",message="data volume must be configured"

func (*TiFlashTemplateSpec) DeepCopy

func (in *TiFlashTemplateSpec) DeepCopy() *TiFlashTemplateSpec

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

func (*TiFlashTemplateSpec) DeepCopyInto

func (in *TiFlashTemplateSpec) DeepCopyInto(out *TiFlashTemplateSpec)

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

type TiKV

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

	Spec   TiKVSpec   `json:"spec,omitempty"`
	Status TiKVStatus `json:"status,omitempty"`
}

TiKV defines a TiKV instance. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*TiKV) DeepCopy

func (in *TiKV) DeepCopy() *TiKV

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

func (*TiKV) DeepCopyInto

func (in *TiKV) DeepCopyInto(out *TiKV)

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

func (*TiKV) DeepCopyObject

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

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

type TiKVGroup

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

	Spec   TiKVGroupSpec   `json:"spec,omitempty"`
	Status TiKVGroupStatus `json:"status,omitempty"`
}

TiKVGroup defines a group of similar TiKV instances. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*TiKVGroup) DeepCopy

func (in *TiKVGroup) DeepCopy() *TiKVGroup

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

func (*TiKVGroup) DeepCopyInto

func (in *TiKVGroup) DeepCopyInto(out *TiKVGroup)

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

func (*TiKVGroup) DeepCopyObject

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

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

type TiKVGroupList

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

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

TiKVGroupList defines a list of TiKV groups

func (*TiKVGroupList) DeepCopy

func (in *TiKVGroupList) DeepCopy() *TiKVGroupList

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

func (*TiKVGroupList) DeepCopyInto

func (in *TiKVGroupList) DeepCopyInto(out *TiKVGroupList)

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

func (*TiKVGroupList) DeepCopyObject

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

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

type TiKVGroupSpec

type TiKVGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`
	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	Template TiKVTemplate `json:"template"`
}

TiKVGroupSpec describes the common attributes of a TiKVGroup

func (*TiKVGroupSpec) DeepCopy

func (in *TiKVGroupSpec) DeepCopy() *TiKVGroupSpec

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

func (*TiKVGroupSpec) DeepCopyInto

func (in *TiKVGroupSpec) DeepCopyInto(out *TiKVGroupSpec)

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

type TiKVGroupStatus

type TiKVGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*TiKVGroupStatus) DeepCopy

func (in *TiKVGroupStatus) DeepCopy() *TiKVGroupStatus

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

func (*TiKVGroupStatus) DeepCopyInto

func (in *TiKVGroupStatus) DeepCopyInto(out *TiKVGroupStatus)

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

type TiKVList

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

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

TiKVList defines a list of TiKV instances

func (*TiKVList) DeepCopy

func (in *TiKVList) DeepCopy() *TiKVList

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

func (*TiKVList) DeepCopyInto

func (in *TiKVList) DeepCopyInto(out *TiKVList)

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

func (*TiKVList) DeepCopyObject

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

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

type TiKVPorts

type TiKVPorts struct {
	// Client defines port for tikv's api service
	Client *Port `json:"client,omitempty"`
	// Status defines port for tikv status api
	Status *Port `json:"peer,omitempty"`
}

func (*TiKVPorts) DeepCopy

func (in *TiKVPorts) DeepCopy() *TiKVPorts

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

func (*TiKVPorts) DeepCopyInto

func (in *TiKVPorts) DeepCopyInto(out *TiKVPorts)

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

type TiKVPreStop

type TiKVPreStop struct {
	// Image of pre stop checker
	// Default is pingcap/prestop-checker:latest
	Image *string `json:"image,omitempty"`
}

func (*TiKVPreStop) DeepCopy

func (in *TiKVPreStop) DeepCopy() *TiKVPreStop

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

func (*TiKVPreStop) DeepCopyInto

func (in *TiKVPreStop) DeepCopyInto(out *TiKVPreStop)

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

type TiKVRemoteWorkers

type TiKVRemoteWorkers struct {
	// Default worker reference, if remote workers are enabled, this default worker ref must be set
	Worker WorkerReference `json:"worker"`

	// Coprocessor worker reference, if it's not set, use worker ref by default
	Coprocessor *CoprocessorReference `json:"coprocessor,omitempty"`

	// Compactor worker reference, if it's not set, use worker ref by default
	Compactor *CompactorReference `json:"compactor,omitempty"`
}

func (*TiKVRemoteWorkers) DeepCopy

func (in *TiKVRemoteWorkers) DeepCopy() *TiKVRemoteWorkers

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

func (*TiKVRemoteWorkers) DeepCopyInto

func (in *TiKVRemoteWorkers) DeepCopyInto(out *TiKVRemoteWorkers)

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

type TiKVServer

type TiKVServer struct {
	// Ports defines all ports listened by tikv
	Ports TiKVPorts `json:"ports,omitempty"`

	// Labels defines the server labels of the TiKV server.
	// Operator will set these `labels` by API dynamically.
	// If a label in this field is conflict with the config file, this field takes precedence.
	// NOTE: If a label is removed, operator will not delete it automatically.
	// NOTE: these label keys are managed by TiDB Operator, it will be set automatically and you can not modify them:
	//  - host
	//  - region
	//  - zone
	// +kubebuilder:validation:XValidation:rule="!('host' in self) && !('region' in self) && !('zone' in self)",message="labels cannot contain 'host', 'region', or 'zone' keys"
	Labels map[string]string `json:"labels,omitempty"`
}

func (*TiKVServer) DeepCopy

func (in *TiKVServer) DeepCopy() *TiKVServer

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

func (*TiKVServer) DeepCopyInto

func (in *TiKVServer) DeepCopyInto(out *TiKVServer)

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

type TiKVSpec

type TiKVSpec struct {
	// Cluster is a reference of tidb cluster
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`
	// Topology defines the topology domain of this pd instance
	// It will be translated into a node affinity config
	// Topology cannot be changed
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`
	// Subdomain means the subdomain of the exported tikv dns.
	// A same tikv group will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// Offline marks the store as offline in PD to begin data migration.
	// When true, the store will be marked as offline in PD.
	// When false, the store will be marked as online in PD (if possible).
	// +optional
	Offline *bool `json:"offline,omitempty"`

	// TiKVTemplateSpec embedded some fields managed by TiKVGroup
	TiKVTemplateSpec `json:",inline"`
}

TiKVSpec defines the spec of tikv instance +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

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.

type TiKVStatus

type TiKVStatus struct {
	CommonStatus `json:",inline"`
	StoreStatus  `json:",inline"`
}

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.

type TiKVTemplate

type TiKVTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       TiKVTemplateSpec `json:"spec"`
}

func (*TiKVTemplate) DeepCopy

func (in *TiKVTemplate) DeepCopy() *TiKVTemplate

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

func (*TiKVTemplate) DeepCopyInto

func (in *TiKVTemplate) DeepCopyInto(out *TiKVTemplate)

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

type TiKVTemplateSpec

type TiKVTemplateSpec struct {
	// Version must be a semantic version.
	// It can have a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`
	// Image is tikv's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/tikv
	Image *string `json:"image,omitempty"`
	// Server defines the server config of TiKV
	Server TiKVServer `json:"server,omitempty"`
	// Resources defines resource required by TiKV
	Resources ResourceRequirements `json:"resources,omitempty"`
	// Config defines config file of TiKV
	Config         ConfigFile     `json:"config,omitempty"`
	UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

	// Security defines security config
	Security *Security `json:"security,omitempty"`

	// Volumes defines data volume of TiKV
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes"`

	// PreStop defines preStop config
	PreStop *TiKVPreStop `json:"preStop,omitempty"`

	// RemoteWorkers defines remote workers used by this tikv
	// It only works for nextgen
	RemoteWorkers *TiKVRemoteWorkers `json:"remoteWorkers,omitempty"`

	// Overlay defines a k8s native resource template patch
	// All resources(pod, pvcs, ...) managed by TiKV can be overlayed by this field
	Overlay *Overlay `json:"overlay,omitempty"`
}

TiKVTemplateSpec can only be specified in TiKVGroup TODO: It's name may need to be changed to distinguish from PodTemplateSpec +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes" +kubebuilder:validation:XValidation:rule="has(self.volumes) && ('data' in self.volumes.map(v, v.name))",message="data volume must be configured"

func (*TiKVTemplateSpec) DeepCopy

func (in *TiKVTemplateSpec) DeepCopy() *TiKVTemplateSpec

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

func (*TiKVTemplateSpec) DeepCopyInto

func (in *TiKVTemplateSpec) DeepCopyInto(out *TiKVTemplateSpec)

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

type TiKVWorker

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

	Spec   TiKVWorkerSpec   `json:"spec,omitempty"`
	Status TiKVWorkerStatus `json:"status,omitempty"`
}

TiKVWorker defines a TiKV worker instance. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*TiKVWorker) DeepCopy

func (in *TiKVWorker) DeepCopy() *TiKVWorker

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

func (*TiKVWorker) DeepCopyInto

func (in *TiKVWorker) DeepCopyInto(out *TiKVWorker)

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

func (*TiKVWorker) DeepCopyObject

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

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

type TiKVWorkerGroup

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

	Spec   TiKVWorkerGroupSpec   `json:"spec,omitempty"`
	Status TiKVWorkerGroupStatus `json:"status,omitempty"`
}

TiKVWorkerGroup defines a group of similar TiKV worker instances. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*TiKVWorkerGroup) DeepCopy

func (in *TiKVWorkerGroup) DeepCopy() *TiKVWorkerGroup

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

func (*TiKVWorkerGroup) DeepCopyInto

func (in *TiKVWorkerGroup) DeepCopyInto(out *TiKVWorkerGroup)

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

func (*TiKVWorkerGroup) DeepCopyObject

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

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

type TiKVWorkerGroupList

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

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

TiKVWorkerGroupList defines a list of TiKV worker groups

func (*TiKVWorkerGroupList) DeepCopy

func (in *TiKVWorkerGroupList) DeepCopy() *TiKVWorkerGroupList

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

func (*TiKVWorkerGroupList) DeepCopyInto

func (in *TiKVWorkerGroupList) DeepCopyInto(out *TiKVWorkerGroupList)

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

func (*TiKVWorkerGroupList) DeepCopyObject

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

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

type TiKVWorkerGroupSpec

type TiKVWorkerGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`
	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	Template TiKVWorkerTemplate `json:"template"`
}

TiKVWorkerGroupSpec describes the common attributes of a TiKVWorkerGroup.

func (*TiKVWorkerGroupSpec) DeepCopy

func (in *TiKVWorkerGroupSpec) DeepCopy() *TiKVWorkerGroupSpec

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

func (*TiKVWorkerGroupSpec) DeepCopyInto

func (in *TiKVWorkerGroupSpec) DeepCopyInto(out *TiKVWorkerGroupSpec)

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

type TiKVWorkerGroupStatus

type TiKVWorkerGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*TiKVWorkerGroupStatus) DeepCopy

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

func (*TiKVWorkerGroupStatus) DeepCopyInto

func (in *TiKVWorkerGroupStatus) DeepCopyInto(out *TiKVWorkerGroupStatus)

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

type TiKVWorkerList

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

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

TiKVWorkerList defines a list of TiKV worker instances.

func (*TiKVWorkerList) DeepCopy

func (in *TiKVWorkerList) DeepCopy() *TiKVWorkerList

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

func (*TiKVWorkerList) DeepCopyInto

func (in *TiKVWorkerList) DeepCopyInto(out *TiKVWorkerList)

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

func (*TiKVWorkerList) DeepCopyObject

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

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

type TiKVWorkerPorts

type TiKVWorkerPorts struct {
	// API defines port for TiKV worker's API service.
	API *Port `json:"api,omitempty"`
}

func (*TiKVWorkerPorts) DeepCopy

func (in *TiKVWorkerPorts) DeepCopy() *TiKVWorkerPorts

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

func (*TiKVWorkerPorts) DeepCopyInto

func (in *TiKVWorkerPorts) DeepCopyInto(out *TiKVWorkerPorts)

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

type TiKVWorkerServer

type TiKVWorkerServer struct {
	// Port defines all ports listened by TiKV worker.
	Ports TiKVWorkerPorts `json:"ports,omitempty"`
}

func (*TiKVWorkerServer) DeepCopy

func (in *TiKVWorkerServer) DeepCopy() *TiKVWorkerServer

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

func (*TiKVWorkerServer) DeepCopyInto

func (in *TiKVWorkerServer) DeepCopyInto(out *TiKVWorkerServer)

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

type TiKVWorkerSpec

type TiKVWorkerSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// Topology defines the topology domain of this TiKV worker instance.
	// It will be translated into a node affinity config.
	// Topology cannot be changed.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`

	// Subdomain means the subdomain of the exported tikv-worker dns.
	// A same tikv-worker cluster will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// TiKVWorkerTemplateSpec embeded some fields managed by TiKVWorkerGroup.
	TiKVWorkerTemplateSpec `json:",inline"`
}

TiKVWorkerSpec defines the spec of tikv-worker +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

func (*TiKVWorkerSpec) DeepCopy

func (in *TiKVWorkerSpec) DeepCopy() *TiKVWorkerSpec

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

func (*TiKVWorkerSpec) DeepCopyInto

func (in *TiKVWorkerSpec) DeepCopyInto(out *TiKVWorkerSpec)

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

type TiKVWorkerStatus

type TiKVWorkerStatus struct {
	CommonStatus `json:",inline"`
}

func (*TiKVWorkerStatus) DeepCopy

func (in *TiKVWorkerStatus) DeepCopy() *TiKVWorkerStatus

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

func (*TiKVWorkerStatus) DeepCopyInto

func (in *TiKVWorkerStatus) DeepCopyInto(out *TiKVWorkerStatus)

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

type TiKVWorkerTemplate

type TiKVWorkerTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       TiKVWorkerTemplateSpec `json:"spec"`
}

func (*TiKVWorkerTemplate) DeepCopy

func (in *TiKVWorkerTemplate) DeepCopy() *TiKVWorkerTemplate

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

func (*TiKVWorkerTemplate) DeepCopyInto

func (in *TiKVWorkerTemplate) DeepCopyInto(out *TiKVWorkerTemplate)

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

type TiKVWorkerTemplateSpec

type TiKVWorkerTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`
	// Image is TiKV worker's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/tikv
	Image *string `json:"image,omitempty"`
	// Server defines the server configuration of TiKV worker.
	Server TiKVWorkerServer `json:"server,omitempty"`
	// Resources defines resource required by TiKV worker.
	Resources ResourceRequirements `json:"resources,omitempty"`
	// Config defines config file of TiKV worker.
	Config         ConfigFile     `json:"config,omitempty"`
	UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

	Security *Security `json:"security,omitempty"`

	// Volumes defines data volume of TiKV worker, it is optional.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes,omitempty"`

	// Overlay defines a k8s native resource template patch.
	// All resources(pod, pvcs, ...) managed by TiKV worker can be overlayed by this field.
	Overlay *Overlay `json:"overlay,omitempty"`
}

TiKVWorkerTemplateSpec can only be specified in TiKVWorkerGroup. +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes"

func (*TiKVWorkerTemplateSpec) DeepCopy

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

func (*TiKVWorkerTemplateSpec) DeepCopyInto

func (in *TiKVWorkerTemplateSpec) DeepCopyInto(out *TiKVWorkerTemplateSpec)

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

type TiProxy

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

	Spec   TiProxySpec   `json:"spec,omitempty"`
	Status TiProxyStatus `json:"status,omitempty"`
}

TiProxy defines a TiProxy instance. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"

func (*TiProxy) DeepCopy

func (in *TiProxy) DeepCopy() *TiProxy

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

func (*TiProxy) DeepCopyInto

func (in *TiProxy) DeepCopyInto(out *TiProxy)

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

func (*TiProxy) DeepCopyObject

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

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

type TiProxyGroup

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

	Spec   TiProxyGroupSpec   `json:"spec,omitempty"`
	Status TiProxyGroupStatus `json:"status,omitempty"`
}

TiProxyGroup defines a group of similar TiProxy instances. +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"

func (*TiProxyGroup) DeepCopy

func (in *TiProxyGroup) DeepCopy() *TiProxyGroup

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

func (*TiProxyGroup) DeepCopyInto

func (in *TiProxyGroup) DeepCopyInto(out *TiProxyGroup)

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

func (*TiProxyGroup) DeepCopyObject

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

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

type TiProxyGroupList

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

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

TiProxyGroupList defines a list of TiProxy groups

func (*TiProxyGroupList) DeepCopy

func (in *TiProxyGroupList) DeepCopy() *TiProxyGroupList

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

func (*TiProxyGroupList) DeepCopyInto

func (in *TiProxyGroupList) DeepCopyInto(out *TiProxyGroupList)

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

func (*TiProxyGroupList) DeepCopyObject

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

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

type TiProxyGroupSpec

type TiProxyGroupSpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`
	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas"`

	// +listType=map
	// +listMapKey=type
	SchedulePolicies []SchedulePolicy `json:"schedulePolicies,omitempty"`

	// MinReadySeconds specifies the minimum number of seconds for which a newly created pod be ready without any of its containers crashing, for it to be considered available.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReadySeconds *int64 `json:"minReadySeconds,omitempty"`

	// MaxSurge specifies the maximum number of additional instances that may be created during rolling restart.
	// It only takes effect when the update requires restarting TiProxy instances.
	// Defaults to 1.
	// +kubebuilder:validation:Minimum=1
	// +optional
	MaxSurge *int32 `json:"maxSurge,omitempty"`

	Template TiProxyTemplate `json:"template"`
}

TiProxyGroupSpec describes the common attributes of a TiProxyGroup.

func (*TiProxyGroupSpec) DeepCopy

func (in *TiProxyGroupSpec) DeepCopy() *TiProxyGroupSpec

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

func (*TiProxyGroupSpec) DeepCopyInto

func (in *TiProxyGroupSpec) DeepCopyInto(out *TiProxyGroupSpec)

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

type TiProxyGroupStatus

type TiProxyGroupStatus struct {
	CommonStatus `json:",inline"`
	GroupStatus  `json:",inline"`
}

func (*TiProxyGroupStatus) DeepCopy

func (in *TiProxyGroupStatus) DeepCopy() *TiProxyGroupStatus

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

func (*TiProxyGroupStatus) DeepCopyInto

func (in *TiProxyGroupStatus) DeepCopyInto(out *TiProxyGroupStatus)

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

type TiProxyList

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

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

TiProxyList defines a list of TiProxy instances.

func (*TiProxyList) DeepCopy

func (in *TiProxyList) DeepCopy() *TiProxyList

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

func (*TiProxyList) DeepCopyInto

func (in *TiProxyList) DeepCopyInto(out *TiProxyList)

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

func (*TiProxyList) DeepCopyObject

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

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

type TiProxyPorts

type TiProxyPorts struct {
	// Client defines port for TiProxy's SQL service.
	Client *Port `json:"client,omitempty"`
	// API defines port for TiProxy API service.
	API *Port `json:"api,omitempty"`
	// Peer defines port for TiProxy's peer service.
	Peer *Port `json:"peer,omitempty"`
}

func (*TiProxyPorts) DeepCopy

func (in *TiProxyPorts) DeepCopy() *TiProxyPorts

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

func (*TiProxyPorts) DeepCopyInto

func (in *TiProxyPorts) DeepCopyInto(out *TiProxyPorts)

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

type TiProxyPreStop

type TiProxyPreStop struct {
	// SleepSeconds is the seconds to sleep before sending the SIGTERM to the TiProxy container.
	// It's useful to achieve a graceful shutdown of the TiProxy container.
	// Default is 10 seconds.
	SleepSeconds int32 `json:"sleepSeconds,omitempty"`
}

func (*TiProxyPreStop) DeepCopy

func (in *TiProxyPreStop) DeepCopy() *TiProxyPreStop

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

func (*TiProxyPreStop) DeepCopyInto

func (in *TiProxyPreStop) DeepCopyInto(out *TiProxyPreStop)

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

type TiProxyProb

type TiProxyProb struct {
	// "tcp" will use TCP socket to connect component port.
	// "command" will probe the HTTP API of TiProxy.
	// +kubebuilder:validation:Enum=tcp;command
	Type *string `json:"type,omitempty"`
}

func (*TiProxyProb) DeepCopy

func (in *TiProxyProb) DeepCopy() *TiProxyProb

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

func (*TiProxyProb) DeepCopyInto

func (in *TiProxyProb) DeepCopyInto(out *TiProxyProb)

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

type TiProxyProbes

type TiProxyProbes struct {
	// Readiness defines the readiness probe for TiProxy.
	// The default handler is a TCP socket on the client port.
	Readiness *TiProxyProb `json:"readiness,omitempty"`
}

func (*TiProxyProbes) DeepCopy

func (in *TiProxyProbes) DeepCopy() *TiProxyProbes

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

func (*TiProxyProbes) DeepCopyInto

func (in *TiProxyProbes) DeepCopyInto(out *TiProxyProbes)

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

type TiProxySecurity

type TiProxySecurity struct {
	// Whether enable the TLS connection.
	TLS *TiProxyTLSConfig `json:"tls,omitempty"`
}

func (*TiProxySecurity) DeepCopy

func (in *TiProxySecurity) DeepCopy() *TiProxySecurity

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

func (*TiProxySecurity) DeepCopyInto

func (in *TiProxySecurity) DeepCopyInto(out *TiProxySecurity)

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

type TiProxyServer

type TiProxyServer struct {
	// Port defines all ports listened by TiProxy.
	Ports TiProxyPorts `json:"ports,omitempty"`

	// Labels defines the server labels of the TiProxy server.
	// Operator will set these `labels` by API.
	// If a label in this field is conflict with the config file, this field takes precedence.
	// NOTE: If a label is removed, operator will not delete it automatically.
	// NOTE: these label keys are managed by TiDB Operator, it will be set automatically and you can not modify them:
	//  - host
	//  - region
	//  - zone
	// +kubebuilder:validation:XValidation:rule="!('host' in self) && !('region' in self) && !('zone' in self)",message="labels cannot contain 'host', 'region', or 'zone' keys"
	Labels map[string]string `json:"labels,omitempty"`
}

func (*TiProxyServer) DeepCopy

func (in *TiProxyServer) DeepCopy() *TiProxyServer

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

func (*TiProxyServer) DeepCopyInto

func (in *TiProxyServer) DeepCopyInto(out *TiProxyServer)

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

type TiProxySpec

type TiProxySpec struct {
	Cluster ClusterReference `json:"cluster"`
	// Features are enabled feature
	Features []meta.Feature `json:"features,omitempty"`

	// Topology defines the topology domain of this TiProxy instance.
	// It will be translated into a node affinity config.
	// Topology cannot be changed.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="topology is immutable"
	Topology Topology `json:"topology,omitempty"`

	// Subdomain means the subdomain of the exported tiproxy dns.
	// A same tiproxy cluster will use a same subdomain
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subdomain is immutable"
	Subdomain string `json:"subdomain"`

	// TiProxyTemplateSpec embeded some fields managed by TiProxyGroup.
	TiProxyTemplateSpec `json:",inline"`
}

TiProxySpec defines the spec of tiproxy +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"

func (*TiProxySpec) DeepCopy

func (in *TiProxySpec) DeepCopy() *TiProxySpec

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

func (*TiProxySpec) DeepCopyInto

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

type TiProxyStatus struct {
	CommonStatus `json:",inline"`
}

func (*TiProxyStatus) DeepCopy

func (in *TiProxyStatus) DeepCopy() *TiProxyStatus

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

func (*TiProxyStatus) DeepCopyInto

func (in *TiProxyStatus) DeepCopyInto(out *TiProxyStatus)

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

type TiProxyTLSConfig

type TiProxyTLSConfig struct {
	// MySQL defines the TLS configuration for connections between TiProxy and MySQL clients.
	// The steps to enable this feature:
	//   1. Generate a TiProxy server-side certificate for the TiProxy cluster.
	//      There are multiple ways to generate certificates:
	//        - user-provided certificates: https://docs.pingcap.com/TiProxy/stable/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 a K8s Secret object which contains the TiProxy server-side certificate created above.
	//      The name of this Secret must be: <groupName>-tiproxy-server-secret.
	//        kubectl create secret generic <groupName>-tiproxy-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. Set Enabled to `true`.
	MySQL *TLS `json:"mysql,omitempty"`

	// Backend defines the TLS configuration for connections between TiProxy and TiDB servers.
	// To enable this feature, the corresponding TiDB server must be configured with TLS enabled.
	Backend *ClientTLS `json:"backend,omitempty"`

	// Cluster defines the tls config to visit other components in the cluster
	Cluster *InternalClientTLS `json:"cluster,omitempty"`

	// Server defines the TLS config for http server of the tiproxy
	// If this field is not specified, the operator will use cluster tls config to config http server by default.
	// The tls secret references also default to cluster tls secrets.
	// It can be disabled by set Enabled to false.
	// NOTE: if server tls is disabled, the Client will also be disabled.
	Server *TLS `json:"server,omitempty"`
}

func (*TiProxyTLSConfig) DeepCopy

func (in *TiProxyTLSConfig) DeepCopy() *TiProxyTLSConfig

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

func (*TiProxyTLSConfig) DeepCopyInto

func (in *TiProxyTLSConfig) DeepCopyInto(out *TiProxyTLSConfig)

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

type TiProxyTemplate

type TiProxyTemplate struct {
	ObjectMeta `json:"metadata,omitempty"`
	Spec       TiProxyTemplateSpec `json:"spec"`
}

func (*TiProxyTemplate) DeepCopy

func (in *TiProxyTemplate) DeepCopy() *TiProxyTemplate

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

func (*TiProxyTemplate) DeepCopyInto

func (in *TiProxyTemplate) DeepCopyInto(out *TiProxyTemplate)

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

type TiProxyTemplateSpec

type TiProxyTemplateSpec struct {
	// Version must be a semantic version.
	// It can has a v prefix or not.
	// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
	Version string `json:"version"`
	// Image is TiProxy's image
	// If tag is omitted, version will be used as the image tag.
	// Default is pingcap/tiproxy
	Image *string `json:"image,omitempty"`
	// Server defines the server configuration of TiProxy.
	Server TiProxyServer `json:"server,omitempty"`
	// Probes defines probes for TiProxy.
	Probes TiProxyProbes `json:"probes,omitempty"`
	// Resources defines resource required by TiProxy.
	Resources ResourceRequirements `json:"resources,omitempty"`
	// Config defines config file of TiProxy.
	Config         ConfigFile     `json:"config,omitempty"`
	UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`

	Security *TiProxySecurity `json:"security,omitempty"`

	// Volumes defines data volume of TiProxy, it is optional.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=256
	Volumes []Volume `json:"volumes,omitempty"`

	// PreStop defines the preStop config for the TiProxy container.
	PreStop *TiProxyPreStop `json:"preStop,omitempty"`

	// Overlay defines a k8s native resource template patch.
	// All resources(pod, pvcs, ...) managed by TiProxy can be overlayed by this field.
	Overlay *Overlay `json:"overlay,omitempty"`
}

TiProxyTemplateSpec can only be specified in TiProxyGroup. +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes"

func (*TiProxyTemplateSpec) DeepCopy

func (in *TiProxyTemplateSpec) DeepCopy() *TiProxyTemplateSpec

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

func (*TiProxyTemplateSpec) DeepCopyInto

func (in *TiProxyTemplateSpec) DeepCopyInto(out *TiProxyTemplateSpec)

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

type Topology

type Topology map[string]string

Topology means the topo for scheduling e.g. topology.kubernetes.io/zone: us-west-1a It will be translated to pod.spec.nodeSelector IMPORTANT: Topology is immutable for an instance +kubebuilder:validation:MinProperties=1

func (Topology) DeepCopy

func (in Topology) DeepCopy() Topology

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

func (Topology) DeepCopyInto

func (in Topology) DeepCopyInto(out *Topology)

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

type UpdateStrategy

type UpdateStrategy struct {
	// Config determines how the configuration change is applied to the cluster.
	// Valid values are "Restart" (by default) and "HotReload".
	// +kubebuilder:validation:Enum=Restart;HotReload
	// +kubebuilder:default="Restart"
	Config ConfigUpdateStrategy `json:"config,omitempty"`
}

func (*UpdateStrategy) DeepCopy

func (in *UpdateStrategy) DeepCopy() *UpdateStrategy

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

func (*UpdateStrategy) DeepCopyInto

func (in *UpdateStrategy) DeepCopyInto(out *UpdateStrategy)

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

type UpgradePolicy

type UpgradePolicy string
const (
	// UpgradePolicyDefault means the cluster will be upgraded in the following order:
	// PD, TiProxy, TiFlash, TiKV, TiDB.
	UpgradePolicyDefault UpgradePolicy = "Default"

	// UpgradePolicyNoConstraints means the cluster will be upgraded without any constraints,
	// all components will be upgraded at the same time.
	UpgradePolicyNoConstraints UpgradePolicy = "NoConstraints"
)

type Volume

type Volume struct {
	// Name is volume name.
	Name string `json:"name"`

	// Mounts defines mount infos of this volume
	// NOTE(liubo02): it cannot be a list map because the key is "type" or "mountPath" which is not supported
	// +listType=atomic
	Mounts []VolumeMount `json:"mounts"`

	// Storage defines the request size of this volume
	Storage resource.Quantity `json:"storage"`

	// StorageClassName means the storage class the volume used.
	// You can modify volumes' attributes by changing the StorageClass
	// when VolumeAttributesClass is not available.
	// Note that only newly created PV will use the new StorageClass.
	StorageClassName *string `json:"storageClassName,omitempty"`

	// VolumeAttributesClassName means the VolumeAttributesClass the volume used.
	// You can modify volumes' attributes by changing it.
	// This feature is introduced since K8s 1.29 as alpha feature and disabled by default.
	// It's only available when the feature is enabled.
	VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"`
}

Volume defines a persistent volume, it will be mounted at a specified root path A volume can be mounted for multiple different usages. For example, a volume can be mounted for both data and raft log. +kubebuilder:validation:XValidation:rule="!has(oldSelf.volumeAttributesClassName) || has(self.volumeAttributesClassName)",message="VolumeAttributesClassName cannot be changed from non-nil to nil"

func (*Volume) DeepCopy

func (in *Volume) DeepCopy() *Volume

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

func (*Volume) DeepCopyInto

func (in *Volume) DeepCopyInto(out *Volume)

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

type VolumeMount

type VolumeMount struct {
	// Type is a type of the volume mount.
	// If it's empty, the mount is treated as a custom mount without built-in semantics.
	Type VolumeMountType `json:"type,omitempty"`
	// Mount path of volume, if it's not set, use the default path of this type.
	// TODO: webhook for empty path if it's not a built-in type.
	MountPath string `json:"mountPath,omitempty"`
	// SubPath is the path of the volume's root path.
	SubPath string `json:"subPath,omitempty"`
}

func (*VolumeMount) DeepCopy

func (in *VolumeMount) DeepCopy() *VolumeMount

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

func (*VolumeMount) DeepCopyInto

func (in *VolumeMount) DeepCopyInto(out *VolumeMount)

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

type VolumeMountType

type VolumeMountType string
const (
	// VolumeMountTypePDData means data dir of PD
	VolumeMountTypePDData VolumeMountType = "data"

	VolumeMountPDDataDefaultPath = "/var/lib/pd"
)
const (
	// VolumeUsageTypeTiDBSlowLog means the data dir of slowlog
	// Users can define a persistent volume for slowlog, or an emptydir will be used.
	VolumeMountTypeTiDBSlowLog VolumeMountType = "slowlog"

	VolumeMountTiDBSlowLogDefaultPath = "/var/log/tidb"
)
const (
	// VolumeMountTypeTiFlashData is the main data dir for the tiflash
	VolumeMountTypeTiFlashData VolumeMountType = "data"

	VolumeMountTiFlashDataDefaultPath = "/var/lib/tiflash"
)
const (
	// VolumeMountTypeTiKVData is the main data dir for the tikv
	// The default sub path of this type is ""
	VolumeMountTypeTiKVData VolumeMountType = "data"

	VolumeMountTiKVDataDefaultPath = "/var/lib/tikv"
)
const (
	// VolumeMountTypeTiKVWorkerData is the main data dir for the tikv worker.
	// The default sub path of this type is "".
	VolumeMountTypeTiKVWorkerData VolumeMountType = "data"

	VolumeMountTiKVWorkerDataDefaultPath = "/var/lib/tikv-worker"
)

type WorkerReference

type WorkerReference corev1.LocalObjectReference

func (*WorkerReference) DeepCopy

func (in *WorkerReference) DeepCopy() *WorkerReference

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

func (*WorkerReference) DeepCopyInto

func (in *WorkerReference) DeepCopyInto(out *WorkerReference)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL