v1alpha1

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API. +groupName=mysql.presslabs.net

Index

Constants

View Source
const (
	KB int64 = 1 << (10 * iota)
	MB
	GB
)
View Source
const (
	// MysqlClusterKind is the kind of the crd that will be created.
	MysqlClusterKind = "MysqlCluster"
	// MysqlClusterPlural is the plural for mysqlcluster
	MysqlClusterPlural = "mysqlclusters"

	MysqlBackupKind   = "MysqlBackup"
	MysqlBackupPlural = "mysqlbackups"
)
View Source
const (
	EventReasonInitDefaults         = "InitDefaults"
	EventReasonInitDefaultsFailed   = "InitDefaultsFailed"
	EventReasonDbSecretUpdated      = "DbSecretUpdated"
	EventReasonDbSecretFailed       = "DbSecretFailed"
	EventReasonUtilitySecretFailed  = "UtilitySecretFailed"
	EventReasonUtilitySecretUpdated = "UtilitySecretUpdated"
	EventReasonConfigMapFailed      = "MysqlConfigMapFailed"
	EventReasonConfigMapUpdated     = "MysqlConfigMapUpdated"
	EventReasonServiceFailed        = "HLServiceFailed"
	EventReasonServiceUpdated       = "HLServiceUpdated"
	EventReasonSFSFailed            = "SFSFailed"
	EventReasonSFSUpdated           = "SFSUpdated"
	EventReasonCronJobFailed        = "CronJobFailed"
	EventReasonCronJobUpdated       = "CronJobUpdated"
)

Mysql events reason

View Source
const (
	EventNormal  = "Normal"
	EventWarning = "Warning"
)

Event types

Variables

View Source
var (
	// SchemeBuilder the scheme builder
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme function
	AddToScheme = SchemeBuilder.AddToScheme
	// SchemeGroupVersion ..
	SchemeGroupVersion = schema.GroupVersion{Group: groupName, Version: "v1alpha1"}
	// MysqlClusterCRDName the crd name
	MysqlClusterCRDName = MysqlClusterPlural + "." + groupName

	// MysqlBackupCRDName the crd name of backup resource
	MysqlBackupCRDName = MysqlBackupPlural + "." + groupName
)

Functions

func GetNameForResource added in v0.1.1

func GetNameForResource(name ResourceName, clusterName string) string

func Resource

func Resource(resource string) schema.GroupResource

Resource gets an MysqlCluster GroupResource for a specified resource

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

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

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
const (
	// BackupComplete means the backup has finished his execution
	BackupComplete BackupConditionType = "Complete"
	// BackupFailed means backup has failed
	BackupFailed BackupConditionType = "Failed"
)

type BackupSpec

type BackupSpec struct {
	// ClustterName represents the cluster for which to take backup
	ClusterName string `json:"clusterName"`
	// BucketUri a fully specified bucket URI where to put backup.
	// Default is used the one specified in cluster.
	// optional
	BackupUri string `json:"backupUri,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"`
}

func (*BackupSpec) DeepCopy

func (in *BackupSpec) DeepCopy() *BackupSpec

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

func (*BackupSpec) DeepCopyInto

func (in *BackupSpec) DeepCopyInto(out *BackupSpec)

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

type BackupStatus

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

	Conditions []BackupCondition `json:"conditions"`
}

func (*BackupStatus) DeepCopy

func (in *BackupStatus) DeepCopy() *BackupStatus

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

func (*BackupStatus) DeepCopyInto

func (in *BackupStatus) DeepCopyInto(out *BackupStatus)

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

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

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

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 (
	ClusterConditionReady        ClusterConditionType = "Ready"
	ClusterConditionInitDefaults ClusterConditionType = "InitDefaults"

	ClusterConditionConfig ClusterConditionType = "ConfigReady"
)

type ClusterSpec

