v1beta1

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package v1beta1 contains API Schema definitions for the moco.cybozu.com v1beta1 API group +kubebuilder:object:generate=true +groupName=moco.cybozu.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "moco.cybozu.com", Version: "v1beta1"}

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

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

	Spec   MySQLClusterSpec   `json:"spec,omitempty"`
	Status MySQLClusterStatus `json:"status,omitempty"`
}

MySQLCluster is the Schema for the mysqlclusters API

func (*MySQLCluster) CertificateName added in v0.8.2

func (r *MySQLCluster) CertificateName() string

CertificateName returns the name of Certificate issued for moco-agent gRPC server. The Certificate will be created in the namespace of the controller.

This is also the Secret name created from the Certificate.

func (*MySQLCluster) ControllerSecretName

func (r *MySQLCluster) ControllerSecretName() string

ControllerSecretName returns the name of the Secret for MOCO controller. This Secret is placed in the namespace of the controller.

func (*MySQLCluster) DeepCopy

func (in *MySQLCluster) DeepCopy() *MySQLCluster

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

func (*MySQLCluster) DeepCopyInto

func (in *MySQLCluster) DeepCopyInto(out *MySQLCluster)

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

func (*MySQLCluster) DeepCopyObject

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

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

func (*MySQLCluster) Default

func (r *MySQLCluster) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*MySQLCluster) GRPCSecretName added in v0.8.2

func (r *MySQLCluster) GRPCSecretName() string

GRPCSecretName returns the name of Secret of TLS server certificate for moco-agent. The Secret will be created in the MySQLCluster namespace.

func (*MySQLCluster) HeadlessServiceName

func (r *MySQLCluster) HeadlessServiceName() string

HeadlessServiceName returns the name of Service for StatefulSet.

func (*MySQLCluster) MyCnfSecretName

func (r *MySQLCluster) MyCnfSecretName() string

MyCnfSecretName returns the name of the Secret for users. The contents are formatted for mysql commands (as my.cnf).

func (*MySQLCluster) PodHostname

func (r *MySQLCluster) PodHostname(index int) string

PodHostname returns the hostname of a Pod with the given index.

func (*MySQLCluster) PodName

func (r *MySQLCluster) PodName(index int) string

PodName returns PrefixedName() + "-" + index

func (*MySQLCluster) PrefixedName

func (r *MySQLCluster) PrefixedName() string

PrefixedName returns "moco-<<metadata.name>>"

func (*MySQLCluster) PrimaryServiceName

func (r *MySQLCluster) PrimaryServiceName() string

PrimaryServiceName returns the name of Service for the primary mysqld instance.

func (*MySQLCluster) ReplicaServiceName

func (r *MySQLCluster) ReplicaServiceName() string

ReplicaServiceName returns the name of Service for replica mysqld instances.

func (*MySQLCluster) SetupWebhookWithManager

func (r *MySQLCluster) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*MySQLCluster) SlowQueryLogAgentConfigMapName

func (r *MySQLCluster) SlowQueryLogAgentConfigMapName() string

SlowQueryLogAgentConfigMapName returns the name of the slow query log agent config name.

func (*MySQLCluster) UserSecretName

func (r *MySQLCluster) UserSecretName() string

UserSecretName returns the name of the Secret for users. This Secret is placed in the same namespace as r.

func (*MySQLCluster) ValidateCreate

func (r *MySQLCluster) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*MySQLCluster) ValidateDelete

func (r *MySQLCluster) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*MySQLCluster) ValidateUpdate

func (r *MySQLCluster) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type MySQLClusterCondition

type MySQLClusterCondition struct {
	// Type is the type of the condition.
	Type MySQLClusterConditionType `json:"type"`

	// Status is the status of the condition.
	Status corev1.ConditionStatus `json:"status"`

	// Reason is a one-word CamelCase reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`

	// Message is a human-readable message indicating details about last transition.
	// +optional
	Message string `json:"message,omitempty"`

	// LastTransitionTime is the last time the condition transits from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime"`
}

MySQLClusterCondition defines the condition of MySQLCluster.

func (*MySQLClusterCondition) DeepCopy

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

func (*MySQLClusterCondition) DeepCopyInto

func (in *MySQLClusterCondition) DeepCopyInto(out *MySQLClusterCondition)

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

type MySQLClusterConditionType

type MySQLClusterConditionType string

MySQLClusterConditionType is the type of MySQLCluster condition. +kubebuilder:validation:Enum=Initialized;Available;Healthy

const (
	ConditionInitialized MySQLClusterConditionType = "Initialized"
	ConditionAvailable   MySQLClusterConditionType = "Available"
	ConditionHealthy     MySQLClusterConditionType = "Healthy"
)

