v1alpha1

package
v0.0.0-...-9e299b5 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the bcrds v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=bcrds.cmss.com

Package v1alpha1 contains API Schema definitions for the bcrds v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=bcrds.cmss.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "bcrds.cmss.com", Version: "v1alpha1"}

	// 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
)

Functions

func Resource

func Resource(resource string) schema.GroupResource

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

Types

type ClusterPhase

type ClusterPhase string

ClusterPhase is the current state of tidb

const (
	// Creating represents normal state of cluster.
	PhaseCreating ClusterPhase = "Creating"
	// Indicates cluster is being recovering or going to recover.
	PhaseRecovering ClusterPhase = "Recovering"
	// PhaseAvailable indicates that the cluster status is normal and available
	PhaseAvailable ClusterPhase = "Available"
	// Unavailable represents the scaling state of cluster.
	PhaseUnavailable ClusterPhase = "Unavailable"
	// PhaseFailed indicates that the cluster completely failed, unable to recover
	PhaseFailed ClusterPhase = "Failed"
)

type ConditionType

type ConditionType string

ConditionType represents a cluster condition value.

const (
	// Ready indicates that the cluster is ready or not.
	// This is defined as:
	// - All Components reach usable level
	// todo: add condition type
	Ready ConditionType = "Ready"

	// TiDBInitial: waiting tidb initial successful,
	// status.phase will still be Creating if condition exist TiDBInitial type
	TiDBInitial  ConditionType = "TiDBInitial"
	TiDBRestart  ConditionType = "TiDBRestart"
	TiDBSilence  ConditionType = "TiDBSilence"
	TiDBReadonly ConditionType = "TiDBReadonly"
)

type MaxValue

type MaxValue struct {
	Metric    `json:",inline"`
	Component Storage `json:"component,omitempty"`
}

func (*MaxValue) DeepCopy

func (in *MaxValue) DeepCopy() *MaxValue

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

func (*MaxValue) DeepCopyInto

func (in *MaxValue) DeepCopyInto(out *MaxValue)

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

type Metric

type Metric struct {
	HashRate string `json:"hashRate,omitempty"`
}

func (*Metric) DeepCopy

func (in *Metric) DeepCopy() *Metric

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

func (*Metric) DeepCopyInto

func (in *Metric) DeepCopyInto(out *Metric)

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

type PeriodType

type PeriodType string
const (
	CUSTOMIZE PeriodType = ""
	DAY       PeriodType = "day"
	WEEK      PeriodType = "week"
	MONTH     PeriodType = "month"
)

type PortName

type PortName string
const (
	Prometheus PortName = "Prometheus"
	TiDBServer PortName = "TiDBServer"
)

type Proxy

type Proxy struct {
	// Defaults to "0".
	// +optional
	// +kubebuilder:default=0
	SilentPeriod string `json:"silentPeriod,omitempty"`
}

func (*Proxy) DeepCopy

func (in *Proxy) DeepCopy() *Proxy

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

func (*Proxy) DeepCopyInto

func (in *Proxy) DeepCopyInto(out *Proxy)

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

type Rule

type Rule struct {
	StartTime *metav1.Time `json:"startTime,omitempty"`
	EndTime   *metav1.Time `json:"endTime,omitempty"`
	Metric    Metric       `json:"metric,omitempty"`
	Period    PeriodType   `json:"period,omitempty"`
}

func (*Rule) DeepCopy

func (in *Rule) DeepCopy() *Rule

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

func (*Rule) DeepCopyInto

func (in *Rule) DeepCopyInto(out *Rule)

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

type ServerlessDB

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

	Spec   ServerlessDBSpec   `json:"spec"`
	Status ServerlessDBStatus `json:"status"`
}

ServerlessDB is the Schema for the serverlessdbs API +kubebuilder:subresource:status +kubebuilder:resource:path=serverlessdbs,scope=Namespaced

func (*ServerlessDB) DeepCopy

func (in *ServerlessDB) DeepCopy() *ServerlessDB

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

func (*ServerlessDB) DeepCopyInto

func (in *ServerlessDB) DeepCopyInto(out *ServerlessDB)

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

func (*ServerlessDB) DeepCopyObject

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

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

