v1alpha1

package
Version: v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the mysql v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/presslabs/mysql-operator/pkg/apis/mysql +k8s:defaulter-gen=TypeMeta +groupName=mysql.presslabs.org

Package v1alpha1 contains API Schema definitions for the mysql v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/presslabs/mysql-operator/pkg/apis/mysql +k8s:defaulter-gen=TypeMeta +groupName=mysql.presslabs.org

Index

Constants

This section is empty.

Variables

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

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

Functions

func RegisterDefaults added in v0.2.0

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func SetDefaults_MysqlCluster added in v0.2.0

func SetDefaults_MysqlCluster(c *MysqlCluster)

SetDefaults_MysqlCluster sets the defaults for a mysqlcluster object nolint

func SetObjectDefaults_MysqlCluster added in v0.2.0

func SetObjectDefaults_MysqlCluster(in *MysqlCluster)

func SetObjectDefaults_MysqlClusterList added in v0.2.0

func SetObjectDefaults_MysqlClusterList(in *MysqlClusterList)

Types

type BackupCondition

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

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

BackupCondition defines condition struct for backup resource

func (*BackupCondition) DeepCopy

func (in *BackupCondition) DeepCopy() *BackupCondition

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

func (*BackupCondition) DeepCopyInto

func (in *BackupCondition) DeepCopyInto(out *BackupCondition)

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

type BackupConditionType

type BackupConditionType string

BackupConditionType defines condition types of a backup resources

const (
	// BackupComplete means the backup has finished his execution
	BackupComplete BackupConditionType = "Complete"
	// BackupFailed means backup has failed
	BackupFailed BackupConditionType = "Failed"
)

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 core.ConditionStatus `json:"status"`

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

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

ClusterConditionType defines type for cluster condition type.

const (
	// ClusterConditionReady represents the readiness of the cluster. This
	// condition is the same sa statefulset Ready condition.
	ClusterConditionReady ClusterConditionType = "Ready"
	// ClusterConditionFailoverAck represents if the cluster has pending ack in
	// orchestrator or not.
	ClusterConditionFailoverAck ClusterConditionType = "PendingFailoverAck"
	// ClusterConditionReadOnly describe cluster state if it's in read only or
	// writable.
	ClusterConditionReadOnly ClusterConditionType = "ReadOnly"
)

type MysqlBackup

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

	Spec   MysqlBackupSpec   `json:"spec,omitempty"`
	Status MysqlBackupStatus `json:"status,omitempty"`
}

MysqlBackup is the Schema for the mysqlbackups API +k8s:openapi-gen=true

func (*MysqlBackup) DeepCopy

func (in *MysqlBackup) DeepCopy() *MysqlBackup

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

func (*MysqlBackup) DeepCopyInto

func (in *MysqlBackup) DeepCopyInto(out *MysqlBackup)

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

func (*MysqlBackup) DeepCopyObject

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

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

type MysqlBackupList

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

MysqlBackupList contains a list of MysqlBackup

func (*MysqlBackupList) DeepCopy

func (in *MysqlBackupList) DeepCopy() *MysqlBackupList

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

func (*MysqlBackupList) DeepCopyInto

func (in *MysqlBackupList) DeepCopyInto(out *MysqlBackupList)

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

func (*MysqlBackupList) DeepCopyObject

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

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

type MysqlBackupSpec added in v0.2.0

type MysqlBackupSpec struct {
	// ClustterName represents the cluster for which to take backup
	ClusterName string `json:"clusterName"`

	// Specify an URI where to put the backup. This is deprecated and will be
	// removed in future releases. Use BackupURL instead.
	// +optional
	BackupURI string `json:"backupUri,omitempty"`

	// BackupURL represents the URL to the backup location, this can be
	// partially specifyied. Default is used the one specified in the cluster.
	// Is the same as backupURI.
	// +optional
	BackupURL string `json:"backupURL,omitempty"`

	// BackupSecretName the name of secrets that contains the credentials to
	// access the bucket. Default is used the secret specified in cluster.
	// optinal
	BackupSecretName string `json:"backupSecretName,omitempty"`
}

MysqlBackupSpec defines the desired state of MysqlBackup

func (*MysqlBackupSpec) DeepCopy added in v0.2.0

func (in *MysqlBackupSpec) DeepCopy() *MysqlBackupSpec

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

func (*MysqlBackupSpec) DeepCopyInto added in v0.2.0

func (in *MysqlBackupSpec) DeepCopyInto(out *MysqlBackupSpec)

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

type MysqlBackupStatus added in v0.2.0