Valid values for MySQLClusterConditionType

type MySQLClusterList

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

MySQLClusterList contains a list of MySQLCluster

func (*MySQLClusterList) DeepCopy

func (in *MySQLClusterList) DeepCopy() *MySQLClusterList

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

func (*MySQLClusterList) DeepCopyInto

func (in *MySQLClusterList) DeepCopyInto(out *MySQLClusterList)

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

func (*MySQLClusterList) DeepCopyObject

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

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

type MySQLClusterSpec

type MySQLClusterSpec struct {

	// Replicas is the number of instances. Available values are 1, 3, and 5.
	// +kubebuilder:validation:Enum=1;3;5
	// +kubebuilder:default=1
	// +optional
	Replicas int32 `json:"replicas,omitempty"`

	// PodTemplate is a `Pod` template for MySQL server container.
	PodTemplate PodTemplateSpec `json:"podTemplate"`

	// VolumeClaimTemplates is a list of `PersistentVolumeClaim` templates for MySQL server container.
	// A claim named "mysql-data" must be included in the list.
	// +kubebuilder:validation:MinItems=1
	VolumeClaimTemplates []PersistentVolumeClaim `json:"volumeClaimTemplates"`

	// ServiceTemplate is a `Service` template for both primary and replicas.
	// +optional
	ServiceTemplate *ServiceTemplate `json:"serviceTemplate,omitempty"`

	// MySQLConfigMapName is a `ConfigMap` name of MySQL config.
	// +optional
	MySQLConfigMapName *string `json:"mysqlConfigMapName,omitempty"`

	// ReplicationSourceSecretName is a `Secret` name which contains replication source info.
	// If this field is given, the `MySQLCluster` works as an intermediate primary.
	// +optional
	ReplicationSourceSecretName *string `json:"replicationSourceSecretName,omitempty"`

	// Collectors is the list of collector flag names of mysqld_exporter.
	// If this field is not empty, MOCO adds mysqld_exporter as a sidecar to collect
	// and export mysqld metrics in Prometheus format.
	//
	// See https://github.com/prometheus/mysqld_exporter/blob/master/README.md#collector-flags for flag names.
	//
	// Example: ["engine_innodb_status", "info_schema.innodb_metrics"]
	// +optional
	Collectors []string `json:"collectors,omitempty"`

	// ServerIDBase, if set, will become the base number of server-id of each MySQL
	// instance of this cluster.  For example, if this is 100, the server-ids will be
	// 100, 101, 102, and so on.
	// If the field is not given or zero, MOCO automatically sets a random positive integer.
	// +optional
	ServerIDBase int32 `json:"serverIDBase,omitempty"`

	// MaxDelaySeconds, if set, configures the readiness probe of mysqld container.
	// For a replica mysqld instance, if it is delayed to apply transactions over this threshold,
	// the mysqld instance will be marked as non-ready.
	// The default is 60 seconds.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MaxDelaySeconds int `json:"maxDelaySeconds,omitempty"`

	// StartupWaitSeconds is the maximum duration to wait for `mysqld` container to start working.
	// The default is 3600 seconds.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:default=3600
	// +optional
	StartupWaitSeconds int32 `json:"startupDelaySeconds,omitempty"`

	// LogRotationSchedule specifies the schedule to rotate MySQL logs.
	// If not set, the default is to rotate logs every 5 minutes.
	// See https://pkg.go.dev/github.com/robfig/cron?#hdr-CRON_Expression_Format for the field format.
	// +optional
	LogRotationSchedule string `json:"logRotationSchedule,omitempty"`

	// Restore is the specification to perform Point-in-Time-Recovery from existing cluster.
	// If this field is not null, MOCO restores the data as specified and create a new
	// cluster with the data.  This field is not editable.
	// +optional
	Restore *RestoreSpec `json:"restore,omitempty"`

	// DisableSlowQueryLogContainer controls whether to add a sidecar container named "slow-log"
	// to output slow logs as the containers output.
	// If set to true, the sidecar container is not added. The default is false.
	// +optional
	DisableSlowQueryLogContainer bool `json:"disableSlowQueryLogContainer,omitempty"`
}

MySQLClusterSpec defines the desired state of MySQLCluster

func (*MySQLClusterSpec) DeepCopy

func (in *MySQLClusterSpec) DeepCopy() *MySQLClusterSpec

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

func (*MySQLClusterSpec) DeepCopyInto

func (in *MySQLClusterSpec) DeepCopyInto(out *MySQLClusterSpec)

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

type MySQLClusterStatus

