v1

package
v0.0.0-...-0bc0e99 Latest Latest
Warning

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

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

Documentation

Overview

Package v1 contains API Schema definitions for the mysql v1 API group +kubebuilder:object:generate=true +groupName=mysql.radondb.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "mysql.radondb.io", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type Cluster

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

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

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.readyNodes +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type == 'Ready')].status",description="The cluster status" +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".spec.replicas",description="The number of desired nodes" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:resource:shortName=mysql Cluster is the Schema for the clusters API

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 ClusterCondition

type ClusterCondition struct {
	// type of cluster condition, values in (\"Ready\")
	Type ClusterConditionType `json:"type"`
	// Status of the condition, one of (\"True\", \"False\", \"Unknown\")
	Status corev1.ConditionStatus `json:"status"`

	// LastTransitionTime
	LastTransitionTime metav1.Time `json:"lastTransitionTime"`
	// Reason
	Reason string `json:"reason,omitempty"`
	// Message
	Message string `json:"message,omitempty"`
}

ClusterCondition defines type for cluster conditions.

func (*ClusterCondition) DeepCopy

func (in *ClusterCondition) DeepCopy() *ClusterCondition

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

func (*ClusterCondition) DeepCopyInto

func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition)

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

type ClusterConditionType

type ClusterConditionType string
const (
	ClusterInit  ClusterConditionType = "Initializing"
	ClusterReady ClusterConditionType = "Ready"
	ClusterError ClusterConditionType = "Error"
)

type ClusterList

type ClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Cluster `json:"items"`
}

ClusterList contains a list of Cluster

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 ClusterSpec

type ClusterSpec struct {

	// Replicas is the number of pods.
	// +optional
	// +kubebuilder:validation:Enum=0;2;3;5
	// +kubebuilder:default:=3
	Replicas *int32 `json:"replicas,omitempty"`

	// MysqlOpts is the options of MySQL container.
	// +optional
	// +kubebuilder:default:={rootPassword: "", user: "qc_usr", password: "Qing@123", database: "qingcloud", initTokuDB: true, resources: {limits: {cpu: "500m", memory: "1Gi"}, requests: {cpu: "100m", memory: "256Mi"}}}
	MysqlOpts MysqlOpts `json:"mysqlOpts,omitempty"`

	// XenonOpts is the options of xenon container.
	// +optional
	// +kubebuilder:default:={image: "zhyass/xenon:1.1.5-alpha", admitDefeatHearbeatCount: 5, electionTimeout: 10000, resources: {limits: {cpu: "100m", memory: "256Mi"}, requests: {cpu: "50m", memory: "128Mi"}}}
	XenonOpts XenonOpts `json:"xenonOpts,omitempty"`

	// +optional
	// +kubebuilder:default:={image: "prom/mysqld-exporter:v0.12.1", resources: {limits: {cpu: "100m", memory: "128Mi"}, requests: {cpu: "10m", memory: "32Mi"}}, enabled: false}
	MetricsOpts MetricsOpts `json:"metricsOpts,omitempty"`

	// Represents the MySQL version that will be run. The available version can be found here:
	// This field should be set even if the Image is set to let the operator know which mysql version is running.
	// Based on this version the operator can take decisions which features can be used.
	// +optional
	// +kubebuilder:default:="5.7"
	MysqlVersion string `json:"mysqlVersion,omitempty"`

	// Pod extra specification
	// +optional
	// +kubebuilder:default:={imagePullPolicy: "IfNotPresent", resources: {requests: {cpu: "10m", memory: "32Mi"}}, sidecarImage: "zhyass/sidecar:0.1", busyboxImage: "busybox:1.32"}
	PodSpec PodSpec `json:"podSpec,omitempty"`

	// PVC extra specifiaction
	// +optional
	// +kubebuilder:default:={enabled: true, accessModes: {"ReadWriteOnce"}, size: "10Gi"}
	Persistence Persistence `json:"persistence,omitempty"`
}