type ClusterSpec struct {
	// The number of pods. This updates replicas filed
	// Defaults to 0
	// +optional
	Replicas int32 `json:"replicas"`
	// 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
	// Defaults is <name>-db-credentials (with random values)
	// +optional
	SecretName string `json:"secretName"`

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

	// A bucket URI that contains a xtrabackup to initialize the mysql database.
	// +optional
	InitBucketUri        string `json:"initBucketUri,omitempty"`
	InitBucketSecretName string `json:"initBucketSecretName,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"`
	BackupUri        string `json:"backupUri,omitempty"`
	BackupSecretName string `json:"backupSecretName,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 `json:"volumeSpec,omitempty"`
}

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.

func (*ClusterSpec) GetHelperImage

func (c *ClusterSpec) GetHelperImage() string

GetHelperImage return helper image from options

func (*ClusterSpec) GetMetricsExporterImage

func (c *ClusterSpec) GetMetricsExporterImage() string

GetMetricsExporterImage return helper image from options

func (*ClusterSpec) GetMysqlImage

func (c *ClusterSpec) GetMysqlImage() string

GetMysqlImage returns mysql image, composed from oprions and Spec.MysqlVersion

func (*ClusterSpec) GetOrcUri

func (c *ClusterSpec) GetOrcUri() string

GetOrcUri return the orchestrator uri

func (*ClusterSpec) UpdateDefaults

func (c *ClusterSpec) UpdateDefaults(opt *options.Options, cluster *MysqlCluster) error

UpdateDefaults updates Spec defaults

type ClusterStatus

type ClusterStatus struct {
	// ReadyNodes represents number of the nodes that are in ready state
	ReadyNodes int
	// Conditions contains the list of the cluster conditions fulfilled
	Conditions []ClusterCondition `json:"conditions"`
}

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 MysqlBackup

type MysqlBackup struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              BackupSpec   `json:"spec"`
	Status            BackupStatus `json:"status,omitempty"`
}

func (*MysqlBackup) AsOwnerReference

func (c *MysqlBackup) AsOwnerReference() metav1.OwnerReference

AsOwnerReference returns the MysqlCluster owner references.

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.

func (*MysqlBackup) GetCondition

func (b *MysqlBackup) GetCondition(ty BackupConditionType) *BackupCondition

func (*MysqlBackup) GetHelperImage

func (c *MysqlBackup) GetHelperImage() string

func (*MysqlBackup) UpdateStatusCondition

func (c *MysqlBackup) UpdateStatusCondition(condType BackupConditionType,
	status apiv1.ConditionStatus, reason, msg string)

UpdateStatusCondition sets the condition to a status. for example Ready condition to True, or False

type MysqlBackupList

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

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 MysqlCluster

type MysqlCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ClusterSpec   `json:"spec"`
	Status            ClusterStatus `json:"status,omitempty"`
}

func (*MysqlCluster) AsOwnerReference

func (c *MysqlCluster) AsOwnerReference() metav1.OwnerReference

AsOwnerReference returns the MysqlCluster owner references.

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

func (c *MysqlCluster) GetHealtySlaveHost() string

func (*MysqlCluster) GetLabels

func (c *MysqlCluster) GetLabels() map[string]string

func (*MysqlCluster) GetMasterHost

func (c *MysqlCluster) GetMasterHost() string

func (*MysqlCluster) GetNameForResource

func (c *MysqlCluster) GetNameForResource(name ResourceName) string

func (*MysqlCluster) GetPodHostName

func (c *MysqlCluster) GetPodHostName(p int) string

func (*MysqlCluster) UpdateDefaults

func (c *MysqlCluster) UpdateDefaults(opt *options.Options) error

UpdateDefaults sets the defaults for Spec and Status

func (*MysqlCluster) UpdateStatusCondition

func (c *MysqlCluster) UpdateStatusCondition(condType ClusterConditionType,
	status apiv1.ConditionStatus, reason, msg string)

UpdateStatusCondition sets the condition to a status. for example Ready condition to True, or False

type MysqlClusterList

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

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 MysqlConf

type MysqlConf map[string]string

type PodSpec

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

	Labels       map[string]string          `json:"labels"`
	Annotations  map[string]string          `json:"annotations"`
	Resources    apiv1.ResourceRequirements `json:"resources"`
	Affinity     apiv1.Affinity             `json:"affinity"`
	NodeSelector map[string]string          `json:"nodeSelector"`
}

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.

func (*PodSpec) UpdateDefaults

func (ps *PodSpec) UpdateDefaults(opt *options.Options, cluster *MysqlCluster) error

UpdateDefaults for PodSpec

type ResourceName

type ResourceName string

ResourceName is the type for aliasing resources that will be created.

const (
	// HeadlessSVC is the alias of the headless service resource
	HeadlessSVC ResourceName = "headless"
	// StatefulSet is the alias of the statefulset resource
	StatefulSet ResourceName = "mysql"
	// ConfigMap is the alias for mysql configs, the config map resource
	ConfigMap ResourceName = "config-files"
	// BackupCronJob is the name of cron job
	BackupCronJob ResourceName = "backup-cron"
)

type VolumeSpec

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

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.

func (*VolumeSpec) UpdateDefaults

func (vs *VolumeSpec) UpdateDefaults() error

UpdateDefaults for VolumeSpec

Jump to

Keyboard shortcuts

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