type ServerlessDBCondition

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

ServerlessDBCondition describes the state of a cluster at a certain point.

func (*ServerlessDBCondition) DeepCopy

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

func (*ServerlessDBCondition) DeepCopyInto

func (in *ServerlessDBCondition) DeepCopyInto(out *ServerlessDBCondition)

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

type ServerlessDBList

type ServerlessDBList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []ServerlessDB `json:"items"`
}

ServerlessDBList contains a list of ServerlessDB

func (*ServerlessDBList) DeepCopy

func (in *ServerlessDBList) DeepCopy() *ServerlessDBList

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

func (*ServerlessDBList) DeepCopyInto

func (in *ServerlessDBList) DeepCopyInto(out *ServerlessDBList)

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

func (*ServerlessDBList) DeepCopyObject

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

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

type ServerlessDBSpec

type ServerlessDBSpec struct {

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

	// Prevent external connections to tidb server
	// +optional
	Freeze bool `json:"freeze,omitempty"`

	// +optional
	// +kubebuilder:default=IfNotPresent
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy"`

	Proxy    Proxy    `json:"proxy,omitempty"`
	MaxValue MaxValue `json:"maxValue,omitempty"`

	// Indicates that the tiflash cluster is used and will not be processed by
	// the controller.
	// +optional
	UseTiFlash bool   `json:"useTiFlash,omitempty"`
	ScaleOut   string `json:"scaleOut,omitempty"`
	ScaleIn    string `json:"scaleIn,omitempty"`

	RateOfScaleDown string `json:"rateOfScaleDown,omitempty"`
	TimeToScaleDown string `json:"timeToScaleDown,omitempty"`

	NormalResource corev1.ResourceRequirements `json:"normalResource,omitempty"`
	MinResource    corev1.ResourceRequirements `json:"minResource,omitempty"`

	Rule map[string]Rule `json:"rule,omitempty"`
}

ServerlessDBSpec defines the desired state of ServerlessDB +k8s:openapi-gen=true

func (*ServerlessDBSpec) DeepCopy

func (in *ServerlessDBSpec) DeepCopy() *ServerlessDBSpec

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

func (*ServerlessDBSpec) DeepCopyInto

func (in *ServerlessDBSpec) DeepCopyInto(out *ServerlessDBSpec)

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

type ServerlessDBStatus

type ServerlessDBStatus struct {
	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
	// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
	// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
	// Rule is the Currently triggered rule
	Rule []string `json:"rule,omitempty"`

	// Represents the latest phase
	Phase ClusterPhase `json:"phase,omitempty"`

	// Node port for sldb
	NodePort map[PortName]int32 `json:"nodePort,omitempty"`

	// storage usage
	StorageUsage map[StorageUse]resource.Quantity `json:"storageUsage,omitempty"`

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

ServerlessDBStatus defines the observed state of ServerlessDB

func (*ServerlessDBStatus) DeepCopy

func (in *ServerlessDBStatus) DeepCopy() *ServerlessDBStatus

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

func (*ServerlessDBStatus) DeepCopyInto

func (in *ServerlessDBStatus) DeepCopyInto(out *ServerlessDBStatus)

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

type Storage

type Storage struct {
	// StorageSize is the request storage size for backup job
	StorageType StorageType `json:"type,omitempty"`
	// The storageClassName of the persistent volume for Backup data storage.
	// Defaults to Kubernetes default storage class.
	// +optional
	StorageClassName *string `json:"storageClassName,omitempty"`
	// StorageSize is the request storage size
	StorageSize string `json:"storageSize,omitempty"`
}

func (*Storage) DeepCopy

func (in *Storage) DeepCopy() *Storage

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

func (*Storage) DeepCopyInto

func (in *Storage) DeepCopyInto(out *Storage)

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

type StorageType

type StorageType string
const (
	CLOUD StorageType = "cloud"
	LOCAL StorageType = "local"
)

type StorageUse

type StorageUse string
const (
	TiKVSingleStoreMax  StorageUse = "TiKVSingleStoreMax"
	TiKVTotalStoreUsage StorageUse = "TiKVTotalStoreUsage"
)

Jump to

Keyboard shortcuts

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