ClusterSpec defines the desired state of Cluster

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 {

	// ReadyNodes represents number of the nodes that are in ready state
	ReadyNodes int                  `json:"readyNodes,omitempty"`
	State      ClusterConditionType `json:"state,omitempty"`
	// Conditions contains the list of the cluster conditions fulfilled
	Conditions []ClusterCondition `json:"conditions,omitempty"`
	Nodes      []NodeStatus       `json:"nodes,omitempty"`
}

ClusterStatus defines the observed state of Cluster

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 MetricsOpts

type MetricsOpts struct {
	// +optional
	// +kubebuilder:default:="prom/mysqld-exporter:v0.12.1"
	Image string `json:"image,omitempty"`

	// +optional
	// +kubebuilder:default:={limits: {cpu: "100m", memory: "128Mi"}, requests: {cpu: "10m", memory: "32Mi"}}
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// +optional
	// +kubebuilder:default:=false
	Enabled bool `json:"enabled,omitempty"`
}

func (*MetricsOpts) DeepCopy

func (in *MetricsOpts) DeepCopy() *MetricsOpts

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

func (*MetricsOpts) DeepCopyInto

func (in *MetricsOpts) DeepCopyInto(out *MetricsOpts)

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

type MysqlConf

type MysqlConf map[string]intstr.IntOrString

MysqlConf defines type for extra cluster configs. It's a simple map between string and string.

func (MysqlConf) DeepCopy

func (in MysqlConf) DeepCopy() MysqlConf

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

func (MysqlConf) DeepCopyInto

func (in MysqlConf) DeepCopyInto(out *MysqlConf)

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

type MysqlOpts

type MysqlOpts struct {
	// Password for the root user.
	// +optional
	// +kubebuilder:default:=""
	RootPassword string `json:"rootPassword,omitempty"`

	// Username of new user to create.
	// +optional
	// +kubebuilder:default:="qc_usr"
	User string `json:"user,omitempty"`

	// Password for the new user.
	// +optional
	// +kubebuilder:default:="Qing@123"
	Password string `json:"password,omitempty"`

	// Name for new database to create.
	// +optional
	// +kubebuilder:default:="qingcloud"
	Database string `json:"database,omitempty"`

	// Install tokudb engine.
	// +optional
	// +kubebuilder:default:=true
	InitTokuDB bool `json:"initTokuDB,omitempty"`

	// A map[string]string that will be passed to my.cnf file.
	// +optional
	MysqlConf MysqlConf `json:"mysqlConf,omitempty"`

	// +optional
	// +kubebuilder:default:={limits: {cpu: "500m", memory: "1Gi"}, requests: {cpu: "100m", memory: "256Mi"}}
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

MysqlOpts defines the options of MySQL container.

func (*MysqlOpts) DeepCopy

func (in *MysqlOpts) DeepCopy() *MysqlOpts

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

func (*MysqlOpts) DeepCopyInto

func (in *MysqlOpts) DeepCopyInto(out *MysqlOpts)

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

type NodeCondition

type NodeCondition struct {
	Type               NodeConditionType      `json:"type"`
	Status             corev1.ConditionStatus `json:"status"`
	LastTransitionTime metav1.Time            `json:"lastTransitionTime"`
}

NodeCondition defines type for representing node conditions.

func (*NodeCondition) DeepCopy

func (in *NodeCondition) DeepCopy() *NodeCondition

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

func (*NodeCondition) DeepCopyInto

func (in *NodeCondition) DeepCopyInto(out *NodeCondition)

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

type NodeConditionType

type NodeConditionType string

NodeConditionType defines type for node condition type.

const (
	// NodeConditionLagged represents if the node is lagged.
	NodeConditionLagged NodeConditionType = "Lagged"
	// NodeConditionLeader represents if the node is leader or not.
	NodeConditionLeader NodeConditionType = "Leader"
	// NodeConditionReadOnly repesents if the node is read only or not
	NodeConditionReadOnly NodeConditionType = "ReadOnly"
	// NodeConditionReplicating represents if the node is replicating or not.
	NodeConditionReplicating NodeConditionType = "Replicating"
)

type NodeStatus

type NodeStatus struct {
	Name       string          `json:"name"`
	Message    string          `json:"message,omitempty"`
	Conditions []NodeCondition `json:"conditions,omitempty"`
}

NodeStatus defines type for status of a node into cluster.

func (*NodeStatus) DeepCopy

func (in *NodeStatus) DeepCopy() *NodeStatus

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

func (*NodeStatus) DeepCopyInto

func (in *NodeStatus) DeepCopyInto(out *NodeStatus)

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

type Persistence

type Persistence struct {
	// +optional
	// +kubebuilder:default:=true
	Enabled bool `json:"enabled,omitempty"`

	// AccessModes contains the desired access modes the volume should have.
	// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
	// +optional
	// +kubebuilder:default:={"ReadWriteOnce"}
	AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"`

	// Name of the StorageClass required by the claim.
	// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
	// +optional
	StorageClass *string `json:"storageClass,omitempty"`

	// +optional
	// +kubebuilder:default:="10Gi"
	Size string `json:"size,omitempty"`
}

Persistence is the desired spec for storing mysql data. Only one of its members may be specified.

func (*Persistence) DeepCopy

func (in *Persistence) DeepCopy() *Persistence

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

func (*Persistence) DeepCopyInto

func (in *Persistence) DeepCopyInto(out *Persistence)

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

type PodSpec

type PodSpec struct {
	// +kubebuilder:validation:Enum=Always;IfNotPresent;Never
	// +kubebuilder:default:="IfNotPresent"
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	Labels            map[string]string   `json:"labels,omitempty"`
	Annotations       map[string]string   `json:"annotations,omitempty"`
	Affinity          *corev1.Affinity    `json:"affinity,omitempty"`
	PriorityClassName string              `json:"priorityClassName,omitempty"`
	Tolerations       []corev1.Toleration `json:"tolerations,omitempty"`
	SchedulerName     string              `json:"schedulerName,omitempty"`

	// +optional
	// +kubebuilder:default:={requests: {cpu: "10m", memory: "32Mi"}}
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// +optional
	// +kubebuilder:default:="zhyass/sidecar:0.1"
	SidecarImage string `json:"sidecarImage,omitempty"`

	// +optional
	// +kubebuilder:default:="busybox:1.32"
	BusyboxImage string `json:"busyboxImage,omitempty"`

	// +optional
	// +kubebuilder:default:=false
	SlowLogTail bool `json:"slowLogTail,omitempty"`

	// +optional
	// +kubebuilder:default:=false
	AuditLogTail bool `json:"auditLogTail,omitempty"`
}

PodSpec defines type for configure cluster pod spec.

func (*PodSpec) DeepCopy

func (in *PodSpec) DeepCopy() *PodSpec

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

func (*PodSpec) DeepCopyInto

func (in *PodSpec) DeepCopyInto(out *PodSpec)

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

type XenonOpts

type XenonOpts struct {
	// To specify the image that will be used for xenon container.
	// +optional
	// +kubebuilder:default:="zhyass/xenon:1.1.5-alpha"
	Image string `json:"image,omitempty"`

	// High available component admit defeat heartbeat count.
	// +optional
	// +kubebuilder:default:=5
	AdmitDefeatHearbeatCount *int32 `json:"admitDefeatHearbeatCount,omitempty"`

	// High available component election timeout. The unit is millisecond.
	// +optional
	// +kubebuilder:default:=10000
	ElectionTimeout *int32 `json:"electionTimeout,omitempty"`

	// +optional
	// +kubebuilder:default:={limits: {cpu: "100m", memory: "256Mi"}, requests: {cpu: "50m", memory: "128Mi"}}
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

XenonOpts defines the options of xenon container.

func (*XenonOpts) DeepCopy

func (in *XenonOpts) DeepCopy() *XenonOpts

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

func (*XenonOpts) DeepCopyInto

func (in *XenonOpts) DeepCopyInto(out *XenonOpts)

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