type MysqlBackupStatus struct {
	// Complete marks the backup in final state
	Completed bool `json:"completed,omitempty"`

	// BackupURI represent the fully uri to the backup location This field is
	// deprecated and will be removed in future releases.
	BackupURI string `json:"backupUri,omitempty"`

	// Conditions represents the backup resource conditions list.
	Conditions []BackupCondition `json:"conditions,omitempty"`
}

MysqlBackupStatus defines the observed state of MysqlBackup

func (*MysqlBackupStatus) DeepCopy added in v0.2.0

func (in *MysqlBackupStatus) DeepCopy() *MysqlBackupStatus

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

func (*MysqlBackupStatus) DeepCopyInto added in v0.2.0

func (in *MysqlBackupStatus) DeepCopyInto(out *MysqlBackupStatus)

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

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 +k8s:openapi-gen=true +kubebuilder:subresource:status +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.readyNodes

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.

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 added in v0.2.0

type MysqlClusterSpec struct {
	// The number of pods. This updates replicas filed
	// Defaults to 0
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`
	// The secret name that contains connection information to initialize database, like
	// USER, PASSWORD, ROOT_PASSWORD and so on
	// This secret will be updated with DB_CONNECT_URL and some more configs.
	// Can be specified partially
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	SecretName string `json:"secretName"`

	// Represents the percona image tag.
	// Defaults to 5.7
	// +optional
	MysqlVersion string `json:"mysqlVersion,omitempty"`

	// A bucket URI that contains a xtrabackup to initialize the mysql database.
	// +optional
	InitBucketURI        string `json:"initBucketURI,omitempty"`
	InitBucketSecretName string `json:"initBucketSecretName,omitempty"`

	// The number of pods from that set that must still be available after the
	// eviction, even in the absence of the evicted pod
	// Defaults to 50%
	// +optional
	MinAvailable string `json:"minAvailable,omitempty"`

	// Specify under crontab format interval to take backups
	// leave it empty to deactivate the backup process
	// Defaults to ""
	// +optional
	BackupSchedule string `json:"backupSchedule,omitempty"`

	// Represents the location where to put backups.
	// DEPRECATED: use BackupURL instead. This field will be dropped in next
	// versions.
	// +optional
	BackupURI string `json:"backupUri,omitempty"`

	// Represents an URL to the location where to put backups. This field is the
	// same as backupUri.
	// +optional
	BackupURL string `json:"backupURL,omitempty"`

	// Represents the name of the secret that contains credentials to connect to
	// the storage provider to store backups.
	// +optional
	BackupSecretName string `json:"backupSecretName,omitempty"`

	// If set keeps last BackupScheduleJobsHistoryLimit Backups
	// +optional
	BackupScheduleJobsHistoryLimit *int `json:"backupScheduleJobsHistoryLimit,omitempty"`

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

	// Pod extra specification
	// +optional
	PodSpec PodSpec `json:"podSpec,omitempty"`

	// PVC extra specifiaction
	// +optional
	VolumeSpec VolumeSpec `json:"volumeSpec,omitempty"`

	// MaxSlaveLatency represents the allowed latency for a slave node in
	// seconds. If set then the node with a latency grater than this is removed
	// from service.
	// +optional
	MaxSlaveLatency *int64 `json:"maxSlaveLatency,omitempty"`

	// QueryLimits represents limits for a query
	// +optional
	QueryLimits *QueryLimits `json:"queryLimits,omitempty"`

	// Makes the cluster READ ONLY. Set the master to writable or ReadOnly
	// +optional
	ReadOnly bool `json:"readOnly,omitempty"`
}

MysqlClusterSpec defines the desired state of MysqlCluster nolint: maligned

func (*MysqlClusterSpec) DeepCopy added in v0.2.0

func (in *MysqlClusterSpec) DeepCopy() *MysqlClusterSpec

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

func (*MysqlClusterSpec) DeepCopyInto added in v0.2.0

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 added in v0.2.0

type MysqlClusterStatus struct {
	// ReadyNodes represents number of the nodes that are in ready state
	ReadyNodes int `json:"readyNodes,omitempty"`
	// Conditions contains the list of the cluster conditions fulfilled
	Conditions []ClusterCondition `json:"conditions,omitempty"`
	// Nodes contains informations from orchestrator
	Nodes []NodeStatus `json:"nodes,omitempty"`
}

MysqlClusterStatus defines the observed state of MysqlCluster

func (*MysqlClusterStatus) DeepCopy added in v0.2.0

func (in *MysqlClusterStatus) DeepCopy() *MysqlClusterStatus

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

func (*MysqlClusterStatus) DeepCopyInto added in v0.2.0

func (in *MysqlClusterStatus) DeepCopyInto(out *MysqlClusterStatus)

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

type MysqlConf

type MysqlConf map[string]string

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

func (MysqlConf) DeepCopy added in v0.2.0

func (in MysqlConf) DeepCopy() MysqlConf

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

func (MysqlConf) DeepCopyInto added in v0.2.0

func (in MysqlConf) DeepCopyInto(out *MysqlConf)

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

type NodeCondition added in v0.1.4

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

NodeCondition defines type for representing node conditions.

func (*NodeCondition) DeepCopy added in v0.1.4

func (in *NodeCondition) DeepCopy() *NodeCondition

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

func (*NodeCondition) DeepCopyInto added in v0.1.4

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 added in v0.1.4

type NodeConditionType string

NodeConditionType defines type for node condition type.

const (
	// NodeConditionLagged represents if the node is marked as lagged by
	// orchestrator.
	NodeConditionLagged NodeConditionType = "Lagged"
	// NodeConditionReplicating represents if the node is replicating or not.
	NodeConditionReplicating NodeConditionType = "Replicating"
	// NodeConditionMaster represents if the node is master or not.
	NodeConditionMaster NodeConditionType = "Master"
	// NodeConditionReadOnly repesents if the node is read only or not
	NodeConditionReadOnly NodeConditionType = "ReadOnly"
)

type NodeStatus added in v0.1.4

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

NodeStatus defines type for status of a node into cluster.

func (*NodeStatus) DeepCopy added in v0.1.4

func (in *NodeStatus) DeepCopy() *NodeStatus

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

func (*NodeStatus) DeepCopyInto added in v0.1.4

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

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

type PodSpec

type PodSpec struct {
	ImagePullPolicy  core.PullPolicy             `json:"imagePullPolicy,omitempty"`
	ImagePullSecrets []core.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	Labels       map[string]string         `json:"labels,omitempty"`
	Annotations  map[string]string         `json:"annotations,omitempty"`
	Resources    core.ResourceRequirements `json:"resources,omitempty"`
	Affinity     core.Affinity             `json:"affinity,omitempty"`
	NodeSelector map[string]string         `json:"nodeSelector,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 QueryLimits added in v0.1.11

type QueryLimits struct {
	// MaxIdleTime match queries that have been idle for longer then this time,
	// in seconds. (--idle-time flag)
	// + optional
	MaxIdleTime *int `json:"maxIdleTime,omitempty"`

	// MaxQueryTime match queries that have been running for longer then this
	// time, in seconds. This field is required. (--busy-time flag)
	MaxQueryTime int `json:"maxQueryTime"`

	// Kill represents the mode of which the matching queries in each class will
	// be killed, (the --victims flag). Can be one of oldest|all|all-but-oldest.
	// By default, the matching query with the highest Time value is killed (the
	// oldest query.
	// +optional
	Kill string `json:"kill,omitempty"`

	// KillMode can be: `connection` or `query`, when it's used `connection`
	// means that when a query is matched the connection is killed (using --kill
	// flag) and if it's used `query` means that the query is killed (using
	// --kill-query flag)
	// +optional
	KillMode string `json:"killMode,omitempty"`

	// IgnoreDb is the list of database that are ignored by pt-kill (--ignore-db
	// flag).
	// +optional
	IgnoreDb []string `json:"ignoreDb,omitempty"`

	// IgnoreCommands the list of commands to be ignored.
	// +optional
	IgnoreCommand []string `json:"ignoreCommands,omitempty"`

	// IgnoreUser the list of users to be ignored.
	// +optional
	IgnoreUser []string `json:"ignoreUser,omitempty"`
}

QueryLimits represents the pt-kill parameters, more info can be found here: https://www.percona.com/doc/percona-toolkit/LATEST/pt-kill.html

func (*QueryLimits) DeepCopy added in v0.1.11

func (in *QueryLimits) DeepCopy() *QueryLimits

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

func (*QueryLimits) DeepCopyInto added in v0.1.11

func (in *QueryLimits) DeepCopyInto(out *QueryLimits)

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

type VolumeSpec

type VolumeSpec struct {
	core.PersistentVolumeClaimSpec `json:",inline"`
}

VolumeSpec defines type for configure cluster pvc spec.

func (*VolumeSpec) DeepCopy

func (in *VolumeSpec) DeepCopy() *VolumeSpec

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

func (*VolumeSpec) DeepCopyInto

func (in *VolumeSpec) DeepCopyInto(out *VolumeSpec)

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