type MySQLClusterStatus struct {

	// Conditions is an array of conditions.
	// +optional
	Conditions []MySQLClusterCondition `json:"conditions,omitempty"`

	// CurrentPrimaryIndex is the index of the current primary Pod in StatefulSet.
	// Initially, this is zero.
	CurrentPrimaryIndex int `json:"currentPrimaryIndex"`

	// SyncedReplicas is the number of synced instances including the primary.
	// +optional
	SyncedReplicas int `json:"syncedReplicas,omitempty"`

	// ErrantReplicas is the number of instances that have errant transactions.
	// +optional
	ErrantReplicas int `json:"errantReplicas,omitempty"`

	// ErrantReplicaList is the list of indices of errant replicas.
	// +optional
	ErrantReplicaList []int `json:"errantReplicaList,omitempty"`

	// ReconcileInfo represents version information for reconciler.
	// +optional
	ReconcileInfo ReconcileInfo `json:"reconcileInfo"`
}

MySQLClusterStatus defines the observed state of MySQLCluster

func (*MySQLClusterStatus) DeepCopy

func (in *MySQLClusterStatus) DeepCopy() *MySQLClusterStatus

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

func (*MySQLClusterStatus) DeepCopyInto

func (in *MySQLClusterStatus) DeepCopyInto(out *MySQLClusterStatus)

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

type ObjectMeta

type ObjectMeta struct {
	// Name is the name of the object.
	// +optional
	Name string `json:"name,omitempty"`

	// Labels is a map of string keys and values.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// Annotations is a map of string keys and values.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
}

ObjectMeta is metadata of objects. This is partially copied from metav1.ObjectMeta.

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 PersistentVolumeClaim

type PersistentVolumeClaim struct {
	// Standard object's metadata.
	ObjectMeta `json:"metadata"`

	// Spec defines the desired characteristics of a volume requested by a pod author.
	Spec corev1.PersistentVolumeClaimSpec `json:"spec"`
}

PersistentVolumeClaim is a user's request for and claim to a persistent volume. This is slightly modified from corev1.PersistentVolumeClaim.

func (*PersistentVolumeClaim) DeepCopy

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

func (*PersistentVolumeClaim) DeepCopyInto

func (in *PersistentVolumeClaim) DeepCopyInto(out *PersistentVolumeClaim)

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

func (PersistentVolumeClaim) ToCoreV1

type PodTemplateSpec

type PodTemplateSpec struct {
	// Standard object's metadata.  The name in this metadata is ignored.
	// +optional
	ObjectMeta `json:"metadata,omitempty"`

	// Specification of the desired behavior of the pod.
	// The name of the MySQL server container in this spec must be `mysqld`.
	Spec corev1.PodSpec `json:"spec"`
}

PodTemplateSpec describes the data a pod should have when created from a template. This is slightly modified from corev1.PodTemplateSpec.

func (*PodTemplateSpec) DeepCopy

func (in *PodTemplateSpec) DeepCopy() *PodTemplateSpec

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

func (*PodTemplateSpec) DeepCopyInto

func (in *PodTemplateSpec) DeepCopyInto(out *PodTemplateSpec)

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

type ReconcileInfo

type ReconcileInfo struct {
	// Generation is the `metadata.generation` value of the last reconciliation.
	// See also https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#status-subresource
	// +optional
	Generation int64 `json:"generation,omitempty"`

	// ReconcileVersion is the version of the operator reconciler.
	// +optional
	ReconcileVersion int `json:"reconcileVersion"`
}

func (*ReconcileInfo) DeepCopy

func (in *ReconcileInfo) DeepCopy() *ReconcileInfo

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

func (*ReconcileInfo) DeepCopyInto

func (in *ReconcileInfo) DeepCopyInto(out *ReconcileInfo)

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

type RestoreSpec

type RestoreSpec struct {
}

RestoreSpec defines the desired spec of Point-in-Time-Recovery TBD

func (*RestoreSpec) DeepCopy

func (in *RestoreSpec) DeepCopy() *RestoreSpec

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

func (*RestoreSpec) DeepCopyInto

func (in *RestoreSpec) DeepCopyInto(out *RestoreSpec)

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

type ServiceTemplate

type ServiceTemplate struct {
	// Standard object's metadata.  Only `annotations` and `labels` are valid.
	// +optional
	ObjectMeta `json:"metadata,omitempty"`

	// Spec is the ServiceSpec
	// +optional
	Spec *corev1.ServiceSpec `json:"spec,omitempty"`
}

ServiceTemplate defines the desired spec and annotations of Service

func (*ServiceTemplate) DeepCopy

func (in *ServiceTemplate) DeepCopy() *ServiceTemplate

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

func (*ServiceTemplate) DeepCopyInto

func (in *ServiceTemplate) DeepCopyInto(out *ServiceTemplate)

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