v1alpha1

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
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

View Source
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
)
View Source
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"`
	ImagePullPolicy corev1.PullPolicy    `json:"imagePullPolicy,omitempty"`
	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

func (in *PDMember) DeepCopy() *PDMember

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

func (*PDMember) DeepCopyInto

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

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

type 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

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 {
	Synced         bool                       `json:"synced,omitempty"`
	Phase          MemberPhase                `json:"phase,omitempty"`
	StatefulSet    *apps.StatefulSetStatus    `json:"statefulSet,omitempty"`
	Members        map[string]PDMember        `json:"members,omitempty"`
	Leader         PDMember                   `json:"leader,omitempty"`
	FailureMembers map[string]PDFailureMember `json:"failureMembers,omitempty"`
}

PDStatus is PD status

func (*PDStatus) DeepCopy

func (in *PDStatus) DeepCopy() *PDStatus

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

func (*PDStatus) DeepCopyInto

func (in *PDStatus) DeepCopyInto(out *PDStatus)

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

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

type Service struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

Service represent service type used in TidbCluster

func (*Service) DeepCopy

func (in *Service) DeepCopy() *Service

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

func (*Service) DeepCopyInto

func (in *Service) DeepCopyInto(out *Service)

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

type 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"`
	BinlogEnabled        bool                `json:"binlogEnabled,omitempty"`
}

TiDBSpec contains details of PD member

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 {
	Phase                    MemberPhase                  `json:"phase,omitempty"`
	StatefulSet              *apps.StatefulSetStatus      `json:"statefulSet,omitempty"`
	Members                  map[string]TiDBMember        `json:"members,omitempty"`
	FailureMembers           map[string]TiDBFailureMember `json:"failureMembers,omitempty"`
	ResignDDLOwnerRetryCount int32                        `json:"resignDDLOwnerRetryCount,omitempty"`
}

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

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 {
	Synced          bool                        `json:"synced,omitempty"`
	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"`
	LeaderCount       int32       `json:"leaderCount"`
	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

func (in *TiKVStore) DeepCopy() *TiKVStore

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

func (*TiKVStore) DeepCopyInto

func (in *TiKVStore) DeepCopyInto(out *TiKVStore)

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

type 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) PDAllMembersReady added in v0.2.1

func (tc *TidbCluster) PDAllMembersReady() bool

func (*TidbCluster) PDAllPodsStarted added in v0.2.1

func (tc *TidbCluster) PDAllPodsStarted() bool

func (*TidbCluster) PDAutoFailovering added in v0.2.1

func (tc *TidbCluster) PDAutoFailovering() bool

func (*TidbCluster) PDRealReplicas added in v0.2.1

func (tc *TidbCluster) PDRealReplicas() int32

func (*TidbCluster) PDUpgrading

func (tc *TidbCluster) PDUpgrading() bool

func (*TidbCluster) TiDBAllMembersReady added in v0.2.1

func (tc *TidbCluster) TiDBAllMembersReady() bool

func (*TidbCluster) TiDBAllPodsStarted added in v0.2.1

func (tc *TidbCluster) TiDBAllPodsStarted() bool

func (*TidbCluster) TiDBRealReplicas added in v0.2.1

func (tc *TidbCluster) TiDBRealReplicas() int32

func (*TidbCluster) TiKVAllPodsStarted added in v0.2.1

func (tc *TidbCluster) TiKVAllPodsStarted() bool

func (*TidbCluster) TiKVAllStoresReady added in v0.2.1

func (tc *TidbCluster) TiKVAllStoresReady() bool

func (*TidbCluster) TiKVRealReplicas added in v0.2.1

func (tc *TidbCluster) TiKVRealReplicas() int32

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"`
	Timezone        string                               `json:"timezone,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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL