Documentation ¶
Overview ¶
Package v1alpha1 is the v1alpha1 version of the API. +groupName=pingcap.com
Index ¶
- Constants
- Variables
- func Resource(resource string) schema.GroupResource
- type ContainerSpec
- type MemberPhase
- type MemberType
- type PDFailureMember
- type PDMember
- type PDSpec
- type PDStatus
- type ResourceRequirement
- type Service
- type TiDBFailureMember
- type TiDBMember
- type TiDBSpec
- type TiDBStatus
- type TiKVFailureStore
- type TiKVPromGatewaySpec
- type TiKVSpec
- type TiKVStatus
- type TiKVStore
- type TidbCluster
- type TidbClusterList
- type TidbClusterSpec
- type TidbClusterStatus
Constants ¶
const ( // AnnotationStorageSize is a storage size annotation key AnnotationStorageSize string = "storage.pingcap.com/size" // TiKVStateUp represents status of Up of TiKV TiKVStateUp string = "Up" // TiKVStateDown represents status of Down of TiKV TiKVStateDown string = "Down" )
Variables ¶
var ( // SchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. SchemeBuilder runtime.SchemeBuilder // AddToScheme applies all the stored functions to the scheme. AddToScheme = localSchemeBuilder.AddToScheme // Scheme is the scheme instance of operator Scheme *runtime.Scheme )
var SchemeGroupVersion = schema.GroupVersion{Group: groupName, Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns back a Group qualified GroupResource
Types ¶
type ContainerSpec ¶
type ContainerSpec struct { Image string `json:"image"` Requests *ResourceRequirement `json:"requests,omitempty"` Limits *ResourceRequirement `json:"limits,omitempty"` }
ContainerSpec is the container spec of a pod
func (*ContainerSpec) DeepCopy ¶
func (in *ContainerSpec) DeepCopy() *ContainerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerSpec.
func (*ContainerSpec) DeepCopyInto ¶
func (in *ContainerSpec) DeepCopyInto(out *ContainerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MemberPhase ¶
type MemberPhase string
MemberPhase is the current state of member
const ( // NormalPhase represents normal state of TiDB cluster. NormalPhase MemberPhase = "Normal" // UpgradePhase represents the upgrade state of TiDB cluster. UpgradePhase MemberPhase = "Upgrade" )
type MemberType ¶
type MemberType string
MemberType represents member type
const ( // PDMemberType is pd container type PDMemberType MemberType = "pd" // TiDBMemberType is tidb container type TiDBMemberType MemberType = "tidb" // TiKVMemberType is tikv container type TiKVMemberType MemberType = "tikv" //PushGatewayMemberType is pushgateway container type PushGatewayMemberType MemberType = "pushgateway" // UnknownMemberType is unknown container type UnknownMemberType MemberType = "unknown" )
func (MemberType) String ¶
func (mt MemberType) String() string
type PDFailureMember ¶ added in v0.2.0
type PDFailureMember struct { PodName string `json:"podName,omitempty"` MemberID string `json:"memberID,omitempty"` PVUID types.UID `json:"pvUID,omitempty"` Replicas int32 `json:"replicas,omitempty"` MemberDeleted bool `json:"memberDeleted,omitempty"` }
PDFailureMember is the pd failure member information
func (*PDFailureMember) DeepCopy ¶ added in v0.2.0
func (in *PDFailureMember) DeepCopy() *PDFailureMember
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDFailureMember.
func (*PDFailureMember) DeepCopyInto ¶ added in v0.2.0
func (in *PDFailureMember) DeepCopyInto(out *PDFailureMember)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PDMember ¶
type PDMember struct { Name string `json:"name"` // member id is actually a uint64, but apimachinery's json only treats numbers as int64/float64 // so uint64 may overflow int64 and thus convert to float64 ID string `json:"id"` ClientURL string `json:"clientURL"` Health bool `json:"health"` // Last time the health transitioned from one to another. LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` }
PDMember is PD member
func (*PDMember) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDMember.
func (*PDMember) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PDSpec ¶
type PDSpec struct { ContainerSpec Replicas int32 `json:"replicas"` NodeSelector map[string]string `json:"nodeSelector,omitempty"` NodeSelectorRequired bool `json:"nodeSelectorRequired,omitempty"` StorageClassName string `json:"storageClassName,omitempty"` Tolerations []corev1.Toleration `json:"tolerations,omitempty"` }
PDSpec contains details of PD member
func (*PDSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDSpec.
func (*PDSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PDStatus ¶
type PDStatus struct { Phase MemberPhase `json:"phase,omitempty"` StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"` Members map[string]PDMember `json:"members,omitempty"` FailureMembers map[string]PDFailureMember `json:"failureMembers,omitempty"` }
PDStatus is PD status
func (*PDStatus) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDStatus.
func (*PDStatus) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceRequirement ¶
type ResourceRequirement struct { // CPU is how many cores a pod requires CPU string `json:"cpu,omitempty"` // Memory is how much memory a pod requires Memory string `json:"memory,omitempty"` // Storage is storage size a pod requires Storage string `json:"storage,omitempty"` }
ResourceRequirement is resource requirements for a pod
func (*ResourceRequirement) DeepCopy ¶
func (in *ResourceRequirement) DeepCopy() *ResourceRequirement
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRequirement.
func (*ResourceRequirement) DeepCopyInto ¶
func (in *ResourceRequirement) DeepCopyInto(out *ResourceRequirement)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Service ¶
Service represent service type used in TidbCluster
func (*Service) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service.
func (*Service) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TiDBFailureMember ¶ added in v0.2.0
type TiDBFailureMember struct { PodName string `json:"podName,omitempty"` Replicas int32 `json:"replicas,omitempty"` }
TiDBFailureMember is the tidb failure member information
func (*TiDBFailureMember) DeepCopy ¶ added in v0.2.0
func (in *TiDBFailureMember) DeepCopy() *TiDBFailureMember
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBFailureMember.
func (*TiDBFailureMember) DeepCopyInto ¶ added in v0.2.0
func (in *TiDBFailureMember) DeepCopyInto(out *TiDBFailureMember)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TiDBMember ¶
type TiDBMember struct { Name string `json:"name"` Health bool `json:"health"` // Last time the health transitioned from one to another. LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` }
TiDBMember is TiDB member
func (*TiDBMember) DeepCopy ¶
func (in *TiDBMember) DeepCopy() *TiDBMember
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBMember.
func (*TiDBMember) DeepCopyInto ¶
func (in *TiDBMember) DeepCopyInto(out *TiDBMember)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TiDBSpec ¶
type TiDBSpec struct { ContainerSpec Replicas int32 `json:"replicas"` NodeSelector map[string]string `json:"nodeSelector,omitempty"` NodeSelectorRequired bool `json:"nodeSelectorRequired,omitempty"` StorageClassName string `json:"storageClassName,omitempty"` Tolerations []corev1.Toleration `json:"tolerations,omitempty"` }
TiDBSpec contains details of PD member
func (*TiDBSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBSpec.
func (*TiDBSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TiDBStatus ¶
type TiDBStatus struct { Phase MemberPhase `json:"phase,omitempty"` StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"` Members map[string]TiDBMember `json:"members,omitempty"` FailureMembers map[string]TiDBFailureMember `json:"failureMembers,omitempty"` }
TiDBStatus is TiDB status
func (*TiDBStatus) DeepCopy ¶
func (in *TiDBStatus) DeepCopy() *TiDBStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiDBStatus.
func (*TiDBStatus) DeepCopyInto ¶
func (in *TiDBStatus) DeepCopyInto(out *TiDBStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TiKVFailureStore ¶ added in v0.2.0
type TiKVFailureStore struct { PodName string `json:"podName,omitempty"` StoreID string `json:"storeID,omitempty"` Replicas int32 `json:"replicas,omitempty"` }
TiKVFailureStore is the tikv failure store information
func (*TiKVFailureStore) DeepCopy ¶ added in v0.2.0
func (in *TiKVFailureStore) DeepCopy() *TiKVFailureStore
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVFailureStore.
func (*TiKVFailureStore) DeepCopyInto ¶ added in v0.2.0
func (in *TiKVFailureStore) DeepCopyInto(out *TiKVFailureStore)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TiKVPromGatewaySpec ¶
type TiKVPromGatewaySpec struct {
ContainerSpec
}
TiKVPromGatewaySpec runs as a sidecar with TiKVSpec
func (*TiKVPromGatewaySpec) DeepCopy ¶
func (in *TiKVPromGatewaySpec) DeepCopy() *TiKVPromGatewaySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVPromGatewaySpec.
func (*TiKVPromGatewaySpec) DeepCopyInto ¶
func (in *TiKVPromGatewaySpec) DeepCopyInto(out *TiKVPromGatewaySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TiKVSpec ¶
type TiKVSpec struct { ContainerSpec Replicas int32 `json:"replicas"` NodeSelector map[string]string `json:"nodeSelector,omitempty"` NodeSelectorRequired bool `json:"nodeSelectorRequired,omitempty"` StorageClassName string `json:"storageClassName,omitempty"` Tolerations []corev1.Toleration `json:"tolerations,omitempty"` }
TiKVSpec contains details of PD member
func (*TiKVSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVSpec.
func (*TiKVSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TiKVStatus ¶
type TiKVStatus struct { Phase MemberPhase `json:"phase,omitempty"` StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"` Stores map[string]TiKVStore `json:"stores,omitempty"` TombstoneStores map[string]TiKVStore `json:"tombstoneStores,omitempty"` FailureStores map[string]TiKVFailureStore `json:"failureStores,omitempty"` }
TiKVStatus is TiKV status
func (*TiKVStatus) DeepCopy ¶
func (in *TiKVStatus) DeepCopy() *TiKVStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVStatus.
func (*TiKVStatus) DeepCopyInto ¶
func (in *TiKVStatus) DeepCopyInto(out *TiKVStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TiKVStore ¶
type TiKVStore struct { // store id is also uint64, due to the same reason as pd id, we store id as string ID string `json:"id"` PodName string `json:"podName"` IP string `json:"ip"` State string `json:"state"` LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime"` // Last time the health transitioned from one to another. LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` }
TiKVStores is either Up/Down/Offline/Tombstone
func (*TiKVStore) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TiKVStore.
func (*TiKVStore) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TidbCluster ¶
type TidbCluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` // Spec defines the behavior of a tidb cluster Spec TidbClusterSpec `json:"spec"` // Most recently observed status of the tidb cluster Status TidbClusterStatus `json:"status"` }
TidbCluster is the control script's spec
func (*TidbCluster) DeepCopy ¶
func (in *TidbCluster) DeepCopy() *TidbCluster
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbCluster.
func (*TidbCluster) DeepCopyInto ¶
func (in *TidbCluster) DeepCopyInto(out *TidbCluster)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TidbCluster) DeepCopyObject ¶
func (in *TidbCluster) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (TidbCluster) PDUpgrading ¶
func (tc TidbCluster) PDUpgrading() bool
func (TidbCluster) TiKVUpgrading ¶
func (tc TidbCluster) TiKVUpgrading() bool
type TidbClusterList ¶
type TidbClusterList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []TidbCluster `json:"items"` }
TidbClusterList is TidbCluster list
func (*TidbClusterList) DeepCopy ¶
func (in *TidbClusterList) DeepCopy() *TidbClusterList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterList.
func (*TidbClusterList) DeepCopyInto ¶
func (in *TidbClusterList) DeepCopyInto(out *TidbClusterList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TidbClusterList) DeepCopyObject ¶
func (in *TidbClusterList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type TidbClusterSpec ¶
type TidbClusterSpec struct { PD PDSpec `json:"pd,omitempty"` TiDB TiDBSpec `json:"tidb,omitempty"` TiKV TiKVSpec `json:"tikv,omitempty"` TiKVPromGateway TiKVPromGatewaySpec `json:"tikvPromGateway,omitempty"` // Services list non-headless services type used in TidbCluster Services []Service `json:"services,omitempty"` PVReclaimPolicy corev1.PersistentVolumeReclaimPolicy `json:"pvReclaimPolicy,omitempty"` Localtime bool `json:"localtime,omitempty"` }
TidbClusterSpec describes the attributes that a user creates on a tidb cluster
func (*TidbClusterSpec) DeepCopy ¶
func (in *TidbClusterSpec) DeepCopy() *TidbClusterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterSpec.
func (*TidbClusterSpec) DeepCopyInto ¶
func (in *TidbClusterSpec) DeepCopyInto(out *TidbClusterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TidbClusterStatus ¶
type TidbClusterStatus struct { PD PDStatus `json:"pd,omitempty"` TiKV TiKVStatus `json:"tikv,omitempty"` TiDB TiDBStatus `json:"tidb,omitempty"` }
TidbClusterStatus represents the current status of a tidb cluster.
func (*TidbClusterStatus) DeepCopy ¶
func (in *TidbClusterStatus) DeepCopy() *TidbClusterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TidbClusterStatus.
func (*TidbClusterStatus) DeepCopyInto ¶
func (in *TidbClusterStatus) DeepCopyInto(out *TidbClusterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.