v2

package
v0.0.0-...-5d90d19 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package v2 contains API Schema definitions for the planetscale.com/v2 API group. +k8s:deepcopy-gen=package,register +groupName=planetscale.com

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

Index

Constants

View Source
const (
	// Mi is the scale factor for Mebi (2**20)
	Mi = 1 << 20
	// Gi is the scale factor for Gibi (2**30)
	Gi = 1 << 30

	// DefaultWebPort is the port for debug status pages and dashboard UIs.
	DefaultWebPort = 15000
	// DefaultAPIPort is the port for API endpoint.
	DefaultAPIPort = 15001
	// DefaultGrpcPort is the port for RPCs.
	DefaultGrpcPort = 15999
	// DefaultMysqlPort is the port for MySQL client connections.
	DefaultMysqlPort = 3306

	// DefaultWebPortName is the name for the web port.
	DefaultWebPortName = "web"
	// DefaultAPIPortName is the name for the api port.
	DefaultAPIPortName = "api"
	// DefaultGrpcPortName is the name for the RPC port.
	DefaultGrpcPortName = "grpc"
	// DefaultMysqlPortName is the name for the MySQL port.
	DefaultMysqlPortName = "mysql"

	DefaultInitCPURequestMillis   = 100
	DefaultInitMemoryRequestBytes = 32 * (1 << 20) // 32 MiB
)
View Source
const (
	// LabelPrefix is the prefix for label keys that belong to us.
	// We should use this prefix for all our labels to avoid conflicts.
	LabelPrefix = "planetscale.com"

	// ComponentLabel is the key for identifying which component of the operator manages an object.
	ComponentLabel = LabelPrefix + "/" + "component"
	// ClusterLabel is the key for identifying the VitessCluster instance to which an object belongs.
	ClusterLabel = LabelPrefix + "/" + "cluster"
	// CellLabel is the key for identifying the Vitess cell to which an object belongs.
	CellLabel = LabelPrefix + "/" + "cell"
	// KeyspaceLabel is the key for identifying the Vitess keyspace to which an object belongs.
	KeyspaceLabel = LabelPrefix + "/" + "keyspace"
	// ShardLabel is the key for identifying the Vitess shard to which an object belongs.
	ShardLabel = LabelPrefix + "/" + "shard"
	// TabletUidLabel is the key for identifying the Vitess tablet UID for a Pod.
	TabletUidLabel = LabelPrefix + "/" + "tablet-uid"
	// TabletTypeLabel is the key for identifying the Vitess target tablet type for a Pod.
	TabletTypeLabel = LabelPrefix + "/" + "tablet-type"
	// TabletPoolNameLabel is the key for identifying the Vitess target pool name within the (cell,type) pair.
	// This label is applicable to Vitess-unmanaged keyspaces.
	TabletPoolNameLabel = LabelPrefix + "/" + "pool-name"
	// TabletIndexLabel is the key for identifying the index of a Vitess tablet within its pool.
	TabletIndexLabel = LabelPrefix + "/" + "tablet-index"

	// VtctldComponentName is the ComponentLabel value for vtctld.
	VtctldComponentName = "vtctld"
	// VtadminComponentName is the ComponentLabel value for vtadmin.
	VtadminComponentName = "vtadmin"
	// VtorcComponentName is the ComponentLabel value for vtorc.
	VtorcComponentName = "vtorc"
	// VtgateComponentName is the ComponentLabel value for vtgate.
	VtgateComponentName = "vtgate"
	// VttabletComponentName is the ComponentLabel value for vttablet.
	VttabletComponentName = "vttablet"
	// VtbackupComponentName is the ComponentLabel value for vtbackup.
	VtbackupComponentName = "vtbackup"
	// EtcdComponentName is the ComponentLabel value for etcd.
	EtcdComponentName = "etcd"
	// VBSSubcontrollerComponentName is the ComponentLabel value for the vitessbackupstorage subcontroller.
	VBSSubcontrollerComponentName = "vbs-subcontroller"

	// ReplicaTabletPoolName is the TabletPoolLabel value for REPLICA tablets.
	ReplicaTabletPoolName = "replica"
	// RdonlyTabletPoolName is the TabletPoolLabel value for RDONLY tablets.
	RdonlyTabletPoolName = "rdonly"
	// ExternalMasterTabletPoolName is the TabletPoolLabel value for EXTERNALMASTER tablets.
	ExternalMasterTabletPoolName = "externalmaster"
	// ExternalReplicaTabletPoolName is the TabletPoolLabel value for EXTERNALREPLICA tablets.
	ExternalReplicaTabletPoolName = "externalreplica"
	// ExternalRdonlyTabletPoolName is the TabletPoolLabel value for EXTERNALRDONLY tablets.
	ExternalRdonlyTabletPoolName = "externalrdonly"
)

Variables

View Source
var (
	// DefaultVitessPriorityClass is the name of the PriorityClass to use by
	// default for Pods that run Vitess components. This value can be configured
	// at operator startup time with the --default_vitess_priority_class flag.
	DefaultVitessPriorityClass = "vitess"

	// DefaultVitessServiceAccount is the name of the ServiceAccount to use by
	// default for Pods that run Vitess components. This value can be configured
	// at operator startup time with the --default_vitess_service_account flag.
	DefaultVitessServiceAccount = ""

	// DefaultVitessRunAsUser is the UID to use by default for Pods that run
	// Vitess components. This value can be configured at operator startup time
	// with the --default_vitess_run_as_user flag. A value less than 0 means
	// don't set RunAsUser at all.
	DefaultVitessRunAsUser int64 = 999

	// DefaultVitessFSGroup is the GID to use by default for Pods that run
	// Vitess components. This value can be configured at operator startup time
	// with the --default_vitess_fs_group flag. A value less than 0 means don't
	// set FSGroup at all.
	DefaultVitessFSGroup int64 = 999

	// DefaultEtcdServiceAccount is the name of the ServiceAccount to use by
	// default for etcd Pods. This value can be configured at operator startup
	// time with the --default_etcd_service_account flag.
	DefaultEtcdServiceAccount = ""

	// DefaultEtcdRunAsUser is the UID to use by default for etcd Pods.
	// This value can be configured at operator startup time with the
	// --default_etcd_run_as_user flag. A value less than 0 means don't set
	// RunAsUser at all.
	DefaultEtcdRunAsUser int64 = -1

	// DefaultEtcdFSGroup is the GID to use by default for etcd Pods.
	// This value can be configured at operator startup time with the
	// --default_etcd_fs_group flag. A value less than 0 means don't set FSGroup
	// at all.
	DefaultEtcdFSGroup int64 = -1

	// DefaultEtcdImage is the image to use for etcd when the CRD doesn't specify.
	// This value can be configured at operator startup time with the
	// --default_etcd_image flag.
	DefaultEtcdImage = "quay.io/coreos/etcd:v3.5.9"
)
View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "planetscale.com", Version: "v2"}

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

	// Kind used for GroupVersionKind
	VitessClusterKind = "VitessCluster"
)
View Source
var DefaultImages = &VitessImages{
	Vtctld:   defaultVitessLiteImage,
	Vtgate:   defaultVitessLiteImage,
	Vttablet: defaultVitessLiteImage,

	Vtbackup: defaultVitessLiteImage,

	Vtorc: defaultVitessLiteImage,

	Mysqld: &MysqldImage{
		Mysql56Compatible: defaultVitessLiteImage,
	},

	MysqldExporter: "prom/mysqld-exporter:v0.11.0",
}

DefaultImages are a set of images to use when the CRD doesn't specify.

View Source
var (
	// VitessComponentNames is a list of all ComponentLabel values that
	// correspond to long-running (non-batch) Vitess components.
	VitessComponentNames = []string{
		VtctldComponentName,
		VtgateComponentName,
		VttabletComponentName,
	}
)

Functions

func DefaultEtcdLockserver

func DefaultEtcdLockserver(ls *EtcdLockserver)

func DefaultEtcdLockserverSpec

func DefaultEtcdLockserverSpec(ls *EtcdLockserverSpec)

func DefaultEtcdLockserverTemplate

func DefaultEtcdLockserverTemplate(ls *EtcdLockserverTemplate)

func DefaultLocalLockserver

func DefaultLocalLockserver(ls *LockserverSpec)

func DefaultServiceOverrides

func DefaultServiceOverrides(so **ServiceOverrides)

DefaultServiceOverrides applies defaults to a ServiceOverrides field.

func DefaultTopoReconcileConfig

func DefaultTopoReconcileConfig(confPtr **TopoReconcileConfig)

func DefaultUpdateStrategy

func DefaultUpdateStrategy(updateStratPtr **VitessClusterUpdateStrategy)

func DefaultVitessCell

func DefaultVitessCell(vtc *VitessCell)

DefaultVitessCell fills in API-level defaults for a VitessCell object.

func DefaultVitessCellImages

func DefaultVitessCellImages(dst *VitessCellImages, clusterDefaults *VitessImages)

DefaultVitessCellImages fills in unspecified keyspace-level images from cluster-level defaults. The clusterDefaults should have already had its unspecified fields filled in with operator defaults.

func DefaultVitessCluster

func DefaultVitessCluster(vt *VitessCluster)

DefaultVitessCluster fills in default values for unspecified fields.

func DefaultVitessDashboard

func DefaultVitessDashboard(dashboard **VitessDashboardSpec)

func DefaultVitessGateway

func DefaultVitessGateway(gtway *VitessCellGatewaySpec)

func DefaultVitessImages

func DefaultVitessImages(dst *VitessImages, src *VitessImages)

DefaultVitessImages copies images from src to dst to fill any unspecified values in dst.

func DefaultVitessKeyspace

func DefaultVitessKeyspace(dst *VitessKeyspace)

DefaultVitessKeyspace fills in VitessKeyspace defaults for unspecified fields. Note: This should only be used for nillable fields passed down from a parent because controllers run in parallel, and the defaulting code for a parent object may not have been run yet, meaning the values passed down from that parent might not be safe to deref.

func DefaultVitessKeyspaceImages

func DefaultVitessKeyspaceImages(dst *VitessKeyspaceImages, clusterDefaults *VitessImages)

DefaultVitessKeyspaceImages fills in unspecified keyspace-level images from cluster-level defaults. The clusterDefaults should have already had its unspecified fields filled in with operator defaults.

func DefaultVitessKeyspaceTemplate

func DefaultVitessKeyspaceTemplate(keyspace *VitessKeyspaceTemplate)

func DefaultVitessKeyspaceTemplates

func DefaultVitessKeyspaceTemplates(keyspaces []VitessKeyspaceTemplate)

func DefaultVitessOrchestrator

func DefaultVitessOrchestrator(vtorc **VitessOrchestratorSpec)

func DefaultVitessReplicationSpec

func DefaultVitessReplicationSpec(replicationSpec *VitessReplicationSpec)

func DefaultVitessShard

func DefaultVitessShard(dst *VitessShard)

DefaultVitessShard fills in VitessShard defaults for unspecified fields. Note: This should only be used for nillable fields passed down from a parent because controllers run in parallel, and the defaulting code for a parent object may not have been run yet, meaning the values passed down from that parent might not be safe to deref.

func DefaultVitessShardTemplate

func DefaultVitessShardTemplate(shardTemplate *VitessShardTemplate)

func DefaultVtAdmin

func DefaultVtAdmin(dashboard **VtAdminSpec)

func MergeVitessKeyspaceTemplateImages

func MergeVitessKeyspaceTemplateImages(dst *VitessKeyspaceImages, src *VitessKeyspaceTemplateImages)

MergeVitessKeyspaceTemplateImages takes non-empty image values from a non-nil src and sets them on dst.

func RegisterDefaults

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 SortKeyRanges

func SortKeyRanges(krs []VitessKeyRange)

SortKeyRanges sorts a slice of VitessKeyRange objects.

Types

type AzblobBackupLocation

type AzblobBackupLocation struct {
	// Account is the name of the Azure storage account to use.
	// +kubebuilder:validation:MinLength=1
	Account string `json:"account"`
	// Container is the name of the Azure storage account container to use.
	// +kubebuilder:validation:MinLength=1
	Container string `json:"container"`
	// KeyPrefix is an optional prefix added to all object keys created by Vitess.
	// This is only needed if the same container is also used for something other
	// than backups for VitessClusters. Backups from different clusters,
	// keyspaces, or shards will automatically avoid colliding with each other
	// within a container, regardless of this setting.
	// +kubebuilder:validation:Pattern=^[^\r\n]*$
	// +kubebuilder:validation:MaxLength=256
	KeyPrefix string `json:"keyPrefix,omitempty"`
	// AuthSecret is a reference to the Secret to use for Azure authentication.
	AuthSecret SecretSource `json:"authSecret"`
}

AzblobBackupLocation specifies a backup location in Azure Blob Storage.

func (*AzblobBackupLocation) DeepCopy

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

func (*AzblobBackupLocation) DeepCopyInto

func (in *AzblobBackupLocation) DeepCopyInto(out *AzblobBackupLocation)

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

type CephBackupLocation

type CephBackupLocation struct {
	// AuthSecret is a reference to the Secret to use for Ceph S3 authentication.
	// If set, this must point to a file in the format expected for the
	// `https://github.com/vitessio/vitess/blob/master/examples/local/ceph_backup_config.json` file.
	AuthSecret SecretSource `json:"authSecret"`
}

CephBackupLocation specifies a backup location in Ceph S3.

func (*CephBackupLocation) DeepCopy

func (in *CephBackupLocation) DeepCopy() *CephBackupLocation

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

func (*CephBackupLocation) DeepCopyInto

func (in *CephBackupLocation) DeepCopyInto(out *CephBackupLocation)

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

type ClusterBackupSpec

type ClusterBackupSpec struct {
	// Locations is a list of places where Vitess backup data for the cluster
	// can be stored. At least one storage location must be specified.
	// Within each storage location, there are multiple fields for various
	// location types (gcs, s3, etc.); exactly one such field must be populated.
	//
	// Multiple storage locations may be desired if, for example, the cluster
	// spans multiple regions. Each storage location is independent of the others;
	// backups can only be restored from the same storage location in which they
	// were originally taken.
	// +kubebuilder:validation:MinItems=1
	Locations []VitessBackupLocation `json:"locations"`
	// Engine specifies the Vitess backup engine to use, either "builtin" or "xtrabackup".
	// Note that if you change this after a Vitess cluster is already deployed,
	// you must roll the change out to all tablets and then take a new backup
	// from one tablet in each shard. Otherwise, new tablets trying to restore
	// will find that the latest backup was created with the wrong engine.
	// Default: builtin
	// +kubebuilder:validation:Enum=builtin;xtrabackup
	Engine VitessBackupEngine `json:"engine,omitempty"`
	// Subcontroller specifies any parameters needed for launching the VitessBackupStorage subcontroller pod.
	Subcontroller *VitessBackupSubcontrollerSpec `json:"subcontroller,omitempty"`
}

ClusterBackupSpec configures backups for a cluster. In addition to disaster recovery, Vitess currently depends on backups to support provisioning of a new tablet in a shard with existing data, as an implementation detail.

func (*ClusterBackupSpec) DeepCopy

func (in *ClusterBackupSpec) DeepCopy() *ClusterBackupSpec

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

func (*ClusterBackupSpec) DeepCopyInto

func (in *ClusterBackupSpec) DeepCopyInto(out *ClusterBackupSpec)

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

type EtcdLockserver

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

	Spec   EtcdLockserverSpec   `json:"spec,omitempty"`
	Status EtcdLockserverStatus `json:"status,omitempty"`
}

EtcdLockserver runs an etcd cluster for use as a Vitess lockserver. Unlike etcd-operator, it uses static bootstrapping and PVCs, treating members as stateful rather the ephemeral. Bringing back existing members instead of creating new ones means etcd can recover from loss of quorum without data loss, which is important for Vitess because restoring from an etcd backup (resetting the lockserver to a point in the past) would violate the consistency model that Vitess expects of a lockserver. +kubebuilder:resource:path=etcdlockservers,shortName=etcdls +kubebuilder:subresource:status

func (*EtcdLockserver) DeepCopy

func (in *EtcdLockserver) DeepCopy() *EtcdLockserver

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

func (*EtcdLockserver) DeepCopyInto

func (in *EtcdLockserver) DeepCopyInto(out *EtcdLockserver)

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

func (*EtcdLockserver) DeepCopyObject

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

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

type EtcdLockserverList

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

EtcdLockserverList contains a list of EtcdLockserver

func (*EtcdLockserverList) DeepCopy

func (in *EtcdLockserverList) DeepCopy() *EtcdLockserverList

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

func (*EtcdLockserverList) DeepCopyInto

func (in *EtcdLockserverList) DeepCopyInto(out *EtcdLockserverList)

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

func (*EtcdLockserverList) DeepCopyObject

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

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

type EtcdLockserverSpec

type EtcdLockserverSpec struct {
	// EtcdLockserverTemplate contains the user-specified parts of EtcdLockserverSpec.
	// These are the parts that are configurable inside VitessCluster.
	// The rest of the fields below are filled in by the parent controller.
	EtcdLockserverTemplate `json:",inline"`

	// Zone is the name of the Availability Zone that this lockserver should run in.
	// This value should match the value of the "failure-domain.beta.kubernetes.io/zone"
	// label on the Kubernetes Nodes in that AZ.
	// If the Kubernetes Nodes don't have such a label, leave this empty.
	Zone string `json:"zone,omitempty"`
}

EtcdLockserverSpec defines the desired state of an EtcdLockserver.

func (*EtcdLockserverSpec) DeepCopy

func (in *EtcdLockserverSpec) DeepCopy() *EtcdLockserverSpec

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

func (*EtcdLockserverSpec) DeepCopyInto

func (in *EtcdLockserverSpec) DeepCopyInto(out *EtcdLockserverSpec)

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

type EtcdLockserverStatus

type EtcdLockserverStatus struct {
	// The generation observed by the controller.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// Available is a condition that indicates whether the cluster is able to serve queries.
	Available corev1.ConditionStatus `json:"available,omitempty"`
	// ClientServiceName is the name of the Service for etcd client connections.
	ClientServiceName string `json:"clientServiceName,omitempty"`
}

EtcdLockserverStatus defines the observed state of an EtcdLockserver.

func NewEtcdLockserverStatus

func NewEtcdLockserverStatus() *EtcdLockserverStatus

NewEtcdLockserverStatus returns a new status with default values.

func (*EtcdLockserverStatus) DeepCopy

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

func (*EtcdLockserverStatus) DeepCopyInto

func (in *EtcdLockserverStatus) DeepCopyInto(out *EtcdLockserverStatus)

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

type EtcdLockserverTemplate

type EtcdLockserverTemplate struct {
	// Image is the etcd server image (including version tag) to deploy.
	// Default: Let the operator choose.
	Image string `json:"image,omitempty"`

	// ImagePullPolicy specifies if/when to pull a container image.
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// ImagePullSecrets specifies the container image pull secrets to add to all
	// etcd Pods.
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// Resources specify the compute resources to allocate for each etcd member.
	// Default: Let the operator choose.
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// DataVolumeClaimTemplate configures the PersistentVolumeClaims that will be created
	// for each etcd instance to store its data files.
	// This field is required.
	//
	// IMPORTANT: For a cell-local lockserver in a Kubernetes cluster that spans
	// multiple zones, you should ensure that `volumeBindingMode: WaitForFirstConsumer`
	// is set on the StorageClass specified in the storageClassName field here.
	// Default: Let the operator choose.
	DataVolumeClaimTemplate corev1.PersistentVolumeClaimSpec `json:"dataVolumeClaimTemplate,omitempty"`

	// ExtraFlags can optionally be used to override default flags set by the
	// operator, or pass additional flags to etcd. All entries must be
	// key-value string pairs of the form "flag": "value". The flag name should
	// not have any prefix (just "flag", not "-flag"). To set a boolean flag,
	// set the string value to either "true" or "false".
	ExtraFlags map[string]string `json:"extraFlags,omitempty"`

	// ExtraEnv can optionally be used to override default environment variables
	// set by the operator, or pass additional environment variables.
	ExtraEnv []corev1.EnvVar `json:"extraEnv,omitempty"`

	// ExtraVolumes can optionally be used to override default Pod volumes
	// defined by the operator, or provide additional volumes to the Pod.
	// Note that when adding a new volume, you should usually also add a
	// volumeMount to specify where in each container's filesystem the volume
	// should be mounted.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	ExtraVolumes []corev1.Volume `json:"extraVolumes,omitempty"`

	// ExtraVolumeMounts can optionally be used to override default Pod
	// volumeMounts defined by the operator, or specify additional mounts.
	// Typically, these are used to mount volumes defined through extraVolumes.
	ExtraVolumeMounts []corev1.VolumeMount `json:"extraVolumeMounts,omitempty"`

	// InitContainers can optionally be used to supply extra init containers
	// that will be run to completion one after another before any app containers are started.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// SidecarContainers can optionally be used to supply extra containers
	// that run alongside the main containers.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	SidecarContainers []corev1.Container `json:"sidecarContainers,omitempty"`

	// Affinity allows you to set rules that constrain the scheduling of
	// your Etcd pods. WARNING: These affinity rules will override all default affinities
	// that we set; in turn, we can't guarantee optimal scheduling of your pods if you
	// choose to set this field.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Annotations can optionally be used to attach custom annotations to Pods
	// created for this component.
	Annotations map[string]string `json:"annotations,omitempty"`

	// ExtraLabels can optionally be used to attach custom labels to Pods
	// created for this component.
	ExtraLabels map[string]string `json:"extraLabels,omitempty"`

	// CreatePDB sets whether to create a PodDisruptionBudget (PDB) for etcd
	// member Pods.
	//
	// Note: Disabling this will NOT delete a PDB that was previously created.
	//
	// Default: true
	CreatePDB *bool `json:"createPDB,omitempty"`

	// CreateClientService sets whether to create a Service for the client port
	// of etcd member Pods.
	//
	// Note: Disabling this will NOT delete a Service that was previously created.
	//
	// Default: true
	CreateClientService *bool `json:"createClientService,omitempty"`

	// CreatePeerService sets whether to create a Service for the peer port
	// of etcd member Pods.
	//
	// Note: Disabling this will NOT delete a Service that was previously created.
	//
	// Default: true
	CreatePeerService *bool `json:"createPeerService,omitempty"`

	// AdvertisePeerURLs can optionally be used to override the URLs that etcd
	// members use to find each other for peer-to-peer connections.
	//
	// If specified, the list must contain exactly 3 entries, one for each etcd
	// member index (1,2,3) respectively.
	//
	// Default: Build peer URLs automatically based on Kubernetes built-in DNS.
	// +kubebuilder:validation:MinItems=3
	// +kubebuilder:validation:MaxItems=3
	AdvertisePeerURLs []string `json:"advertisePeerURLs,omitempty"`

	// LocalMemberIndex can optionally be used to specify that only one etcd
	// member should actually be deployed. This can be used to spread members
	// across multiple Kubernetes clusters by configuring the EtcdLockserver CRD
	// in each cluster to deploy a different member index. If specified, the
	// index must be 1, 2, or 3.
	//
	// Default: Deploy all etcd members locally.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=3
	LocalMemberIndex *int32 `json:"localMemberIndex,omitempty"`

	// ClientService can optionally be used to customize the etcd client Service.
	ClientService *ServiceOverrides `json:"clientService,omitempty"`

	// PeerService can optionally be used to customize the etcd peer Service.
	PeerService *ServiceOverrides `json:"peerService,omitempty"`

	// Tolerations allow you to schedule pods onto nodes with matching taints.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

EtcdLockserverTemplate defines the user-configurable settings for an etcd cluster that we deploy (not external), to serve as either a local or global lockserver.

func (*EtcdLockserverTemplate) DeepCopy

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

func (*EtcdLockserverTemplate) DeepCopyInto

func (in *EtcdLockserverTemplate) DeepCopyInto(out *EtcdLockserverTemplate)

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

type ExternalDatastore

type ExternalDatastore struct {
	// User is a provided database user from an externally managed MySQL that Vitess can use to
	// carry out necessary actions.  Password for this user must be supplied in the CredentialsSecret.
	User string `json:"user"`
	// Host is the endpoint string to an externally managed MySQL, without any port.
	Host string `json:"host"`
	// Port specifies the port for the externally managed MySQL endpoint.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	Port int32 `json:"port"`
	// Database is the name of the database.
	Database string `json:"database"`
	// CredentialsSecret should link to a JSON credentials file used to connect to the externally managed
	// MySQL endpoint. The credentials file is understood and parsed by Vitess and must be in the format:
	// {
	//   "username": [
	//     "password"
	//   ]
	// }
	// Vitess always uses the first password in the password array.
	CredentialsSecret SecretSource `json:"credentialsSecret"`

	// ServerCACertSecret should link to a certificate authority file if one is required by your externally managed MySQL endpoint.
	ServerCACertSecret *SecretSource `json:"serverCACertSecret,omitempty"`
}

ExternalDatastore defines information that vttablet needs to connect to an externally managed MySQL.

func (*ExternalDatastore) DeepCopy

func (in *ExternalDatastore) DeepCopy() *ExternalDatastore

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

func (*ExternalDatastore) DeepCopyInto

func (in *ExternalDatastore) DeepCopyInto(out *ExternalDatastore)

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

type ExternalVitessClusterUpdateStrategyOptions

type ExternalVitessClusterUpdateStrategyOptions struct {
	// AllowResourceChanges can be used to allow changes to certain resource
	// requests and limits to propagate immediately, bypassing the external rollout tool.
	//
	// Supported options:
	// - storage
	//
	// Default: All resource changes wait to be released by the external rollout tool.
	AllowResourceChanges []corev1.ResourceName `json:"allowResourceChanges,omitempty"`
}

func (*ExternalVitessClusterUpdateStrategyOptions) DeepCopy

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

func (*ExternalVitessClusterUpdateStrategyOptions) DeepCopyInto

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

func (*ExternalVitessClusterUpdateStrategyOptions) ResourceChangesAllowed

func (externalOptions *ExternalVitessClusterUpdateStrategyOptions) ResourceChangesAllowed(resource corev1.ResourceName) bool

type GCSBackupLocation

type GCSBackupLocation struct {
	// Bucket is the name of the GCS bucket to use.
	// +kubebuilder:validation:MinLength=1
	Bucket string `json:"bucket"`
	// KeyPrefix is an optional prefix added to all object keys created by Vitess.
	// This is only needed if the same bucket is also used for something other
	// than backups for VitessClusters. Backups from different clusters,
	// keyspaces, or shards will automatically avoid colliding with each other
	// within a bucket, regardless of this setting.
	// +kubebuilder:validation:Pattern=^[^\r\n]*$
	// +kubebuilder:validation:MaxLength=256
	KeyPrefix string `json:"keyPrefix,omitempty"`
	// AuthSecret is a reference to the Secret to use for GCS authentication.
	// If set, this must point to a file in the format expected for the
	// GOOGLE_APPLICATION_CREDENTIALS environment variable.
	// Default: Use the default credentials of the Node.
	AuthSecret *SecretSource `json:"authSecret,omitempty"`
}

GCSBackupLocation specifies a backup location in Google Cloud Storage.

func (*GCSBackupLocation) DeepCopy

func (in *GCSBackupLocation) DeepCopy() *GCSBackupLocation

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

func (*GCSBackupLocation) DeepCopyInto

func (in *GCSBackupLocation) DeepCopyInto(out *GCSBackupLocation)

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

type LockserverSpec

type LockserverSpec struct {
	// External specifies that we should connect to an existing
	// lockserver, instead of deploying our own.
	// If this is set, all other Lockserver fields are ignored.
	External *VitessLockserverParams `json:"external,omitempty"`

	// Etcd deploys our own etcd cluster as a lockserver.
	Etcd *EtcdLockserverTemplate `json:"etcd,omitempty"`

	// CellInfoAddress is the host:port of topology service which will be saved to cell info.
	// Default: etcd client service.
	CellInfoAddress string `json:"cellInfoAddress,omitempty"`
}

LockserverSpec specifies either a deployed or external lockserver, which can be either global or local.

func (*LockserverSpec) DeepCopy

func (in *LockserverSpec) DeepCopy() *LockserverSpec

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

func (*LockserverSpec) DeepCopyInto

func (in *LockserverSpec) DeepCopyInto(out *LockserverSpec)

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

type LockserverStatus

type LockserverStatus struct {
	// Etcd is the status of the EtcdCluster, if we were asked to deploy one.
	Etcd *EtcdLockserverStatus `json:"etcd,omitempty"`
}

LockserverStatus is the lockserver component of status.

func (*LockserverStatus) DeepCopy

func (in *LockserverStatus) DeepCopy() *LockserverStatus

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

func (*LockserverStatus) DeepCopyInto

func (in *LockserverStatus) DeepCopyInto(out *LockserverStatus)

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

type MysqldExporterSpec

type MysqldExporterSpec struct {
	// Resources specify the compute resources to allocate for just the MySQL Exporter.
	Resources corev1.ResourceRequirements `json:"resources"`
}

MysqldExporterSpec configures the local MySQL exporter within a tablet.

func (*MysqldExporterSpec) DeepCopy

func (in *MysqldExporterSpec) DeepCopy() *MysqldExporterSpec

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

func (*MysqldExporterSpec) DeepCopyInto

func (in *MysqldExporterSpec) DeepCopyInto(out *MysqldExporterSpec)

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

type MysqldImage

type MysqldImage struct {
	// Mysql56Compatible is a container image (including version tag) for mysqld
	// that's compatible with the Vitess "MySQL56" flavor setting.
	Mysql56Compatible string `json:"mysql56Compatible,omitempty"`
	// Mysql80Compatible is a container image (including version tag) for mysqld
	// that's compatible with the Vitess "MySQL80" flavor setting.
	Mysql80Compatible string `json:"mysql80Compatible,omitempty"`
	// MariadbCompatible is a container image (including version tag) for mysqld
	// that's compatible with the Vitess "MariaDB" flavor setting.
	MariadbCompatible string `json:"mariadbCompatible,omitempty"`
	// Mariadb103Compatible is a container image (including version tag) for mysqld
	// that's compatible with the Vitess "MariaDB103" flavor setting.
	Mariadb103Compatible string `json:"mariadb103Compatible,omitempty"`
}

TODO: Remove this once everything is migrated to MysqldImageNew.

func (*MysqldImage) DeepCopy

func (in *MysqldImage) DeepCopy() *MysqldImage

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

func (*MysqldImage) DeepCopyInto

func (in *MysqldImage) DeepCopyInto(out *MysqldImage)

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

func (*MysqldImage) Flavor

func (image *MysqldImage) Flavor() string

Flavor returns Vitess flavor setting value for the first flavor that has an image set.

func (*MysqldImage) Image

func (image *MysqldImage) Image() string

Image returns the first mysqld flavor image that's set.

type MysqldImageNew

type MysqldImageNew struct {
	// Mysql56Compatible is a container image (including version tag) for mysqld
	// that's compatible with the Vitess "MySQL56" flavor setting.
	Mysql56Compatible string `json:"mysql56Compatible,omitempty"`
	// Mysql80Compatible is a container image (including version tag) for mysqld
	// that's compatible with the Vitess "MySQL80" flavor setting.
	Mysql80Compatible string `json:"mysql80Compatible,omitempty"`
}

MysqldImageNew specifies the container image to use for mysqld, as well as declaring which MySQL flavor setting in Vitess the image is compatible with.

TODO: rename this to MysqldImage once MysqldImage is removed.

func (*MysqldImageNew) DeepCopy

func (in *MysqldImageNew) DeepCopy() *MysqldImageNew

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

func (*MysqldImageNew) DeepCopyInto

func (in *MysqldImageNew) DeepCopyInto(out *MysqldImageNew)

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

type MysqldSpec

type MysqldSpec struct {
	// Resources specify the compute resources to allocate for just the MySQL
	// process (the underlying local datastore).
	// This field is required.
	Resources corev1.ResourceRequirements `json:"resources"`

	// ConfigOverrides can optionally be used to provide a my.cnf snippet
	// to override default my.cnf values (included with Vitess) for this
	// particular MySQL instance.
	ConfigOverrides string `json:"configOverrides,omitempty"`
}

MysqldSpec configures the local MySQL server within a tablet.

func (*MysqldSpec) DeepCopy

func (in *MysqldSpec) DeepCopy() *MysqldSpec

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

func (*MysqldSpec) DeepCopyInto

func (in *MysqldSpec) DeepCopyInto(out *MysqldSpec)

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

type OrphanStatus

type OrphanStatus struct {
	// Reason is a CamelCase token for programmatic reasoning about why the object is orphaned.
	Reason string `json:"reason"`
	// Message is a human-readable explanation for why the object is orphaned.
	Message string `json:"message"`
}

OrphanStatus indiciates why a secondary object is orphaned.

func NewOrphanStatus

func NewOrphanStatus(reason, message string) *OrphanStatus

NewOrphanStatus creates a new OrphanStatus.

func (*OrphanStatus) DeepCopy

func (in *OrphanStatus) DeepCopy() *OrphanStatus

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

func (*OrphanStatus) DeepCopyInto

func (in *OrphanStatus) DeepCopyInto(out *OrphanStatus)

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

type ReshardingStatus

type ReshardingStatus struct {
	// Workflow represents the name of the active vreplication workflow for resharding.
	Workflow string `json:"workflow"`
	// State is either 'Running', 'Copying', 'Error' or 'Unknown'.
	State WorkflowState `json:"state"`
	// SourceShards is a list of source shards for the current resharding operation.
	SourceShards []string `json:"sourceShards,omitempty"`
	// TargetShards is a list of target shards for the current resharding operation.
	TargetShards []string `json:"targetShards,omitempty"`
	// CopyProgress will indicate the percentage completion ranging from 0-100 as integer values.
	// Once we are past the copy phase, this value will always be 100, and will never be 100 while we
	// are still within the copy phase.
	// If we can not compute the copy progress in a timely fashion, we will report -1 to indicate the progress is unknown.
	CopyProgress int `json:"copyProgress,omitempty"`
}

ReshardingStatus defines some of the workflow related status information.

func (*ReshardingStatus) DeepCopy

func (in *ReshardingStatus) DeepCopy() *ReshardingStatus

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

func (*ReshardingStatus) DeepCopyInto

func (in *ReshardingStatus) DeepCopyInto(out *ReshardingStatus)

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

type S3BackupLocation

type S3BackupLocation struct {
	// Region is the AWS region in which the bucket is located.
	// +kubebuilder:validation:MinLength=1
	Region string `json:"region"`
	// Bucket is the name of the S3 bucket to use.
	// +kubebuilder:validation:MinLength=1
	Bucket string `json:"bucket"`
	// Endpoint is the `host:port` (port is required) for the S3 backend.
	// Default: Use the endpoint associated with `region` by the driver.
	Endpoint string `json:"endpoint,omitempty"`
	// ForcePathStyle is an optional param to force connection using <endpoint>/<bucket>
	// Default: false By default the s3 client will try to connect to <bucket>.<endpoint>.
	ForcePathStyle bool `json:"forcePathStyle,omitempty"`
	// KeyPrefix is an optional prefix added to all object keys created by Vitess.
	// This is only needed if the same bucket is also used for something other
	// than backups for VitessClusters. Backups from different clusters,
	// keyspaces, or shards will automatically avoid colliding with each other
	// within a bucket, regardless of this setting.
	// +kubebuilder:validation:Pattern=^[^\r\n]*$
	// +kubebuilder:validation:MaxLength=256
	KeyPrefix string `json:"keyPrefix,omitempty"`
	// AuthSecret is a reference to the Secret to use for S3 authentication.
	// If set, this must point to a file in the format expected for the
	// `~/.aws/credentials` file.
	// Default: Use the default credentials of the Node.
	AuthSecret *SecretSource `json:"authSecret,omitempty"`
}

S3BackupLocation specifies a backup location in Amazon S3.

func (*S3BackupLocation) DeepCopy

func (in *S3BackupLocation) DeepCopy() *S3BackupLocation

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

func (*S3BackupLocation) DeepCopyInto

func (in *S3BackupLocation) DeepCopyInto(out *S3BackupLocation)

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

type SecretSource

type SecretSource struct {
	// Name is the name of a Kubernetes Secret object to use as the data source.
	// The Secret must be in the same namespace as the VitessCluster.
	//
	// The 'key' field defines the item to pick from the Secret object's 'data'
	// map.
	//
	// If a Secret name is not specified, the data source must be defined
	// with the 'volumeName' field instead.
	Name string `json:"name,omitempty"`

	// VolumeName directly specifies the name of a Volume in each Pod that
	// should be mounted. You must ensure a Volume by that name exists in all
	// relevant Pods, such as by using the appropriate ExtraVolumes fields.
	// If specified, this takes precedence over the 'name' field.
	//
	// The 'key' field defines the name of the file to load within this Volume.
	VolumeName string `json:"volumeName,omitempty"`

	// Key is the name of the item within the data source to use as the value.
	//
	// For a Kubernetes Secret object (specified with the 'name' field),
	// this is the key within the 'data' map.
	//
	// When 'volumeName' is used, this specifies the name of the file to load
	// within that Volume.
	Key string `json:"key"`
}

SecretSource specifies where to find the data for a particular secret value.

func (*SecretSource) DeepCopy

func (in *SecretSource) DeepCopy() *SecretSource

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

func (*SecretSource) DeepCopyInto

func (in *SecretSource) DeepCopyInto(out *SecretSource)

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

func (*SecretSource) IsSet

func (s *SecretSource) IsSet() bool

IsSet returns true if at least one source is set.

type ServiceOverrides

type ServiceOverrides struct {
	// Annotations specifies extra annotations to add to the Service object.
	// Annotations added in this way will NOT be automatically removed from the
	// Service object if they are removed here.
	Annotations map[string]string `json:"annotations,omitempty"`

	// ClusterIP can optionally be used to override the Service's clusterIP.
	// This field is immutable on Service objects, so changes made after the
	// initial creation of the Service will only be applied if you manually
	// delete the Service.
	ClusterIP string `json:"clusterIP,omitempty"`
}

ServiceOverrides allows customization of an arbitrary Service object.

func (*ServiceOverrides) DeepCopy

func (in *ServiceOverrides) DeepCopy() *ServiceOverrides

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

func (*ServiceOverrides) DeepCopyInto

func (in *ServiceOverrides) DeepCopyInto(out *ServiceOverrides)

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

type ShardBackupLocationStatus

type ShardBackupLocationStatus struct {
	// Name is the backup location name.
	Name string `json:"name,omitempty"`
	// CompleteBackups is the number of complete backups observed.
	CompleteBackups int32 `json:"completeBackups"`
	// IncompleteBackups is the number of incomplete backups observed.
	IncompleteBackups int32 `json:"incompleteBackups"`
	// LatestCompleteBackupTime is the timestamp of the most recent complete backup.
	LatestCompleteBackupTime *metav1.Time `json:"latestCompleteBackupTime,omitempty"`
}

ShardBackupLocationStatus reports status for the backups of a given shard in a given backup location.

func NewShardBackupLocationStatus

func NewShardBackupLocationStatus(name string) *ShardBackupLocationStatus

NewShardBackupLocationStatus creates a new status object with default values.

func (*ShardBackupLocationStatus) DeepCopy

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

func (*ShardBackupLocationStatus) DeepCopyInto

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

type TopoReconcileConfig

type TopoReconcileConfig struct {
	// RegisterCellsAliases can be used to enable or disable registering cells aliases into topo records.
	// Default: true
	RegisterCellsAliases *bool `json:"registerCellsAliases,omitempty"`

	// RegisterCells can be used to enable or disable registering cells into topo records.
	// Default: true
	RegisterCells *bool `json:"registerCells,omitempty"`

	// PruneCells can be used to enable or disable pruning of extraneous cells from topo records.
	// Default: true
	PruneCells *bool `json:"pruneCells,omitempty"`

	// PruneKeyspaces can be used to enable or disable pruning of extraneous keyspaces from topo records.
	// Default: true
	PruneKeyspaces *bool `json:"pruneKeyspaces,omitempty"`

	// PruneSrvKeyspaces can be used to enable or disable pruning of extraneous serving keyspaces from topo records.
	// Default: true
	PruneSrvKeyspaces *bool `json:"pruneSrvKeyspaces,omitempty"`

	// PruneShards can be used to enable or disable pruning of extraneous shards from topo records.
	// Default: true
	PruneShards *bool `json:"pruneShards,omitempty"`

	// PruneShardCells can be used to enable or disable pruning of extraneous shard cells from topo records.
	// Default: true
	PruneShardCells *bool `json:"pruneShardCells,omitempty"`

	// PruneTablets can be used to enable or disable pruning of extraneous tablets from topo records.
	// Default: true
	PruneTablets *bool `json:"pruneTablets,omitempty"`
}

TopoReconcileConfig can be used to turn on or off registration or pruning of specific vitess components from topo records. This should only be necessary if you need to override defaults, and shouldn't be required for the vast majority of use cases.

func (*TopoReconcileConfig) DeepCopy

func (in *TopoReconcileConfig) DeepCopy() *TopoReconcileConfig

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

func (*TopoReconcileConfig) DeepCopyInto

func (in *TopoReconcileConfig) DeepCopyInto(out *TopoReconcileConfig)

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

type VitessBackup

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

	Spec   VitessBackupSpec   `json:"spec,omitempty"`
	Status VitessBackupStatus `json:"status,omitempty"`
}

VitessBackup is a one-way mirror of metadata for a Vitess backup. These objects are created automatically by the VitessBackupStorage controller to provide access to backup metadata from Kubernetes. Each backup found in the storage location will be represented by its own VitessBackup object. +kubebuilder:resource:path=vitessbackups,shortName=vtb

func (*VitessBackup) DeepCopy

func (in *VitessBackup) DeepCopy() *VitessBackup

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

func (*VitessBackup) DeepCopyInto

func (in *VitessBackup) DeepCopyInto(out *VitessBackup)

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

func (*VitessBackup) DeepCopyObject

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

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

type VitessBackupEngine

type VitessBackupEngine string

VitessBackupEngine is the backup implementation to use.

const (
	// VitessBackupEngineBuiltIn uses the built-in Vitess backup engine.
	VitessBackupEngineBuiltIn VitessBackupEngine = "builtin"
	// VitessBackupEngineXtraBackup uses Percona XtraBackup for backups.
	VitessBackupEngineXtraBackup VitessBackupEngine = "xtrabackup"
)

type VitessBackupList

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

VitessBackupList contains a list of VitessBackups.

func (*VitessBackupList) DeepCopy

func (in *VitessBackupList) DeepCopy() *VitessBackupList

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

func (*VitessBackupList) DeepCopyInto

func (in *VitessBackupList) DeepCopyInto(out *VitessBackupList)

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

func (*VitessBackupList) DeepCopyObject

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

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

type VitessBackupLocation

type VitessBackupLocation struct {
	// Name is used to refer to this backup location from other parts of a
	// VitessCluster object.
	//
	// In particular, the backupLocationName field in each tablet pool within
	// each shard must match one of the names defined by this field.
	//
	// This name must be unique among all backup locations defined in a given
	// cluster. A backup location with an empty name defines the default
	// location used when a tablet pool does not specify a backupLocationName.
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=^[A-Za-z0-9]([A-Za-z0-9-_.]*[A-Za-z0-9])?$
	Name string `json:"name,omitempty"`
	// GCS specifies a backup location in Google Cloud Storage.
	GCS *GCSBackupLocation `json:"gcs,omitempty"`
	// S3 specifies a backup location in Amazon S3.
	S3 *S3BackupLocation `json:"s3,omitempty"`
	// Azblob specifies a backup location in Azure Blob Storage.
	Azblob *AzblobBackupLocation `json:"azblob,omitempty"`
	// Ceph specifies a backup location in Ceph S3.
	Ceph *CephBackupLocation `json:"ceph,omitempty"`
	// Volume specifies a backup location as a Kubernetes Volume Source to mount.
	// This can be used, for example, to store backups on an NFS mount, or on
	// a shared host path for local testing.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Volume *corev1.VolumeSource `json:"volume,omitempty"`
	// VolumeSubPath gives the subpath in the volume to mount to the backups target.
	// Only used for Volume-backed backup storage, ignored otherwise.
	VolumeSubPath string `json:"volumeSubPath,omitempty"`
	// Annotations can optionally be used to attach custom annotations to Pods
	// that need access to this backup storage location.
	Annotations map[string]string `json:"annotations,omitempty"`
}

VitessBackupLocation defines a location where Vitess backups can be stored.

func (*VitessBackupLocation) DeepCopy

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

func (*VitessBackupLocation) DeepCopyInto

func (in *VitessBackupLocation) DeepCopyInto(out *VitessBackupLocation)

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

type VitessBackupSpec

type VitessBackupSpec struct {
}

VitessBackupSpec defines the desired state of the backup.

func (*VitessBackupSpec) DeepCopy

func (in *VitessBackupSpec) DeepCopy() *VitessBackupSpec

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

func (*VitessBackupSpec) DeepCopyInto

func (in *VitessBackupSpec) DeepCopyInto(out *VitessBackupSpec)

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

type VitessBackupStatus

type VitessBackupStatus struct {
	// StartTime is the time when the backup started.
	StartTime metav1.Time `json:"startTime,omitempty"`
	// FinishedTime is the time when the backup finished.
	FinishedTime *metav1.Time `json:"finishedTime,omitempty"`
	// Complete indicates whether the backup ever completed.
	Complete bool `json:"complete,omitempty"`
	// Position is the replication position of the snapshot that was backed up.
	// The position is expressed in the native, GTID-based format of the MySQL
	// flavor that took the backup.
	// This is only available after the backup is complete.
	Position string `json:"position,omitempty"`
	// Engine is the Vitess backup engine implementation that was used.
	Engine string `json:"engine,omitempty"`
	// StorageDirectory is the name of the parent directory in storage that
	// contains this backup.
	StorageDirectory string `json:"storageDirectory,omitempty"`
	// StorageName is the name of the backup in storage. This is different from
	// the name of the VitessBackup object created to represent metadata about
	// the actual backup in storage.
	StorageName string `json:"storageName,omitempty"`
}

VitessBackupStatus describes the observed state of the backup.

func (*VitessBackupStatus) DeepCopy

func (in *VitessBackupStatus) DeepCopy() *VitessBackupStatus

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

func (*VitessBackupStatus) DeepCopyInto

func (in *VitessBackupStatus) DeepCopyInto(out *VitessBackupStatus)

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

type VitessBackupStorage

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

	Spec   VitessBackupStorageSpec   `json:"spec,omitempty"`
	Status VitessBackupStorageStatus `json:"status,omitempty"`
}

VitessBackupStorage represents a storage location for Vitess backups. It provides access to metadata about Vitess backups inside Kubernetes by maintaining a set of VitessBackup objects that represent backups in the given storage location. One VitessBackupStorage represents a storage location defined at the VitessCluster level, so it provides access to metadata about backups stored in that location for any keyspace and any shard in that cluster. +kubebuilder:resource:path=vitessbackupstorages,shortName=vtbs +kubebuilder:subresource:status

func (*VitessBackupStorage) DeepCopy

func (in *VitessBackupStorage) DeepCopy() *VitessBackupStorage

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

func (*VitessBackupStorage) DeepCopyInto

func (in *VitessBackupStorage) DeepCopyInto(out *VitessBackupStorage)

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

func (*VitessBackupStorage) DeepCopyObject

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

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

type VitessBackupStorageList

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

VitessBackupStorageList contains a list of VitessBackupStorages.

func (*VitessBackupStorageList) DeepCopy

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

func (*VitessBackupStorageList) DeepCopyInto

func (in *VitessBackupStorageList) DeepCopyInto(out *VitessBackupStorageList)

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

func (*VitessBackupStorageList) DeepCopyObject

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

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

type VitessBackupStorageSpec

type VitessBackupStorageSpec struct {
	// Location specifies the Vitess parameters for connecting to the backup
	// storage location.
	Location VitessBackupLocation `json:"location"`
	// Subcontroller specifies any parameters needed for launching the VitessBackupStorage subcontroller pod.
	Subcontroller *VitessBackupSubcontrollerSpec `json:"subcontroller,omitempty"`
}

VitessBackupStorageSpec defines the desired state of VitessBackupStorage.

func (*VitessBackupStorageSpec) DeepCopy

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

func (*VitessBackupStorageSpec) DeepCopyInto

func (in *VitessBackupStorageSpec) DeepCopyInto(out *VitessBackupStorageSpec)

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

type VitessBackupStorageStatus

type VitessBackupStorageStatus struct {
	// The generation observed by the controller.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// TotalBackupCount is the total number of backups found in this storage
	// location, across all keyspaces and shards.
	TotalBackupCount int32 `json:"totalBackupCount,omitempty"`
}

VitessBackupStorageStatus defines the observed state of VitessBackupStorage.

func NewVitessBackupStorageStatus

func NewVitessBackupStorageStatus() *VitessBackupStorageStatus

NewVitessBackupStorageStatus creates a new status with default values.

func (*VitessBackupStorageStatus) DeepCopy

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

func (*VitessBackupStorageStatus) DeepCopyInto

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

type VitessBackupSubcontrollerSpec

type VitessBackupSubcontrollerSpec struct {
	// ServiceAccountName specifies the ServiceAccount used to launch the VitessBackupStorage subcontroller pod in the
	// namespace of the VitessCluster. If empty (the default), the same account as the operator will be reused. If your
	// VitessCluster is in a different namespace than the operator, this account is unlikely to work.
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
}

func (*VitessBackupSubcontrollerSpec) DeepCopy

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

func (*VitessBackupSubcontrollerSpec) DeepCopyInto

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

type VitessCell

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

	Spec   VitessCellSpec   `json:"spec,omitempty"`
	Status VitessCellStatus `json:"status,omitempty"`
}

VitessCell represents a group of Nodes in a given failure domain (Zone), plus Vitess components like the lockserver and gateway that are local to each cell. Together, these cell-local components make it possible for Vitess instances (tablets) to run on those Nodes, and for clients to reach Vitess instances in the cell.

Note that VitessCell does not "own" the VitessKeyspaces deployed in it, just like a Node does not own the Pods deployed on it. In addition, each VitessKeyspace can deploy Vitess instances in multiple VitessCells, just like a Deployment can manage Pods that run on multiple Nodes. +kubebuilder:resource:path=vitesscells,shortName=vtc +kubebuilder:subresource:status

func (*VitessCell) DeepCopy

func (in *VitessCell) DeepCopy() *VitessCell

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

func (*VitessCell) DeepCopyInto

func (in *VitessCell) DeepCopyInto(out *VitessCell)

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

func (*VitessCell) DeepCopyObject

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

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

type VitessCellGatewaySpec

type VitessCellGatewaySpec struct {
	// Replicas is the number of vtgate instances to deploy in this cell.
	// +kubebuilder:validation:Minimum=0
	Replicas *int32 `json:"replicas,omitempty"`

	// Resources determines the compute resources reserved for each vtgate replica.
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Authentication configures how Vitess Gateway authenticates MySQL client connections.
	Authentication VitessGatewayAuthentication `json:"authentication,omitempty"`

	// SecureTransport configures secure transport connections for vtgate.
	SecureTransport *VitessGatewaySecureTransport `json:"secureTransport,omitempty"`

	// ExtraFlags can optionally be used to override default flags set by the
	// operator, or pass additional flags to vtgate. All entries must be
	// key-value string pairs of the form "flag": "value". The flag name should
	// not have any prefix (just "flag", not "-flag"). To set a boolean flag,
	// set the string value to either "true" or "false".
	ExtraFlags map[string]string `json:"extraFlags,omitempty"`

	// ExtraEnv can optionally be used to override default environment variables
	// set by the operator, or pass additional environment variables.
	ExtraEnv []corev1.EnvVar `json:"extraEnv,omitempty"`

	// ExtraVolumes can optionally be used to override default Pod volumes
	// defined by the operator, or provide additional volumes to the Pod.
	// Note that when adding a new volume, you should usually also add a
	// volumeMount to specify where in each container's filesystem the volume
	// should be mounted.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	ExtraVolumes []corev1.Volume `json:"extraVolumes,omitempty"`

	// ExtraVolumeMounts can optionally be used to override default Pod
	// volumeMounts defined by the operator, or specify additional mounts.
	// Typically, these are used to mount volumes defined through extraVolumes.
	ExtraVolumeMounts []corev1.VolumeMount `json:"extraVolumeMounts,omitempty"`

	// InitContainers can optionally be used to supply extra init containers
	// that will be run to completion one after another before any app containers are started.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// SidecarContainers can optionally be used to supply extra containers
	// that run alongside the main containers.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	SidecarContainers []corev1.Container `json:"sidecarContainers,omitempty"`

	// Affinity allows you to set rules that constrain the scheduling of
	// your vtgate pods. WARNING: These affinity rules will override all default affinities
	// that we set; in turn, we can't guarantee optimal scheduling of your pods if you
	// choose to set this field.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Annotations can optionally be used to attach custom annotations to Pods
	// created for this component. These will be attached to the underlying
	// Pods that the vtgate Deployment creates.
	Annotations map[string]string `json:"annotations,omitempty"`

	// ExtraLabels can optionally be used to attach custom labels to Pods
	// created for this component. These will be attached to the underlying
	// Pods that the vtgate Deployment creates.
	ExtraLabels map[string]string `json:"extraLabels,omitempty"`

	// Service can optionally be used to customize the per-cell vtgate Service.
	Service *ServiceOverrides `json:"service,omitempty"`

	// Tolerations allow you to schedule pods onto nodes with matching taints.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// TopologySpreadConstraint can optionally be used to
	// specify how to spread vtgate pods among the given topology
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`

	// Lifecycle can optionally be used to add container lifecycle hooks
	// to the vtgate container.
	Lifecycle corev1.Lifecycle `json:"lifecycle,omitempty"`

	// TerminationGracePeriodSeconds can optionally be used to customize
	// terminationGracePeriodSeconds of the vtgate pod.
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
}

VitessCellGatewaySpec specifies the per-cell deployment parameters for vtgate.

func (*VitessCellGatewaySpec) DeepCopy

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

func (*VitessCellGatewaySpec) DeepCopyInto

func (in *VitessCellGatewaySpec) DeepCopyInto(out *VitessCellGatewaySpec)

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

func (*VitessCellGatewaySpec) ReloadSecretNames

func (s *VitessCellGatewaySpec) ReloadSecretNames() sets.String

ReloadSecretNames returns a string set containing the names of gateway secrets that have to be forcefully reloaded by restarting all vtgates

type VitessCellGatewayStatus

type VitessCellGatewayStatus struct {
	// Available indicates whether the vtgate service is fully available.
	Available corev1.ConditionStatus `json:"available,omitempty"`
	// ServiceName is the name of the Service for this cell's vtgate.
	ServiceName string `json:"serviceName,omitempty"`
}

VitessCellGatewayStatus is a summary of the status of vtgate in this cell.

func (*VitessCellGatewayStatus) DeepCopy

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

func (*VitessCellGatewayStatus) DeepCopyInto

func (in *VitessCellGatewayStatus) DeepCopyInto(out *VitessCellGatewayStatus)

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

type VitessCellImages

type VitessCellImages struct {

	// Vtgate is the container image (including version tag) to use for Vitess Gateway instances.
	Vtgate string `json:"vtgate,omitempty"`
}

VitessCellImages specifies container images to use for this cell.

func (*VitessCellImages) DeepCopy

func (in *VitessCellImages) DeepCopy() *VitessCellImages

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

func (*VitessCellImages) DeepCopyInto

func (in *VitessCellImages) DeepCopyInto(out *VitessCellImages)

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

type VitessCellKeyspaceStatus

type VitessCellKeyspaceStatus struct {
}

VitessCellKeyspaceStatus summarizes the status of a keyspace deployed in this cell.

func (*VitessCellKeyspaceStatus) DeepCopy

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

func (*VitessCellKeyspaceStatus) DeepCopyInto

func (in *VitessCellKeyspaceStatus) DeepCopyInto(out *VitessCellKeyspaceStatus)

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

type VitessCellList

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

VitessCellList contains a list of VitessCell

func (*VitessCellList) DeepCopy

func (in *VitessCellList) DeepCopy() *VitessCellList

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

func (*VitessCellList) DeepCopyInto

func (in *VitessCellList) DeepCopyInto(out *VitessCellList)

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

func (*VitessCellList) DeepCopyObject

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

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

type VitessCellSpec

type VitessCellSpec struct {
	// VitessCellTemplate contains the user-specified parts of VitessCellSpec.
	// These are the parts that are configurable inside VitessCluster.
	// The rest of the fields below are filled in by the parent controller.
	VitessCellTemplate `json:",inline"`

	// GlobalLockserver are the params to connect to the global lockserver.
	GlobalLockserver VitessLockserverParams `json:"globalLockserver"`

	// AllCells is a list of all cells in the Vitess cluster.
	AllCells []string `json:"allCells"`

	// Images are not customizable by users at the cell level because version
	// skew across the cluster is discouraged except during rolling updates,
	// in which case this field is automatically managed by the VitessCluster
	// controller that owns this VitessCell.
	Images VitessCellImages `json:"images,omitempty"`

	// ImagePullPolicies are inherited from the VitessCluster spec.
	ImagePullPolicies VitessImagePullPolicies `json:"imagePullPolicies,omitempty"`

	// ImagePullSecrets are inherited from the VitessCluster spec.
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// ExtraVitessFlags is inherited from the parent's VitessClusterSpec.
	ExtraVitessFlags map[string]string `json:"extraVitessFlags,omitempty"`

	// TopologyReconciliation is inherited from the parent's VitessClusterSpec.
	TopologyReconciliation *TopoReconcileConfig `json:"topologyReconciliation,omitempty"`
}

VitessCellSpec defines the desired state of a VitessCell.

func (*VitessCellSpec) DeepCopy

func (in *VitessCellSpec) DeepCopy() *VitessCellSpec

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

func (*VitessCellSpec) DeepCopyInto

func (in *VitessCellSpec) DeepCopyInto(out *VitessCellSpec)

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

type VitessCellStatus

type VitessCellStatus struct {
	// The generation observed by the controller.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// Lockserver is a summary of the status of the cell-local lockserver.
	Lockserver LockserverStatus `json:"lockserver,omitempty"`
	// Gateway is a summary of the status of vtgate in this cell.
	Gateway VitessCellGatewayStatus `json:"gateway,omitempty"`
	// Keyspaces is a summary of keyspaces deployed in this cell.
	// This summary could be empty either if there are no keyspaces,
	// or if the controller failed to read the current state.
	// Use the Idle condition to distinguish these scenarios
	// when the difference matters.
	Keyspaces map[string]VitessCellKeyspaceStatus `json:"keyspaces,omitempty"`
	// Idle is a condition indicating whether the cell can be turned down.
	// If Idle is True, there are no keyspaces deployed in the cell, so it
	// should be safe to turn down the cell.
	Idle corev1.ConditionStatus `json:"idle,omitempty"`
}

VitessCellStatus defines the observed state of VitessCell

func NewVitessCellStatus

func NewVitessCellStatus() VitessCellStatus

NewVitessCellStatus creates a new status object with default values.

func (*VitessCellStatus) DeepCopy

func (in *VitessCellStatus) DeepCopy() *VitessCellStatus

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

func (*VitessCellStatus) DeepCopyInto

func (in *VitessCellStatus) DeepCopyInto(out *VitessCellStatus)

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

type VitessCellTemplate

type VitessCellTemplate struct {
	// Name is the cell name as it should be provided to Vitess.
	// Note that this is different from the VitessCell object's
	// metadata.name, which is generated by the operator.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=^[A-Za-z0-9]([_.A-Za-z0-9]*[A-Za-z0-9])?$
	Name string `json:"name"`

	// Zone is the name of the Availability Zone that this Vitess Cell should run in.
	// This value should match the value of the "failure-domain.beta.kubernetes.io/zone"
	// label on the Kubernetes Nodes in that AZ.
	// If the Kubernetes Nodes don't have such a label, leave this empty.
	Zone string `json:"zone,omitempty"`

	// Lockserver specifies either a deployed or external lockserver
	// to be used as the Vitess cell-local topology store.
	// Default: Put this cell's topology data in the global lockserver instead of its own lockserver.
	Lockserver LockserverSpec `json:"lockserver,omitempty"`

	// Gateway configures the Vitess Gateway deployment in this cell.
	Gateway VitessCellGatewaySpec `json:"gateway,omitempty"`
}

VitessCellTemplate contains only the user-specified parts of a VitessCell object.

func (*VitessCellTemplate) DeepCopy

func (in *VitessCellTemplate) DeepCopy() *VitessCellTemplate

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

func (*VitessCellTemplate) DeepCopyInto

func (in *VitessCellTemplate) DeepCopyInto(out *VitessCellTemplate)

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

type VitessCluster

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

	Spec   VitessClusterSpec   `json:"spec,omitempty"`
	Status VitessClusterStatus `json:"status,omitempty"`
}

VitessCluster is the top-level interface for configuring a cluster.

Although the VitessCluster controller creates various secondary objects like VitessCells, all the user-accessible configuration ultimately lives here. The other objects should be considered read-only representations of subsets of the dynamic cluster status. For example, you can examine a specific VitessCell object to get more details on the status of that cell than are summarized in the VitessCluster status, but any configuration changes should only be made in the VitessCluster object. +kubebuilder:resource:path=vitessclusters,shortName=vt +kubebuilder:subresource:status

func (*VitessCluster) DeepCopy

func (in *VitessCluster) DeepCopy() *VitessCluster

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

func (*VitessCluster) DeepCopyInto

func (in *VitessCluster) DeepCopyInto(out *VitessCluster)

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

func (*VitessCluster) DeepCopyObject

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

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

type VitessClusterCellStatus

type VitessClusterCellStatus struct {
	// PendingChanges describes changes to the cell that will be
	// applied the next time a rolling update allows.
	PendingChanges string `json:"pendingChanges,omitempty"`
	// GatewayAvailable indicates whether the vtgate service is fully available.
	GatewayAvailable corev1.ConditionStatus `json:"gatewayAvailable,omitempty"`
}

VitessClusterCellStatus is the status of a cell within a VitessCluster.

func NewVitessClusterCellStatus

func NewVitessClusterCellStatus() VitessClusterCellStatus

NewVitessClusterCellStatus creates a new status object with default values.

func (*VitessClusterCellStatus) DeepCopy

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

func (*VitessClusterCellStatus) DeepCopyInto

func (in *VitessClusterCellStatus) DeepCopyInto(out *VitessClusterCellStatus)

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

type VitessClusterKeyspaceStatus

type VitessClusterKeyspaceStatus struct {
	// PendingChanges describes changes to the keyspace that will be
	// applied the next time a rolling update allows.
	PendingChanges string `json:"pendingChanges,omitempty"`
	// DesiredShards is the number of desired shards. This is computed from
	// information that's already available in the spec, but clients should
	// use this value instead of trying to compute shard partitionings on their
	// own.
	DesiredShards int32 `json:"desiredShards,omitempty"`
	// Shards is the number of observed shards. This could be higher or lower
	// than desiredShards if the state has not yet converged.
	Shards int32 `json:"shards,omitempty"`
	// ReadyShards is the number of desired shards that are Ready.
	ReadyShards int32 `json:"readyShards,omitempty"`
	// UpdatedShards is the number of desired shards that are up-to-date
	// (have no pending changes).
	UpdatedShards int32 `json:"updatedShards,omitempty"`
	// DesiredTablets is the total number of desired tablets across all shards.
	// This is computed from information that's already available in the spec,
	// but clients should use this value instead of trying to compute shard
	// partitionings on their own.
	DesiredTablets int32 `json:"desiredTablets,omitempty"`
	// Tablets is the total number of observed tablets across all shards.
	// This could be higher or lower than desiredTablets if the state has not
	// yet converged.
	Tablets int32 `json:"tablets,omitempty"`
	// ReadyTablets is the number of desired tablets that are Ready.
	ReadyTablets int32 `json:"readyTablets,omitempty"`
	// UpdatedTablets is the number of desired tablets that are up-to-date
	// (have no pending changes).
	UpdatedTablets int32 `json:"updatedTablets,omitempty"`
	// Cells is a list of cells in which any observed tablets for this keyspace
	// are deployed.
	Cells []string `json:"cells,omitempty"`
}

VitessClusterKeyspaceStatus is the status of a keyspace within a VitessCluster.

func NewVitessClusterKeyspaceStatus

func NewVitessClusterKeyspaceStatus(spec *VitessKeyspaceTemplate) VitessClusterKeyspaceStatus

NewVitessClusterKeyspaceStatus creates a new status object with default values.

func (*VitessClusterKeyspaceStatus) DeepCopy

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

func (*VitessClusterKeyspaceStatus) DeepCopyInto

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

type VitessClusterList

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

VitessClusterList contains a list of VitessCluster

func (*VitessClusterList) DeepCopy

func (in *VitessClusterList) DeepCopy() *VitessClusterList

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

func (*VitessClusterList) DeepCopyInto

func (in *VitessClusterList) DeepCopyInto(out *VitessClusterList)

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

func (*VitessClusterList) DeepCopyObject

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

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

type VitessClusterSpec

type VitessClusterSpec struct {
	// Images specifies the container images (including version tag) to use
	// in the cluster.
	// Default: Let the operator choose.
	Images VitessImages `json:"images,omitempty"`

	// ImagePullPolicies specifies the container image pull policies to use for
	// images defined in the 'images' field.
	ImagePullPolicies VitessImagePullPolicies `json:"imagePullPolicies,omitempty"`

	// ImagePullSecrets specifies the image pull secrets to add to all Pods that
	// use the images defined in the 'images' field.
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// Backup specifies how to take and store Vitess backups.
	// This is optional but strongly recommended. In addition to disaster
	// recovery, Vitess currently depends on backups to support provisioning
	// of a new tablet in a shard with existing data, as an implementation detail.
	Backup *ClusterBackupSpec `json:"backup,omitempty"`

	// GlobalLockserver specifies either a deployed or external lockserver
	// to be used as the Vitess global topology store.
	// Default: Deploy an etcd cluster as the global lockserver.
	GlobalLockserver LockserverSpec `json:"globalLockserver,omitempty"`

	// Dashboard deploys a set of Vitess Dashboard servers (vtctld) for the Vitess cluster.
	VitessDashboard *VitessDashboardSpec `json:"vitessDashboard,omitempty"`

	// VtAdmin deploys a set of Vitess Admin servers for the Vitess cluster.
	VtAdmin *VtAdminSpec `json:"vtadmin,omitempty"`

	// Cells is a list of templates for VitessCells to create for this cluster.
	//
	// Each VitessCell represents a set of Nodes in a given failure domain,
	// to which VitessKeyspaces can be deployed. The VitessCell also deploys
	// cell-local services that any keyspaces deployed there will need.
	//
	// This field is required, but it may be set to an empty list: [].
	// Before removing any cell from this list, you should first ensure
	// that no keyspaces are set to deploy to this cell.
	// +patchMergeKey=name
	// +patchStrategy=merge
	Cells []VitessCellTemplate `json:"cells" patchStrategy:"merge" patchMergeKey:"name"`

	// Keyspaces defines the logical databases to deploy.
	//
	// A VitessKeyspace can deploy to multiple VitessCells.
	//
	// This field is required, but it may be set to an empty list: [].
	// Before removing any keyspace from this list, you should first ensure
	// that it is undeployed from all cells by clearing the keyspace's list
	// of target cells.
	// +patchMergeKey=name
	// +patchStrategy=merge
	Keyspaces []VitessKeyspaceTemplate `json:"keyspaces,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// ExtraVitessFlags can optionally be used to pass flags to all Vitess components.
	// WARNING: Any flags passed here must be flags that can be accepted by vtgate, vtctld, vtorc, and vttablet.
	// An example use-case would be topo flags.
	//
	// All entries must be key-value string pairs of the form "flag": "value". The flag name should
	// not have any prefix (just "flag", not "-flag"). To set a boolean flag,
	// set the string value to either "true" or "false".
	ExtraVitessFlags map[string]string `json:"extraVitessFlags,omitempty"`

	// TopologyReconciliation can be used to enable or disable registration or pruning of various vitess components to and from topo records.
	TopologyReconciliation *TopoReconcileConfig `json:"topologyReconciliation,omitempty"`

	// UpdateStrategy specifies how components in the Vitess cluster will be updated
	// when a revision is made to the VitessCluster spec.
	UpdateStrategy *VitessClusterUpdateStrategy `json:"updateStrategy,omitempty"`

	// GatewayService can optionally be used to customize the global vtgate Service.
	// Note that per-cell vtgate Services can be customized within each cell
	// definition.
	GatewayService *ServiceOverrides `json:"gatewayService,omitempty"`

	// TabletService can optionally be used to customize the global, headless vttablet Service.
	TabletService *ServiceOverrides `json:"tabletService,omitempty"`
}

VitessClusterSpec defines the desired state of VitessCluster.

func (*VitessClusterSpec) Cell

func (s *VitessClusterSpec) Cell(cellName string) *VitessCellTemplate

Cell looks up an item in the Cells list by name. It returns a pointer to the item, or nil if the specified cell doesn't exist.

func (*VitessClusterSpec) DeepCopy

func (in *VitessClusterSpec) DeepCopy() *VitessClusterSpec

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

func (*VitessClusterSpec) DeepCopyInto

func (in *VitessClusterSpec) DeepCopyInto(out *VitessClusterSpec)

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

func (*VitessClusterSpec) ZoneMap

func (s *VitessClusterSpec) ZoneMap() map[string]string

ZoneMap returns a map from cell names to zone names.

type VitessClusterStatus

type VitessClusterStatus struct {
	// The generation observed by the controller.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// GlobalLockserver is the status of the global lockserver.
	GlobalLockserver LockserverStatus `json:"globalLockserver,omitempty"`

	// GatewayServiceName is the name of the cluster-wide vtgate Service.
	GatewayServiceName string `json:"gatewayServiceName,omitempty"`

	// VitessDashboard is a summary of the status of the vtctld deployment.
	VitessDashboard VitessDashboardStatus `json:"vitessDashboard,omitempty"`

	// Vtadmin is a summary of the status of the vtadmin deployment.
	Vtadmin VtadminStatus `json:"vtadmin,omitempty"`

	// Cells is a summary of the status of desired cells.
	Cells map[string]VitessClusterCellStatus `json:"cells,omitempty"`
	// Keyspaces is a summary of the status of desired keyspaces.
	Keyspaces map[string]VitessClusterKeyspaceStatus `json:"keyspaces,omitempty"`

	// OrphanedCells is a list of unwanted cells that could not be turned down.
	OrphanedCells map[string]OrphanStatus `json:"orphanedCells,omitempty"`
	// OrphanedKeyspaces is a list of unwanted keyspaces that could not be turned down.
	OrphanedKeyspaces map[string]OrphanStatus `json:"orphanedKeyspaces,omitempty"`
}

VitessClusterStatus defines the observed state of VitessCluster

func NewVitessClusterStatus

func NewVitessClusterStatus() VitessClusterStatus

NewVitessClusterStatus creates a new status object with default values.

func (*VitessClusterStatus) DeepCopy

func (in *VitessClusterStatus) DeepCopy() *VitessClusterStatus

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

func (*VitessClusterStatus) DeepCopyInto

func (in *VitessClusterStatus) DeepCopyInto(out *VitessClusterStatus)

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

type VitessClusterUpdateStrategy

type VitessClusterUpdateStrategy struct {
	// Type selects the overall update strategy.
	//
	// Supported options are:
	//
	// - External: Schedule updates on objects that should be updated,
	//   but wait for an external tool to release them by adding the
	//   'rollout.planetscale.com/released' annotation.
	// - Immediate: Release updates to all cells, keyspaces, and shards
	//   as soon as the VitessCluster spec is changed. Perform rolling
	//   restart of one tablet Pod per shard at a time, with automatic
	//   planned reparents whenever possible to avoid master downtime.
	//
	// Default: External
	// +kubebuilder:validation:Enum=External;Immediate
	Type *VitessClusterUpdateStrategyType `json:"type,omitempty"`

	// External can optionally be used to enable the user to customize their external update strategy
	// to allow certain updates to pass through immediately without using an external tool.
	External *ExternalVitessClusterUpdateStrategyOptions `json:"external,omitempty"`
}

VitessClusterUpdateStrategy indicates the strategy that the operator will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.

func (*VitessClusterUpdateStrategy) DeepCopy

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

func (*VitessClusterUpdateStrategy) DeepCopyInto

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

type VitessClusterUpdateStrategyType

type VitessClusterUpdateStrategyType string

VitessClusterUpdateStrategyType is a string enumeration type that enumerates all possible update strategies for the VitessCluster.

const (
	// ExternalVitessClusterUpdateStrategyType relies on an external actor to release pending updates.
	ExternalVitessClusterUpdateStrategyType VitessClusterUpdateStrategyType = "External"
	// ImmediateVitessClusterUpdateStrategyType will immediately release pending updates.
	ImmediateVitessClusterUpdateStrategyType VitessClusterUpdateStrategyType = "Immediate"
)

type VitessDashboardSpec

type VitessDashboardSpec struct {
	// Cells is a list of cell names (as defined in the Cells list)
	// in which to deploy vtctld.
	// Default: Deploy to all defined cells.
	Cells []string `json:"cells,omitempty"`

	// Replicas is the number of vtctld instances to deploy in each cell.
	Replicas *int32 `json:"replicas,omitempty"`

	// Resources determines the compute resources reserved for each vtctld replica.
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// ExtraFlags can optionally be used to override default flags set by the
	// operator, or pass additional flags to vtctld. All entries must be
	// key-value string pairs of the form "flag": "value". The flag name should
	// not have any prefix (just "flag", not "-flag"). To set a boolean flag,
	// set the string value to either "true" or "false".
	ExtraFlags map[string]string `json:"extraFlags,omitempty"`

	// ExtraEnv can optionally be used to override default environment variables
	// set by the operator, or pass additional environment variables.
	ExtraEnv []corev1.EnvVar `json:"extraEnv,omitempty"`

	// ExtraVolumes can optionally be used to override default Pod volumes
	// defined by the operator, or provide additional volumes to the Pod.
	// Note that when adding a new volume, you should usually also add a
	// volumeMount to specify where in each container's filesystem the volume
	// should be mounted.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	ExtraVolumes []corev1.Volume `json:"extraVolumes,omitempty"`

	// ExtraVolumeMounts can optionally be used to override default Pod
	// volumeMounts defined by the operator, or specify additional mounts.
	// Typically, these are used to mount volumes defined through extraVolumes.
	ExtraVolumeMounts []corev1.VolumeMount `json:"extraVolumeMounts,omitempty"`

	// InitContainers can optionally be used to supply extra init containers
	// that will be run to completion one after another before any app containers are started.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// SidecarContainers can optionally be used to supply extra containers
	// that run alongside the main containers.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	SidecarContainers []corev1.Container `json:"sidecarContainers,omitempty"`

	// Affinity allows you to set rules that constrain the scheduling of
	// your vtctld pods. WARNING: These affinity rules will override all default affinities
	// that we set; in turn, we can't guarantee optimal scheduling of your pods if you
	// choose to set this field.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Annotations can optionally be used to attach custom annotations to Pods
	// created for this component. These will be attached to the underlying
	// Pods that the vtctld Deployment creates.
	Annotations map[string]string `json:"annotations,omitempty"`

	// ExtraLabels can optionally be used to attach custom labels to Pods
	// created for this component. These will be attached to the underlying
	// Pods that the vtctld Deployment creates.
	ExtraLabels map[string]string `json:"extraLabels,omitempty"`

	// Service can optionally be used to customize the vtctld Service.
	Service *ServiceOverrides `json:"service,omitempty"`

	// Tolerations allow you to schedule pods onto nodes with matching taints.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

VitessDashboardSpec specifies deployment parameters for vtctld.

func (*VitessDashboardSpec) DeepCopy

func (in *VitessDashboardSpec) DeepCopy() *VitessDashboardSpec

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

func (*VitessDashboardSpec) DeepCopyInto

func (in *VitessDashboardSpec) DeepCopyInto(out *VitessDashboardSpec)

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

type VitessDashboardStatus

type VitessDashboardStatus struct {
	// Available indicates whether the vtctld service has available endpoints.
	Available corev1.ConditionStatus `json:"available,omitempty"`
	// ServiceName is the name of the Service for this cluster's vtctld.
	ServiceName string `json:"serviceName,omitempty"`
}

VitessDashboardStatus is a summary of the status of the vtctld deployment.

func (*VitessDashboardStatus) DeepCopy

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

func (*VitessDashboardStatus) DeepCopyInto

func (in *VitessDashboardStatus) DeepCopyInto(out *VitessDashboardStatus)

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

type VitessGatewayAuthentication

type VitessGatewayAuthentication struct {
	// Static configures vtgate to use a static file containing usernames and passwords.
	Static *VitessGatewayStaticAuthentication `json:"static,omitempty"`
}

VitessGatewayAuthentication configures authentication for vtgate in this cell.

func (*VitessGatewayAuthentication) DeepCopy

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

func (*VitessGatewayAuthentication) DeepCopyInto

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

type VitessGatewaySecureTransport

type VitessGatewaySecureTransport struct {
	// Required configures vtgate to reject non-secure transport connections.
	// Applies only to MySQL protocol connections.
	// All GRPC transport is required to be encrypted when certs are set.
	Required bool `json:"required,omitempty"`

	// TLS configures vtgate to use TLS encrypted transport.
	TLS *VitessGatewayTLSSecureTransport `json:"tls,omitempty"`
}

VitessGatewaySecureTransport configures secure transport connections for vtgate.

func (*VitessGatewaySecureTransport) DeepCopy

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

func (*VitessGatewaySecureTransport) DeepCopyInto

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

type VitessGatewayStaticAuthentication

type VitessGatewayStaticAuthentication struct {
	// Secret configures vtgate to load the static auth file from a given key in a given Secret.
	Secret *SecretSource `json:"secret,omitempty"`
}

VitessGatewayStaticAuthentication configures static file authentication for vtgate.

func (*VitessGatewayStaticAuthentication) DeepCopy

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

func (*VitessGatewayStaticAuthentication) DeepCopyInto

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

type VitessGatewayTLSSecureTransport

type VitessGatewayTLSSecureTransport struct {
	// ClientCACertSecret configures vtgate to load the TLS certificate authority PEM file from a given key in a given Secret.
	// If specified, checks client certificates are signed by this CA certificate.
	// Optional.
	ClientCACertSecret *SecretSource `json:"clientCACertSecret,omitempty"`

	// CertSecret configures vtgate to load the TLS cert PEM file from a given key in a given Secret.
	CertSecret *SecretSource `json:"certSecret,omitempty"`
	// KeySecret configures vtgate to load the TLS key PEM file from a given key in a given Secret.
	KeySecret *SecretSource `json:"keySecret,omitempty"`
}

VitessGatewayAuthentication configures authentication for vtgate in this cell.

func (*VitessGatewayTLSSecureTransport) DeepCopy

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

func (*VitessGatewayTLSSecureTransport) DeepCopyInto

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

type VitessImagePullPolicies

type VitessImagePullPolicies struct {
	// Vtctld is the container image pull policy to use for Vitess Dashboard instances.
	Vtctld corev1.PullPolicy `json:"vtctld,omitempty"`
	// Vtadmin is the container image pull policy to use for Vtadmin instances.
	Vtadmin corev1.PullPolicy `json:"vtadmin,omitempty"`
	// Vtorc is the container image pull policy to use for Vitess Orchestrator instances.
	Vtorc corev1.PullPolicy `json:"vtorc,omitempty"`
	// Vtgate is the container image pull policy to use for Vitess Gateway instances.
	Vtgate corev1.PullPolicy `json:"vtgate,omitempty"`
	// Vttablet is the container image pull policy to use for Vitess Tablet instances.
	Vttablet corev1.PullPolicy `json:"vttablet,omitempty"`
	// Vtbackup is the container image pull policy to use for Vitess Backup jobs.
	Vtbackup corev1.PullPolicy `json:"vtbackup,omitempty"`

	// Mysqld is the container image pull policy to use for mysqld.
	Mysqld corev1.PullPolicy `json:"mysqld,omitempty"`
	// MysqldExporter is the container image pull policy to use for mysqld-exporter.
	MysqldExporter corev1.PullPolicy `json:"mysqldExporter,omitempty"`
}

VitessImagePullPolicies specifies container image pull policies to use for Vitess components.

func (*VitessImagePullPolicies) DeepCopy

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

func (*VitessImagePullPolicies) DeepCopyInto

func (in *VitessImagePullPolicies) DeepCopyInto(out *VitessImagePullPolicies)

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

type VitessImages

type VitessImages struct {

	// Vtctld is the container image (including version tag) to use for Vitess Dashboard instances.
	Vtctld string `json:"vtctld,omitempty"`
	// Vtadmin is the container image (including version tag) to use for Vitess Admin instances.
	Vtadmin string `json:"vtadmin,omitempty"`
	// Vtorc is the container image (including version tag) to use for Vitess Orchestrator instances.
	Vtorc string `json:"vtorc,omitempty"`
	// Vtgate is the container image (including version tag) to use for Vitess Gateway instances.
	Vtgate string `json:"vtgate,omitempty"`
	// Vttablet is the container image (including version tag) to use for Vitess Tablet instances.
	Vttablet string `json:"vttablet,omitempty"`
	// Vtbackup is the container image (including version tag) to use for Vitess Backup jobs.
	Vtbackup string `json:"vtbackup,omitempty"`

	// Mysqld specifies the container image to use for mysqld, as well as
	// declaring which MySQL flavor setting in Vitess the image is
	// compatible with. Only one flavor image may be provided at a time.
	// mysqld running alongside each tablet.
	Mysqld *MysqldImage `json:"mysqld,omitempty"`
	// MysqldExporter specifies the container image to use for mysqld-exporter.
	MysqldExporter string `json:"mysqldExporter,omitempty"`
}

VitessImages specifies container images to use for Vitess components.

func (*VitessImages) DeepCopy

func (in *VitessImages) DeepCopy() *VitessImages

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

func (*VitessImages) DeepCopyInto

func (in *VitessImages) DeepCopyInto(out *VitessImages)

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

type VitessKeyRange

type VitessKeyRange struct {
	// Start is a lowercase hexadecimal string representation of an arbitrary-length sequence of bytes.
	// If Start is the empty string, the key range is unbounded at the bottom.
	// If Start is not empty, the bytes of a keyspace ID must compare greater
	// than or equal to Start in lexicographical order to be in the range.
	// +kubebuilder:validation:Pattern=^([0-9a-f][0-9a-f])*$
	Start string `json:"start,omitempty"`
	// End is a lowercase hexadecimal string representation of an arbitrary-length sequence of bytes.
	// If End is the empty string, the key range is unbounded at the top.
	// If End is not empty, the bytes of a keyspace ID must compare strictly less than End in
	// lexicographical order to be in the range.
	// +kubebuilder:validation:Pattern=^([0-9a-f][0-9a-f])*$
	End string `json:"end,omitempty"`
}

VitessKeyRange specifies a range of keyspace IDs.

func (*VitessKeyRange) DeepCopy

func (in *VitessKeyRange) DeepCopy() *VitessKeyRange

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

func (*VitessKeyRange) DeepCopyInto

func (in *VitessKeyRange) DeepCopyInto(out *VitessKeyRange)

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

func (*VitessKeyRange) FillFromByteKeyRange

func (v *VitessKeyRange) FillFromByteKeyRange(kr topodatapb.KeyRange)

FillFromByteKeyRange is a method to fill a VitessKeyRange from a topodatapb.KeyRange (encoding from []byte to hex string).

func (*VitessKeyRange) SafeName

func (kr *VitessKeyRange) SafeName() string

SafeName prints a VitessKeyRange in a format that's safe to use in a Kubernetes object name or label value. In particular, such names can neither begin nor end with '-' so we fill in a wildcard character 'x' to represent an unbounded start or end value (usually represented in Vitess by an empty string).

WARNING: DO NOT change the behavior of this function, as that may

cause shards to be deleted.

func (*VitessKeyRange) String

func (kr *VitessKeyRange) String() string

String prints a VitessKeyRange in the format used within Vitess. Be aware that this format is not safe to use in Kubernetes object names or label values. Use SafeName() for those instead.

type VitessKeyspace

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

	Spec   VitessKeyspaceSpec   `json:"spec,omitempty"`
	Status VitessKeyspaceStatus `json:"status,omitempty"`
}

VitessKeyspace represents the deployment of a logical database in Vitess. Each keyspace consists of a number of shards, which then consist of tablets. The tablets belonging to one VitessKeyspace can ultimately be deployed across various VitessCells. +kubebuilder:resource:path=vitesskeyspaces,shortName=vtk +kubebuilder:subresource:status

func (*VitessKeyspace) DeepCopy

func (in *VitessKeyspace) DeepCopy() *VitessKeyspace

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

func (*VitessKeyspace) DeepCopyInto

func (in *VitessKeyspace) DeepCopyInto(out *VitessKeyspace)

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

func (*VitessKeyspace) DeepCopyObject

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

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

type VitessKeyspaceCondition

type VitessKeyspaceCondition struct {
	// Type is the type of the condition.
	Type VitessKeyspaceConditionType `json:"type"`
	// Status is the status of the condition.
	// Can be True, False, Unknown.
	// +kubebuilder:validation:Enum=True;False;Unknown
	Status corev1.ConditionStatus `json:"status"`
	// Last time the condition transitioned from one status to another.
	// Optional.
	LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
	// Unique, one-word, PascalCase reason for the condition's last transition.
	// Optional.
	Reason string `json:"reason,omitempty"`
	// Human-readable message indicating details about last transition.
	// Optional.
	Message string `json:"message,omitempty"`
}

VitessKeyspaceCondition contains details for the current condition of this VitessKeyspace.

func NewVitessKeyspaceCondition

func NewVitessKeyspaceCondition(condType VitessKeyspaceConditionType) *VitessKeyspaceCondition

NewVitessKeyspaceCondition returns an init VitessKeyspaceCondition object.

func (*VitessKeyspaceCondition) DeepCopy

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

func (*VitessKeyspaceCondition) DeepCopyInto

func (in *VitessKeyspaceCondition) DeepCopyInto(out *VitessKeyspaceCondition)

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

func (*VitessKeyspaceCondition) StatusDuration

func (c *VitessKeyspaceCondition) StatusDuration() time.Duration

StatusDuration returns the duration since LastTransitionTime. It represents how long we've been in the current status for this condition. If LastTransitionTime is nil, then we return zero to indicate that we have no confidence about the duration of the status.

type VitessKeyspaceConditionType

type VitessKeyspaceConditionType string

VitessKeyspaceConditionType is a valid value for the key of a VitessKeyspaceCondition map where the key is a VitessKeyspaceConditionType and the value is a VitessKeyspaceCondition.

const (
	// VitessKeyspaceReshardingActive indicates whether the keyspace has an active resharding operation,
	VitessKeyspaceReshardingActive VitessKeyspaceConditionType = "ReshardingActive"
	// VitessKeyspaceReshardingInSync indicates whether the keyspace has an active
	// resharding operation whose target shards are ready to serve if traffic is switched.
	VitessKeyspaceReshardingInSync VitessKeyspaceConditionType = "ReshardingInSync"
	// VitessKeyspaceReady indicates whether the tablet Pods of the keyspace's serving partitioning are all Ready.
	VitessKeyspaceReady VitessKeyspaceConditionType = "Ready"
)

These are valid conditions of VitessKeyspace.

type VitessKeyspaceCustomPartitioning

type VitessKeyspaceCustomPartitioning struct {
	// Shards is a list of explicit shard specifications.
	// +patchMergeKey=keyRange
	// +patchStrategy=merge
	Shards []VitessKeyspaceKeyRangeShard `json:"shards" patchStrategy:"merge" patchMergeKey:"keyRange"`
}

VitessKeyspaceCustomPartitioning lets you explicitly specify the key range of every shard.

func (*VitessKeyspaceCustomPartitioning) DeepCopy

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

func (*VitessKeyspaceCustomPartitioning) DeepCopyInto

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

type VitessKeyspaceEqualPartitioning

type VitessKeyspaceEqualPartitioning struct {
	// Parts is the number of equal parts to split the keyspace into.
	// If you need shards that are not equal-sized, use custom partitioning instead.
	//
	// Note that if the number of parts is not a power of 2, the key ranges will
	// only be roughly equal in size.
	//
	// WARNING: DO NOT change the number of parts in a partitioning after deploying.
	//          That's effectively deleting the old partitioning and adding a new one,
	//          which can lead to downtime or data loss. Instead, add an additional
	//          partitioning with the desired number of parts, perform a resharding
	//          migration, and then remove the old partitioning.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65536
	Parts int32 `json:"parts"`

	// ShardTemplate is the configuration used for each equal-sized shard.
	// If you need shards that don't all share the same configuration,
	// use custom partitioning instead.
	ShardTemplate VitessShardTemplate `json:"shardTemplate,omitempty"`
}

VitessKeyspaceEqualPartitioning splits the keyspace into some number of equal parts.

func (*VitessKeyspaceEqualPartitioning) DeepCopy

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

func (*VitessKeyspaceEqualPartitioning) DeepCopyInto

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

func (*VitessKeyspaceEqualPartitioning) KeyRanges

KeyRanges returns the set of ranges for an equal partitioning.

type VitessKeyspaceImages

type VitessKeyspaceImages struct {

	// Vttablet is the container image (including version tag) to use for Vitess Tablet instances.
	Vttablet string `json:"vttablet,omitempty"`
	// Vtorc is the container image (including version tag) to use for Vitess Orchestrator instances.
	Vtorc string `json:"vtorc,omitempty"`
	// Vtbackup is the container image (including version tag) to use for Vitess Backup jobs.
	Vtbackup string `json:"vtbackup,omitempty"`
	// Mysqld specifies the container image to use for mysqld, as well as
	// declaring which MySQL flavor setting in Vitess the image is
	// compatible with. Only one flavor image may be provided at a time.
	// mysqld running alongside each tablet.
	Mysqld *MysqldImage `json:"mysqld,omitempty"`
	// MysqldExporter specifies the container image for mysqld-exporter.
	MysqldExporter string `json:"mysqldExporter,omitempty"`
}

VitessKeyspaceImages specifies container images to use for this keyspace.

func (*VitessKeyspaceImages) DeepCopy

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

func (*VitessKeyspaceImages) DeepCopyInto

func (in *VitessKeyspaceImages) DeepCopyInto(out *VitessKeyspaceImages)

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

type VitessKeyspaceKeyRangeShard

type VitessKeyspaceKeyRangeShard struct {
	// KeyRange is the range of keys that this shard serves.
	//
	// WARNING: DO NOT change the key range of a shard after deploying.
	//          That's effectively deleting the old shard and adding a new one,
	//          which can lead to downtime or data loss. Instead, add an additional
	//          partitioning with the desired set of shards, perform a resharding
	//          migration, and then remove the old partitioning.
	KeyRange VitessKeyRange `json:"keyRange"`

	// VitessShardTemplate is the configuration for the shard.
	VitessShardTemplate `json:",inline"`
}

VitessKeyspaceKeyRangeShard defines a shard based on a key range.

func (*VitessKeyspaceKeyRangeShard) DeepCopy

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

func (*VitessKeyspaceKeyRangeShard) DeepCopyInto

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

type VitessKeyspaceList

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

VitessKeyspaceList contains a list of VitessKeyspace

func (*VitessKeyspaceList) DeepCopy

func (in *VitessKeyspaceList) DeepCopy() *VitessKeyspaceList

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

func (*VitessKeyspaceList) DeepCopyInto

func (in *VitessKeyspaceList) DeepCopyInto(out *VitessKeyspaceList)

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

func (*VitessKeyspaceList) DeepCopyObject

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

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

type VitessKeyspacePartitioning

type VitessKeyspacePartitioning struct {
	// Equal partitioning splits the keyspace into some number of equal parts,
	// assuming that the keyspace IDs are uniformly distributed, for example
	// because they're generated by a hash vindex.
	Equal *VitessKeyspaceEqualPartitioning `json:"equal,omitempty"`

	// Custom partitioning lets you explicitly specify the key range of every shard,
	// in case you don't want them to be divided equally.
	Custom *VitessKeyspaceCustomPartitioning `json:"custom,omitempty"`
}

VitessKeyspacePartitioning defines a set of shards by dividing the keyspace into key ranges. Each field is a different method of dividing the keyspace. Only one field should be set on a given partitioning.

func (*VitessKeyspacePartitioning) DeepCopy

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

func (*VitessKeyspacePartitioning) DeepCopyInto

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

func (*VitessKeyspacePartitioning) ShardNameSet

func (p *VitessKeyspacePartitioning) ShardNameSet() sets.String

ShardNameSet returns the set of shard names in this partitioning.

func (*VitessKeyspacePartitioning) TabletPools

TabletPools returns the list of tablet pools from whichever paritioning sub-field is defined.

func (*VitessKeyspacePartitioning) TotalReplicas

func (p *VitessKeyspacePartitioning) TotalReplicas() int32

TotalReplicas returns the total number of replicas in all tablet pools of all shards in this partitioning.

type VitessKeyspacePartitioningStatus

type VitessKeyspacePartitioningStatus struct {
	// ShardNames is a sorted list of shards in this partitioning,
	// in the format Vitess uses for shard names.
	ShardNames []string `json:"shardNames,omitempty"`
	// ServingWrites is a condition indicating whether all shards in this
	// partitioning are serving writes for their key ranges.
	// Note that False only means not all shards are serving writes; it's still
	// possible that some shards in this partitioning are serving writes.
	// Check the per-shard status for full details.
	ServingWrites corev1.ConditionStatus `json:"servingWrites,omitempty"`
	// DesiredTablets is the number of desired tablets. This is computed from
	// information that's already available in the spec, but clients should
	// use this value instead of trying to compute shard partitionings on their
	// own.
	DesiredTablets int32 `json:"desiredTablets,omitempty"`
	// Tablets is the number of observed tablets. This could be higher or
	// lower than desiredTablets if the state has not yet converged.
	Tablets int32 `json:"tablets,omitempty"`
	// ReadyTablets is the number of desired tablets that are Ready.
	ReadyTablets int32 `json:"readyTablets,omitempty"`
	// UpdatedTablets is the number of desired tablets that are up-to-date
	// (have no pending changes).
	UpdatedTablets int32 `json:"updatedTablets,omitempty"`
	// DesiredShards is the number of desired shards. This is computed from
	// information that's already available in the spec, but clients should
	// use this value instead of trying to compute shard partitionings on their
	// own.
	DesiredShards int32 `json:"desiredShards,omitempty"`
	// ReadyShards is the number of desired shards that are Ready.
	ReadyShards int32 `json:"readyShards,omitempty"`
}

VitessKeyspacePartitioningStatus aggregates status for all shards in a given partitioning.

func NewVitessKeyspacePartitioningStatus

func NewVitessKeyspacePartitioningStatus(partitioning *VitessKeyspacePartitioning) VitessKeyspacePartitioningStatus

NewVitessKeyspacePartitioningStatus creates a new status object with default values.

func (*VitessKeyspacePartitioningStatus) DeepCopy

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

func (*VitessKeyspacePartitioningStatus) DeepCopyInto

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

type VitessKeyspaceShardStatus

type VitessKeyspaceShardStatus struct {
	// HasMaster is a condition indicating whether the Vitess topology
	// reflects a master for this shard.
	HasMaster corev1.ConditionStatus `json:"hasMaster,omitempty"`
	// ServingWrites is a condition indicating whether this shard is the one
	// that serves writes for its key range, according to Vitess topology.
	// A shard might be deployed without serving writes if, for example, it is
	// the target of a resharding operation that is still in progress.
	ServingWrites corev1.ConditionStatus `json:"servingWrites,omitempty"`
	// DesiredTablets is the number of desired tablets. This is computed from
	// information that's already available in the spec, but clients should
	// use this value instead of trying to compute shard partitionings on their
	// own.
	DesiredTablets int32 `json:"desiredTablets,omitempty"`
	// Tablets is the number of observed tablets. This could be higher or
	// lower than desiredTablets if the state has not yet converged.
	Tablets int32 `json:"tablets,omitempty"`
	// ReadyTablets is the number of desired tablets that are Ready.
	ReadyTablets int32 `json:"readyTablets,omitempty"`
	// UpdatedTablets is the number of desired tablets that are up-to-date
	// (have no pending changes).
	UpdatedTablets int32 `json:"updatedTablets,omitempty"`
	// PendingChanges describes changes to the shard that will be applied
	// the next time a rolling update allows.
	PendingChanges string `json:"pendingChanges,omitempty"`
	// Cells is a list of cells in which any tablets for this shard are deployed.
	Cells []string `json:"cells,omitempty"`
}

VitessKeyspaceShardStatus is the status of a shard within a keyspace.

func NewVitessKeyspaceShardStatus

func NewVitessKeyspaceShardStatus(spec *VitessKeyspaceKeyRangeShard) VitessKeyspaceShardStatus

NewVitessKeyspaceShardStatus creates a new status object with default values.

func (*VitessKeyspaceShardStatus) DeepCopy

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

func (*VitessKeyspaceShardStatus) DeepCopyInto

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

type VitessKeyspaceSpec

type VitessKeyspaceSpec struct {
	// VitessKeyspaceTemplate contains the user-specified parts of VitessKeyspaceSpec.
	// These are the parts that are configurable inside VitessCluster.
	// The rest of the fields below are filled in by the parent controller.
	VitessKeyspaceTemplate `json:",inline"`

	// GlobalLockserver are the params to connect to the global lockserver.
	GlobalLockserver VitessLockserverParams `json:"globalLockserver"`

	// Images are inherited from the VitessCluster spec, unless the user has
	// specified keyspace-level overrides. Version skew across the cluster is
	// discouraged except during rolling updates, in which case this field is
	// automatically managed by the VitessCluster controller that owns this
	// VitessKeyspace, or else when a user has specified a keyspace-level
	// images on VitessKeyspaceTemplate.
	Images VitessKeyspaceImages `json:"images,omitempty"`

	// ImagePullPolicies are inherited from the VitessCluster spec.
	ImagePullPolicies VitessImagePullPolicies `json:"imagePullPolicies,omitempty"`

	// ImagePullSecrets are inherited from the VitessCluster spec.
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// ZoneMap is a map from Vitess cell name to zone (failure domain) name
	// for all cells defined in the VitessCluster.
	ZoneMap map[string]string `json:"zoneMap"`

	// BackupLocations are the backup locations defined in the VitessCluster.
	BackupLocations []VitessBackupLocation `json:"backupLocations,omitempty"`

	// BackupEngine specifies the Vitess backup engine to use, either "builtin" or "xtrabackup".
	BackupEngine VitessBackupEngine `json:"backupEngine,omitempty"`

	// ExtraVitessFlags is inherited from the parent's VitessClusterSpec.
	ExtraVitessFlags map[string]string `json:"extraVitessFlags,omitempty"`

	// TopologyReconciliation is inherited from the parent's VitessClusterSpec.
	TopologyReconciliation *TopoReconcileConfig `json:"topologyReconciliation,omitempty"`

	// UpdateStrategy is inherited from the parent's VitessClusterSpec.
	UpdateStrategy *VitessClusterUpdateStrategy `json:"updateStrategy,omitempty"`
}

VitessKeyspaceSpec defines the desired state of a VitessKeyspace.

func (*VitessKeyspaceSpec) CellNames

func (s *VitessKeyspaceSpec) CellNames() []string

CellNames returns a sorted list of all cells in which any part of the keyspace (any tablet pool of any shard) should be deployed.

func (*VitessKeyspaceSpec) DeepCopy

func (in *VitessKeyspaceSpec) DeepCopy() *VitessKeyspaceSpec

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

func (*VitessKeyspaceSpec) DeepCopyInto

func (in *VitessKeyspaceSpec) DeepCopyInto(out *VitessKeyspaceSpec)

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

type VitessKeyspaceStatus

type VitessKeyspaceStatus struct {
	// The generation observed by the controller.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// Shards is a summary of the status of all desired shards.
	Shards map[string]VitessKeyspaceShardStatus `json:"shards,omitempty"`
	// Partitionings is an aggregation of status for all shards in each partitioning.
	Partitionings []VitessKeyspacePartitioningStatus `json:"partitionings,omitempty"`
	// OrphanedShards is a list of unwanted shards that could not be turned down.
	OrphanedShards map[string]OrphanStatus `json:"orphanedShards,omitempty"`
	// Idle is a condition indicating whether the keyspace can be turned down.
	// If Idle is True, the keyspace is not deployed in any cells, so it should
	// be safe to turn down the keyspace.
	Idle corev1.ConditionStatus `json:"idle,omitempty"`
	// ReshardingStatus provides information about an active resharding operation, if any.
	// This field is only present if the ReshardingActive condition is True. If that condition is Unknown,
	// it means the operator was unable to query resharding status from Vitess.
	Resharding *ReshardingStatus `json:"resharding,omitempty"`
	// Conditions is a list of all VitessKeyspace specific conditions we want to set and monitor.
	// It's ok for multiple controllers to add conditions here, and those conditions will be preserved.
	Conditions []VitessKeyspaceCondition `json:"conditions,omitempty"`
}

VitessKeyspaceStatus defines the observed state of a VitessKeyspace.

func NewVitessKeyspaceStatus

func NewVitessKeyspaceStatus() VitessKeyspaceStatus

NewVitessKeyspaceStatus creates a new status object with default values.

func (*VitessKeyspaceStatus) DeepCopy

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

func (*VitessKeyspaceStatus) DeepCopyConditions

func (s *VitessKeyspaceStatus) DeepCopyConditions() []VitessKeyspaceCondition

DeepCopyConditions deep copies the conditions map for VitessKeyspaceStatus.

func (*VitessKeyspaceStatus) DeepCopyInto

func (in *VitessKeyspaceStatus) DeepCopyInto(out *VitessKeyspaceStatus)

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

func (*VitessKeyspaceStatus) GetCondition

GetCondition provides map style access to retrieve a condition from the conditions list by it's type If the condition doesn't exist, we return false for the exists named return value.

func (*VitessKeyspaceStatus) SetConditionStatus

func (s *VitessKeyspaceStatus) SetConditionStatus(condType VitessKeyspaceConditionType, newStatus corev1.ConditionStatus, reason, message string)

SetConditionStatus first ensures we have allocated a conditions map, and also ensures we have allocated a ShardCondition for the VitessKeyspaceConditionType key supplied. It then moves onto setting the conditions status. For the condition's status, it always updates the reason and message every time. If the current status is the same as the supplied newStatus, then we do not update LastTransitionTime. However, if newStatus is different from current status, then we update the status and update the transition time.

type VitessKeyspaceTemplate

type VitessKeyspaceTemplate struct {
	// Name is the keyspace name as it should be provided to Vitess.
	// Note that this is different from the VitessKeyspace object's
	// metadata.name, which is generated by the operator.
	//
	// WARNING: DO NOT change the name of a keyspace that was already deployed.
	// Keyspaces cannot be renamed, so this will be interpreted as an
	// instruction to delete the old keyspace and create a new one.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=^[A-Za-z0-9]([A-Za-z0-9-_.]*[A-Za-z0-9])?$
	Name string `json:"name"`

	// DatabaseName is the name to use for the underlying, physical MySQL
	// database created to hold data for the keyspace.
	//
	// This name is mostly hidden from Vitess clients, which should see and use
	// only the keyspace name as a logical database. However, you may want to
	// set this to control the name used by clients that bypass Vitess and
	// connect directly to the underlying MySQL, such as certain DBA tools.
	//
	// The default, when the field is either left unset or set to empty string,
	// is to add a "vt_" prefix to the keyspace name since that has historically
	// been the default in Vitess itself. However, it's often preferable to set
	// this to be the same as the keyspace name to reduce confusion.
	//
	// Default: Add a "vt_" prefix to the keyspace name.
	DatabaseName string `json:"databaseName,omitempty"`

	// DurabilityPolicy is the name of the durability policy to use for the keyspace.
	// If unspecified, vtop will not set the durability policy.
	DurabilityPolicy string `json:"durabilityPolicy,omitempty"`

	// VitessOrchestrator deploys a set of Vitess Orchestrator (vtorc) servers for the Keyspace.
	// It is highly recommended that you set disable_active_reparents=true
	// for the vttablets if enabling vtorc.
	VitessOrchestrator *VitessOrchestratorSpec `json:"vitessOrchestrator,omitempty"`

	// Partitionings specify how to divide the keyspace up into shards by
	// defining the range of keyspace IDs that each shard contains.
	// For example, you might divide the keyspace into N equal-sized key ranges.
	//
	// Note that this is distinct from defining how each row maps to a keyspace ID,
	// which is done in the VSchema. Partitioning is purely an operational concern
	// (scaling the infrastructure), while VSchema is an application-level concern
	// (modeling relationships between data). This separation of concerns allows
	// resharding to occur generically at the infrastructure level without any
	// knowledge of the data model.
	//
	// Each partitioning must define a set of shards that fully covers the
	// space of all possible keyspace IDs; there can be no gaps between ranges.
	// There's usually only one partitioning present at a time, but during
	// resharding, it's necessary to launch the destination shards alongside
	// the source shards. When the resharding is complete, the old partitioning
	// can be removed, which will turn down (undeploy) any unneeded shards.
	//
	// If only some shards are being split or joined during resharding,
	// the shards that aren't changing must be specified in both partitionings,
	// although the common shards will be shared (only deployed once).
	// If the per-shard configuration differs, the configuration in the latter
	// partitioning (in the order listed in this field) will be used.
	// For this reason, it's recommended to add new partitionings at the end,
	// and only remove partitionings from the beginning.
	//
	// This field is required. An unsharded keyspace may be specified as a
	// partitioning into 1 part.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=2
	Partitionings []VitessKeyspacePartitioning `json:"partitionings"`

	// TurndownPolicy specifies what should happen if this keyspace is ever
	// removed from the VitessCluster spec. By default, removing a keyspace
	// entry from the VitessCluster spec will NOT actually turn down the
	// deployed resources, unless it can be verified that the keyspace was
	// previously set to have 0 total desired tablets across all shards.
	//
	// With this default policy (RequireIdle), before removing the keyspace
	// entry from the spec, you must first edit the keyspace entry to remove
	// all tablet pools from all shards, and wait for that change to roll out.
	// If a keyspace entry is removed too soon, the keyspace resources will
	// remain deployed indefinitely, and the keyspace will be listed in the
	// orphanedKeyspaces field of VitessCluster status.
	//
	// This is a safety mechanism to prevent accidental edits to the cluster
	// object from having immediate, destructive consequences. If the cluster
	// spec is only ever edited by automation whose edits you trust to be safe,
	// you can set the policy to Immediate to skip these checks.
	//
	// Default: RequireIdle
	// +kubebuilder:validation:Enum=RequireIdle;Immediate
	TurndownPolicy VitessKeyspaceTurndownPolicy `json:"turndownPolicy,omitempty"`

	// Annotations can optionally be used to attach custom annotations to the VitessKeyspace object.
	Annotations map[string]string `json:"annotations,omitempty"`

	// For special cases, users may specify per-VitessKeyspace images. An
	// example: migrating from MySQL 5.7 to MySQL 8.0 via a `MoveTables`
	// operation, after which the source keyspace is destroyed.
	Images VitessKeyspaceTemplateImages `json:"images,omitempty"`
}

VitessKeyspaceTemplate contains only the user-specified parts of a VitessKeyspace object.

func (*VitessKeyspaceTemplate) DeepCopy

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

func (*VitessKeyspaceTemplate) DeepCopyInto

func (in *VitessKeyspaceTemplate) DeepCopyInto(out *VitessKeyspaceTemplate)

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

func (*VitessKeyspaceTemplate) ShardTemplates

func (spec *VitessKeyspaceTemplate) ShardTemplates() []*VitessKeyspaceKeyRangeShard

ShardTemplates returns a list of shards to satisfy all partitionings defined in the keyspace. The list is returned in sorted order for determinism.

type VitessKeyspaceTemplateImages

type VitessKeyspaceTemplateImages struct {
	// Mysqld specifies the container image to use for mysqld, as well as
	// declaring which MySQL flavor setting in Vitess the image is
	// compatible with. Only one flavor image may be provided at a time.
	// mysqld running alongside each tablet.
	Mysqld *MysqldImageNew `json:"mysqld,omitempty"`
}

VitessKeyspaceTemplateImages specifies user-definable container images to use for this keyspace.

func (*VitessKeyspaceTemplateImages) DeepCopy

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

func (*VitessKeyspaceTemplateImages) DeepCopyInto

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

type VitessKeyspaceTurndownPolicy

type VitessKeyspaceTurndownPolicy string

VitessKeyspaceTurndownPolicy is the policy for turning down a keyspace.

const (
	// VitessKeyspaceTurndownPolicyRequireIdle specifies that keyspace may only
	// be turned down if they are idle; that is, if they have no resources
	// deployed.
	VitessKeyspaceTurndownPolicyRequireIdle VitessKeyspaceTurndownPolicy = "RequireIdle"
	// VitessKeyspaceTurndownPolicyImmediate specifies that removing a keyspace
	// from the VitessCluster spec should immediately trigger turn-down of
	// all resources previously deployed for the keyspace.
	VitessKeyspaceTurndownPolicyImmediate VitessKeyspaceTurndownPolicy = "Immediate"
)

type VitessLockserverParams

type VitessLockserverParams struct {
	// Implementation specifies which Vitess "topo" plugin to use.
	Implementation string `json:"implementation"`
	// Address is the host:port of the lockserver client endpoint.
	Address string `json:"address"`
	// RootPath is a path prefix for all lockserver data belonging to a given Vitess cluster.
	// Multiple Vitess clusters can share a lockserver as long as they have unique root paths.
	RootPath string `json:"rootPath"`
}

VitessLockserverParams contains only the values that Vitess needs to connect to a given lockserver.

func (*VitessLockserverParams) DeepCopy

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

func (*VitessLockserverParams) DeepCopyInto

func (in *VitessLockserverParams) DeepCopyInto(out *VitessLockserverParams)

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

type VitessOrchestratorSpec

type VitessOrchestratorSpec struct {
	// Resources determines the compute resources reserved for each vtorc replica.
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// ExtraFlags can optionally be used to override default flags set by the
	// operator, or pass additional flags to vtorc. All entries must be
	// key-value string pairs of the form "flag": "value". The flag name should
	// not have any prefix (just "flag", not "-flag"). To set a boolean flag,
	// set the string value to either "true" or "false".
	ExtraFlags map[string]string `json:"extraFlags,omitempty"`

	// ExtraEnv can optionally be used to override default environment variables
	// set by the operator, or pass additional environment variables.
	ExtraEnv []corev1.EnvVar `json:"extraEnv,omitempty"`

	// ExtraVolumes can optionally be used to override default Pod volumes
	// defined by the operator, or provide additional volumes to the Pod.
	// Note that when adding a new volume, you should usually also add a
	// volumeMount to specify where in each container's filesystem the volume
	// should be mounted.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	ExtraVolumes []corev1.Volume `json:"extraVolumes,omitempty"`

	// ExtraVolumeMounts can optionally be used to override default Pod
	// volumeMounts defined by the operator, or specify additional mounts.
	// Typically, these are used to mount volumes defined through extraVolumes.
	ExtraVolumeMounts []corev1.VolumeMount `json:"extraVolumeMounts,omitempty"`

	// InitContainers can optionally be used to supply extra init containers
	// that will be run to completion one after another before any app containers are started.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// SidecarContainers can optionally be used to supply extra containers
	// that run alongside the main containers.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	SidecarContainers []corev1.Container `json:"sidecarContainers,omitempty"`

	// Affinity allows you to set rules that constrain the scheduling of
	// your vtorc pods. WARNING: These affinity rules will override all default affinities
	// that we set; in turn, we can't guarantee optimal scheduling of your pods if you
	// choose to set this field.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Annotations can optionally be used to attach custom annotations to Pods
	// created for this component. These will be attached to the underlying
	// Pods that the vtorc Deployment creates.
	Annotations map[string]string `json:"annotations,omitempty"`

	// ExtraLabels can optionally be used to attach custom labels to Pods
	// created for this component. These will be attached to the underlying
	// Pods that the vtorc Deployment creates.
	ExtraLabels map[string]string `json:"extraLabels,omitempty"`

	// Service can optionally be used to customize the vtorc Service.
	Service *ServiceOverrides `json:"service,omitempty"`

	// Tolerations allow you to schedule pods onto nodes with matching taints.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

VitessOrchestratorSpec specifies deployment parameters for vtorc.

func (*VitessOrchestratorSpec) DeepCopy

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

func (*VitessOrchestratorSpec) DeepCopyInto

func (in *VitessOrchestratorSpec) DeepCopyInto(out *VitessOrchestratorSpec)

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

type VitessOrchestratorStatus

type VitessOrchestratorStatus struct {
	// Available indicates whether the vtctld service has available endpoints.
	Available corev1.ConditionStatus `json:"available,omitempty"`
	// ServiceName is the name of the Service for this cluster's vtorc.
	ServiceName string `json:"serviceName,omitempty"`
}

VitessOrchestratorStatus is a summary of the status of the vtorc deployment.

func (*VitessOrchestratorStatus) DeepCopy

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

func (*VitessOrchestratorStatus) DeepCopyInto

func (in *VitessOrchestratorStatus) DeepCopyInto(out *VitessOrchestratorStatus)

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

type VitessReplicationSpec

type VitessReplicationSpec struct {
	// InitializeMaster specifies whether to choose an initial master for a
	// new or restored shard that has no master yet.
	//
	// Default: true.
	InitializeMaster *bool `json:"initializeMaster,omitempty"`

	// InitializeBackup specifies whether to take an initial placeholder backup
	// as part of preparing tablets to begin replication. This only takes effect
	// if a backup location is defined in the VitessCluster.
	//
	// Default: true.
	InitializeBackup *bool `json:"initializeBackup,omitempty"`

	// RecoverRestartedMaster specifies whether the operator attempts to repair
	// replication when the master MySQL restarts in-place (due to a crash) or
	// its Pod gets deleted and recreated, causing the Pod IP to change.
	//
	// Default: true.
	RecoverRestartedMaster *bool `json:"recoverRestartedMaster,omitempty"`
}

VitessReplicationSpec specifies how Vitess will set up MySQL replication.

func (*VitessReplicationSpec) DeepCopy

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

func (*VitessReplicationSpec) DeepCopyInto

func (in *VitessReplicationSpec) DeepCopyInto(out *VitessReplicationSpec)

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

type VitessShard

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

	Spec   VitessShardSpec   `json:"spec,omitempty"`
	Status VitessShardStatus `json:"status,omitempty"`
}

VitessShard represents a group of Vitess instances (tablets) that store a subset of the data in a logical database (keyspace).

The tablets belonging to one VitessShard can ultimately be deployed across various VitessCells. All the tablets in a given shard, across all cells, use MySQL replication to stay eventually consistent with the MySQL master for that shard. +kubebuilder:resource:path=vitessshards,shortName=vts +kubebuilder:subresource:status

func (*VitessShard) DeepCopy

func (in *VitessShard) DeepCopy() *VitessShard

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

func (*VitessShard) DeepCopyInto

func (in *VitessShard) DeepCopyInto(out *VitessShard)

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

func (*VitessShard) DeepCopyObject

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

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

type VitessShardCondition

type VitessShardCondition struct {
	// Status is the status of the condition.
	// Can be True, False, Unknown.
	// +kubebuilder:validation:Enum=True;False;Unknown
	Status corev1.ConditionStatus `json:"status"`
	// Last time the condition transitioned from one status to another.
	// Optional.
	LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
	// Unique, one-word, PascalCase reason for the condition's last transition.
	// Optional.
	Reason string `json:"reason,omitempty"`
	// Human-readable message indicating details about last transition.
	// Optional.
	Message string `json:"message,omitempty"`
}

VitessShardCondition contains details for the current condition of this VitessShard.

func NewVitessShardCondition

func NewVitessShardCondition() VitessShardCondition

NewVitessShardCondition returns an init VitessShardCondition object.

func (*VitessShardCondition) DeepCopy

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

func (*VitessShardCondition) DeepCopyInto

func (in *VitessShardCondition) DeepCopyInto(out *VitessShardCondition)

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

func (*VitessShardCondition) StatusDuration

func (c *VitessShardCondition) StatusDuration() time.Duration

StatusDuration returns the duration since LastTransitionTime. It represents how long we've been in the current status for this condition. If LastTransitionTime is nil, then we return zero to indicate that we have no confidence about the duration of the status.

type VitessShardConditionType

type VitessShardConditionType string

VitessShardConditionType is a valid value for the key of a VitessShardCondition map where the key is a VitessShardConditionType and the value is a VitessShardCondition.

type VitessShardList

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

VitessShardList contains a list of VitessShard

func (*VitessShardList) DeepCopy

func (in *VitessShardList) DeepCopy() *VitessShardList

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

func (*VitessShardList) DeepCopyInto

func (in *VitessShardList) DeepCopyInto(out *VitessShardList)

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

func (*VitessShardList) DeepCopyObject

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

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

type VitessShardSpec

type VitessShardSpec struct {
	// VitessShardTemplate contains the user-specified parts of VitessShardSpec.
	// These are the parts that are configurable inside VitessCluster.
	// The rest of the fields below are filled in by the parent controller.
	VitessShardTemplate `json:",inline"`

	// Name is the shard name as it's known to Vitess.
	Name string `json:"name"`

	// DatabaseName is the name to use for the underlying MySQL database.
	// It is inherited from the parent keyspace, so it can only be configured at
	// the keyspace level.
	DatabaseName string `json:"databaseName,omitempty"`

	// ZoneMap is a map from Vitess cell name to zone (failure domain) name
	// for all cells defined in the VitessCluster.
	ZoneMap map[string]string `json:"zoneMap"`

	// Images are not customizable by users at the shard level because version
	// skew across the shard is discouraged except during rolling updates,
	// in which case this field is automatically managed by the VitessKeyspace
	// controller that owns this VitessShard.
	Images VitessKeyspaceImages `json:"images"`

	// ImagePullPolicies are inherited from the VitessCluster spec.
	ImagePullPolicies VitessImagePullPolicies `json:"imagePullPolicies,omitempty"`

	// ImagePullSecrets are inherited from the VitessCluster spec.
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// KeyRange is the range of keyspace IDs served by this shard.
	KeyRange VitessKeyRange `json:"keyRange"`

	// GlobalLockserver are the params to connect to the global lockserver.
	GlobalLockserver VitessLockserverParams `json:"globalLockserver"`

	// VitessOrchestrator is inherited from the parent's VitessKeyspace.
	VitessOrchestrator *VitessOrchestratorSpec `json:"vitessOrchestrator,omitempty"`

	// BackupLocations are the backup locations defined in the VitessCluster.
	BackupLocations []VitessBackupLocation `json:"backupLocations,omitempty"`

	// BackupEngine specifies the Vitess backup engine to use, either "builtin" or "xtrabackup".
	BackupEngine VitessBackupEngine `json:"backupEngine,omitempty"`

	// ExtraVitessFlags is inherited from the parent's VitessClusterSpec.
	ExtraVitessFlags map[string]string `json:"extraVitessFlags,omitempty"`

	// TopologyReconciliation is inherited from the parent's VitessClusterSpec.
	TopologyReconciliation *TopoReconcileConfig `json:"topologyReconciliation,omitempty"`

	// UpdateStrategy is inherited from the parent's VitessClusterSpec.
	UpdateStrategy *VitessClusterUpdateStrategy `json:"updateStrategy,omitempty"`
}

VitessShardSpec defines the desired state of a VitessShard.

func (*VitessShardSpec) AllPoolsUsingMysqld

func (s *VitessShardSpec) AllPoolsUsingMysqld() bool

AllPoolsUsingMysqld returns a boolean indicating whether the VitessShard Spec is using local MySQL for all of it's pools by checking the Mysqld field of all tablet pools.

func (*VitessShardSpec) BackupLocation

func (s *VitessShardSpec) BackupLocation(name string) *VitessBackupLocation

BackupLocation looks up a backup location in the list by name. It returns nil if no location by that name exists.

func (*VitessShardSpec) BackupsEnabled

func (s *VitessShardSpec) BackupsEnabled() bool

BackupsEnabled returns whether at least one tablet pool in the shard has a backup location set.

func (*VitessShardSpec) CellInCluster

func (s *VitessShardSpec) CellInCluster(cellName string) bool

CellInCluster returns whether the given cell name is defined in the VitessCluster to which this shard ultimately belongs.

func (*VitessShardSpec) DeepCopy

func (in *VitessShardSpec) DeepCopy() *VitessShardSpec

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

func (*VitessShardSpec) DeepCopyInto

func (in *VitessShardSpec) DeepCopyInto(out *VitessShardSpec)

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

func (*VitessShardSpec) GetCells

func (s *VitessShardSpec) GetCells() sets.String

GetCells returns the set of all cells used by any tablet pools defined in this VitessShardSpec.

func (*VitessShardSpec) MasterEligibleTabletCount

func (s *VitessShardSpec) MasterEligibleTabletCount() int32

MasterEligibleTabletCount returns the total number of master-eligible tablets in the shard.

func (*VitessShardSpec) UsingExternalDatastore

func (s *VitessShardSpec) UsingExternalDatastore() bool

UsingExternalDatastore indicates whether the VitessShard Spec is using externally managed MySQL for any of its tablet pools.

type VitessShardStatus

type VitessShardStatus struct {
	// The generation observed by the controller.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Tablets is a summary of the status of all desired tablets in the shard.
	Tablets map[string]VitessTabletStatus `json:"tablets,omitempty"`
	// OrphanedTablets is a list of unwanted tablets that could not be turned down.
	OrphanedTablets map[string]OrphanStatus `json:"orphanedTablets,omitempty"`

	// Cells is a list of cells in which any tablets for this shard are deployed.
	Cells []string `json:"cells,omitempty"`

	// VitessOrchestrator is a summary of the status of the vtorc deployment.
	VitessOrchestrator VitessOrchestratorStatus `json:"vitessOrchestrator,omitempty"`

	// HasMaster is a condition indicating whether the Vitess topology
	// reflects a master for this shard.
	HasMaster corev1.ConditionStatus `json:"hasMaster,omitempty"`

	// HasInitialBackup is a condition indicating whether the initial backup
	// has been seeded for the shard.
	HasInitialBackup corev1.ConditionStatus `json:"hasInitialBackup,omitempty"`

	// ServingWrites is a condition indicating whether this shard is the one
	// that serves writes for its key range, according to Vitess topology.
	// A shard might be deployed without serving writes if, for example, it is
	// the target of a resharding operation that is still in progress.
	ServingWrites corev1.ConditionStatus `json:"servingWrites,omitempty"`

	// Idle is a condition indicating whether the shard can be turned down.
	// If Idle is True, the shard is not part of the active shard set
	// (partitioning) for any tablet type in any cell, so it should be safe
	// to turn down the shard.
	Idle corev1.ConditionStatus `json:"idle,omitempty"`

	// Conditions is a map of all VitessShard specific conditions we want to set and monitor.
	// It's ok for multiple controllers to add conditions here, and those conditions will be preserved.
	Conditions map[VitessShardConditionType]VitessShardCondition `json:"conditions,omitempty"`

	// MasterAlias is the tablet alias of the master according to the global
	// shard record. This could be empty either because there is no master,
	// or because the shard record could not be read. Check the HasMaster
	// condition whenever the distinction is important.
	MasterAlias string `json:"masterAlias,omitempty"`

	// BackupLocations reports information about the backups for this shard in
	// each backup location.
	BackupLocations []*ShardBackupLocationStatus `json:"backupLocations,omitempty"`

	// LowestPodGeneration is the oldest VitessShard object generation seen across
	// all child Pods. The tablet information in VitessShard status is guaranteed to be
	// at least as up-to-date as this VitessShard generation. Changes made in
	// subsequent generations that affect tablets may not be reflected in status yet.
	LowestPodGeneration int64 `json:"lowestPodGeneration,omitempty"`
}

VitessShardStatus defines the observed state of a VitessShard.

func NewVitessShardStatus

func NewVitessShardStatus() VitessShardStatus

NewVitessShardStatus creates a new status object with default values.

func (*VitessShardStatus) DeepCopy

func (in *VitessShardStatus) DeepCopy() *VitessShardStatus

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

func (*VitessShardStatus) DeepCopyConditions

DeepCopyConditions deep copies the conditions map for VitessShardStatus.

func (*VitessShardStatus) DeepCopyInto

func (in *VitessShardStatus) DeepCopyInto(out *VitessShardStatus)

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

func (*VitessShardStatus) SetConditionStatus

func (s *VitessShardStatus) SetConditionStatus(condType VitessShardConditionType, newStatus corev1.ConditionStatus, reason, message string)

SetConditionStatus first ensures we have allocated a conditions map, and also ensures we have allocated a ShardCondition for the VitessShardConditionType key supplied. It then moves onto setting the conditions status. For the condition's status, it always updates the reason and message every time. If the current status is the same as the supplied newStatus, then we do not update LastTransitionTime. However, if newStatus is different from current status, then we update the status and update the transition time.

func (*VitessShardStatus) TabletAliases

func (s *VitessShardStatus) TabletAliases() []string

TabletAliases returns a sorted list of desired tablet aliases for the shard.

type VitessShardTabletPool

type VitessShardTabletPool struct {
	// Cell is the name of the Vitess cell in which to deploy this pool.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=^[A-Za-z0-9]([_.A-Za-z0-9]*[A-Za-z0-9])?$
	Cell string `json:"cell"`

	// Type is the type of tablet contained in this tablet pool.
	//
	// The allowed types are:
	//
	//   * replica - master-eligible tablets that serve transactional (OLTP) workloads
	//   * rdonly - master-ineligible tablets (can never be promoted to master) that serve batch/analytical (OLAP) workloads
	//   * externalmaster - tablets pointed at an external, read-write MySQL endpoint
	//   * externalreplica - tablets pointed at an external, read-only MySQL endpoint that serve transactional (OLTP) workloads
	//   * externalrdonly - tablets pointed at an external, read-only MySQL endpoint that serve batch/analytical (OLAP) workloads
	// +kubebuilder:validation:Enum=replica;rdonly;externalmaster;externalreplica;externalrdonly
	Type VitessTabletPoolType `json:"type"`

	// Name is the pool's unique name within the (cell,type) pair.
	// This field is optional, and defaults to an empty.
	// Assigning different names to this field enables the existence of multiple pools with a specific tablet type in a given cell,
	// which can be beneficial for unmanaged tablets.
	// Hence, you must specify ExternalDatastore when assigning a name to this field.
	// +kubebuilder:default=""
	Name string `json:"name,omitempty"`

	// Replicas is the number of tablets to deploy in this pool.
	// This field is required, although it may be set to 0,
	// which will scale the pool down to 0 tablets.
	// +kubebuilder:validation:Minimum=0
	Replicas int32 `json:"replicas"`

	// DataVolumeClaimTemplate configures the PersistentVolumeClaims that will be created
	// for each tablet to store its database files.
	// This field is required for local MySQL, but should be omitted in the case of externally
	// managed MySQL.
	//
	// IMPORTANT: For a tablet pool in a Kubernetes cluster that spans multiple
	// zones, you should ensure that `volumeBindingMode: WaitForFirstConsumer`
	// is set on the StorageClass specified in the storageClassName field here.
	DataVolumeClaimTemplate *corev1.PersistentVolumeClaimSpec `json:"dataVolumeClaimTemplate,omitempty"`

	// BackupLocationName is the name of the backup location to use for this
	// tablet pool. It must match the name of one of the backup locations
	// defined in the VitessCluster.
	// Default: Use the backup location whose name is empty.
	BackupLocationName string `json:"backupLocationName,omitempty"`

	// Vttablet configures the vttablet server within each tablet.
	Vttablet VttabletSpec `json:"vttablet"`

	// Mysqld configures a local MySQL running inside each tablet Pod.
	// You must specify either Mysqld or ExternalDatastore, but not both.
	Mysqld *MysqldSpec `json:"mysqld,omitempty"`

	// MysqldExporter configures a MySQL exporter running inside each tablet Pod.
	MysqldExporter *MysqldExporterSpec `json:"mysqldExporter,omitempty"`

	// ExternalDatastore provides information for an externally managed MySQL.
	// You must specify either Mysqld or ExternalDatastore, but not both.
	ExternalDatastore *ExternalDatastore `json:"externalDatastore,omitempty"`

	// Affinity allows you to set rules that constrain the scheduling of
	// your vttablet pods. Affinity rules will affect all underlying
	// tablets in the specified tablet pool the same way. WARNING: These affinity rules
	// will override all default affinities that we set; in turn, we can't guarantee
	// optimal scheduling of your pods if you choose to set this field.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Annotations can optionally be used to attach custom annotations to Pods
	// created for this component.
	Annotations map[string]string `json:"annotations,omitempty"`

	// ExtraLabels can optionally be used to attach custom labels to Pods
	// created for this component.
	ExtraLabels map[string]string `json:"extraLabels,omitempty"`

	// ExtraEnv can optionally be used to override default environment variables
	// set by the operator, or pass additional environment variables.
	// These values are applied to both the vttablet and mysqld containers.
	ExtraEnv []corev1.EnvVar `json:"extraEnv,omitempty"`

	// ExtraVolumes can optionally be used to override default Pod volumes
	// defined by the operator, or provide additional volumes to the Pod.
	// Note that when adding a new volume, you should usually also add a
	// volumeMount to specify where in each container's filesystem the volume
	// should be mounted.
	// These volumes are available to be mounted by both vttablet and mysqld.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	ExtraVolumes []corev1.Volume `json:"extraVolumes,omitempty"`

	// ExtraVolumeMounts can optionally be used to override default Pod
	// volumeMounts defined by the operator, or specify additional mounts.
	// Typically, these are used to mount volumes defined through extraVolumes.
	// These values are applied to both the vttablet and mysqld containers.
	ExtraVolumeMounts []corev1.VolumeMount `json:"extraVolumeMounts,omitempty"`

	// InitContainers can optionally be used to supply extra init containers
	// that will be run to completion one after another before any app containers are started.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// SidecarContainers can optionally be used to supply extra containers
	// that run alongside the main containers.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	SidecarContainers []corev1.Container `json:"sidecarContainers,omitempty"`

	// Tolerations allow you to schedule pods onto nodes with matching taints.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// TopologySpreadConstraint can optionally be used to
	// specify how to spread vttablet pods among the given topology
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
}

VitessShardTabletPool defines a pool of tablets with a similar purpose.

func (*VitessShardTabletPool) DeepCopy

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

func (*VitessShardTabletPool) DeepCopyInto

func (in *VitessShardTabletPool) DeepCopyInto(out *VitessShardTabletPool)

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

func (*VitessShardTabletPool) IsMatch

func (t *VitessShardTabletPool) IsMatch(inputPool *VitessShardTabletPool) bool

IsMatch indicates whether a tablet pool matches another tablet pool's type, cell and name.

type VitessShardTemplate

type VitessShardTemplate struct {
	// TabletPools specify groups of tablets in a given cell with a certain
	// tablet type and a shared configuration template.
	//
	// There must be at most one pool in this list for each (cell,type,name) set.
	// Each shard must have at least one "replica" pool (in at least one cell)
	// in order to be able to serve.
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	// +listMapKey=cell
	// +listMapKey=name
	TabletPools []VitessShardTabletPool `json:"tabletPools,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	// DatabaseInitScriptSecret specifies the init_db.sql script file to use for this shard.
	// This SQL script file is executed immediately after bootstrapping an empty database
	// to set up initial tables and other MySQL-level entities needed by Vitess.
	DatabaseInitScriptSecret SecretSource `json:"databaseInitScriptSecret"`

	// Replication configures Vitess replication settings for the shard.
	Replication VitessReplicationSpec `json:"replication,omitempty"`

	// Annotations can optionally be used to attach custom annotations to the VitessShard object.
	Annotations map[string]string `json:"annotations,omitempty"`
}

VitessShardTemplate contains only the user-specified parts of a VitessShard object.

func (*VitessShardTemplate) DeepCopy

func (in *VitessShardTemplate) DeepCopy() *VitessShardTemplate

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

func (*VitessShardTemplate) DeepCopyInto

func (in *VitessShardTemplate) DeepCopyInto(out *VitessShardTemplate)

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

type VitessTabletPoolType

type VitessTabletPoolType string

VitessTabletPoolType represents the tablet types for which it makes sense to deploy a dedicated pool. Tablet types that indicate temporary or transient states are not valid pool types.

const (
	// ReplicaPoolType is hte VitessTabletPoolType for master-eligible tablets.
	ReplicaPoolType VitessTabletPoolType = "replica"
	// RdonlyPoolType is the VitessTabletPoolType for master-ineligible tablets.
	RdonlyPoolType VitessTabletPoolType = "rdonly"
	// ExternalMasterPoolType is the VitessTabletPoolType for connecting a master
	// tablet to externally managed MySQL.
	ExternalMasterPoolType VitessTabletPoolType = "externalmaster"
	// ExternalReplicaPoolType is the VitessTabletPoolType for connecting a replica
	// tablet to externally managed MySQL.
	ExternalReplicaPoolType VitessTabletPoolType = "externalreplica"
	// ExternalRdonlyPoolType is the VitessTabletPoolType for connecting a rdonly
	// tablet to externally managed MySQL.
	ExternalRdonlyPoolType VitessTabletPoolType = "externalrdonly"
)

func (*VitessTabletPoolType) InitTabletType

func (t *VitessTabletPoolType) InitTabletType() string

InitTabletType returns a string representing what the initial tablet type should be for a tablet in this type of pool.

type VitessTabletStatus

type VitessTabletStatus struct {
	// PoolType is the target tablet type for the tablet pool.
	PoolType string `json:"poolType,omitempty"`
	// Index is the tablet's index within its tablet pool.
	Index int32 `json:"index,omitempty"`
	// Running indicates whether the vttablet Pod is running.
	Running corev1.ConditionStatus `json:"running,omitempty"`
	// Ready indicates whether the vttablet Pod is passing health checks,
	// meaning it's ready to serve queries.
	Ready corev1.ConditionStatus `json:"ready,omitempty"`
	// Available indicates whether the vttablet Pod has been consistently Ready
	// for long enough to be considered stable.
	Available corev1.ConditionStatus `json:"available,omitempty"`
	// DataVolumeBound indicates whether the main PersistentVolumeClaim has been
	// matched up with a PersistentVolume and bound to it.
	DataVolumeBound corev1.ConditionStatus `json:"dataVolumeBound,omitempty"`
	// Type is the observed tablet type as reflected in topology.
	Type string `json:"type,omitempty"`
	// PendingChanges describes changes to the tablet Pod that will be applied
	// the next time a rolling update allows.
	PendingChanges string `json:"pendingChanges,omitempty"`
}

VitessTabletStatus is the status of one tablet in a shard.

func NewVitessTabletStatus

func NewVitessTabletStatus(poolType VitessTabletPoolType, index int32) VitessTabletStatus

NewVitessTabletStatus creates a new status object with default values.

func (*VitessTabletStatus) DeepCopy

func (in *VitessTabletStatus) DeepCopy() *VitessTabletStatus

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

func (*VitessTabletStatus) DeepCopyInto

func (in *VitessTabletStatus) DeepCopyInto(out *VitessTabletStatus)

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

func (*VitessTabletStatus) IsExternalMaster

func (t *VitessTabletStatus) IsExternalMaster() bool

IsExternalMaster indicates whether the tablet is in a pool of type "externalmaster".

func (*VitessTabletStatus) IsRunning

func (t *VitessTabletStatus) IsRunning() bool

IsRunning indicates whether the tablet is known to be Running.

type VtAdminSpec

type VtAdminSpec struct {
	// Rbac contains the rbac config file for vtadmin.
	// If it is omitted, then it is considered to disable rbac.
	Rbac *SecretSource `json:"rbac,omitempty"`

	// Cells is a list of cell names (as defined in the Cells list)
	// in which to deploy vtadmin.
	// Default: Deploy to all defined cells.
	Cells []string `json:"cells,omitempty"`

	// APIAddresses is a list of vtadmin api addresses
	// to be used by the vtadmin web for each cell
	// Either there should be only 1 element in the list
	// which is used by all the vtadmin-web deployments
	// or it should match the length of the Cells list
	APIAddresses []string `json:"apiAddresses"`

	// Replicas is the number of vtadmin instances to deploy in each cell.
	Replicas *int32 `json:"replicas,omitempty"`

	// WebResources determines the compute resources reserved for each vtadmin-web replica.
	WebResources corev1.ResourceRequirements `json:"webResources,omitempty"`

	// APIResources determines the compute resources reserved for each vtadmin-api replica.
	APIResources corev1.ResourceRequirements `json:"apiResources,omitempty"`

	// ReadOnly specifies whether the web UI should be read-only
	// or should it allow users to take actions
	//
	// Default: false.
	ReadOnly *bool `json:"readOnly,omitempty"`

	// ExtraFlags can optionally be used to override default flags set by the
	// operator, or pass additional flags to vtadmin-api. All entries must be
	// key-value string pairs of the form "flag": "value". The flag name should
	// not have any prefix (just "flag", not "-flag"). To set a boolean flag,
	// set the string value to either "true" or "false".
	ExtraFlags map[string]string `json:"extraFlags,omitempty"`

	// ExtraEnv can optionally be used to override default environment variables
	// set by the operator, or pass additional environment variables.
	ExtraEnv []corev1.EnvVar `json:"extraEnv,omitempty"`

	// ExtraVolumes can optionally be used to override default Pod volumes
	// defined by the operator, or provide additional volumes to the Pod.
	// Note that when adding a new volume, you should usually also add a
	// volumeMount to specify where in each container's filesystem the volume
	// should be mounted.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	ExtraVolumes []corev1.Volume `json:"extraVolumes,omitempty"`

	// ExtraVolumeMounts can optionally be used to override default Pod
	// volumeMounts defined by the operator, or specify additional mounts.
	// Typically, these are used to mount volumes defined through extraVolumes.
	ExtraVolumeMounts []corev1.VolumeMount `json:"extraVolumeMounts,omitempty"`

	// InitContainers can optionally be used to supply extra init containers
	// that will be run to completion one after another before any app containers are started.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// SidecarContainers can optionally be used to supply extra containers
	// that run alongside the main containers.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	SidecarContainers []corev1.Container `json:"sidecarContainers,omitempty"`

	// Affinity allows you to set rules that constrain the scheduling of
	// your vtadmin pods. WARNING: These affinity rules will override all default affinities
	// that we set; in turn, we can't guarantee optimal scheduling of your pods if you
	// choose to set this field.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Annotations can optionally be used to attach custom annotations to Pods
	// created for this component. These will be attached to the underlying
	// Pods that the vtadmin Deployment creates.
	Annotations map[string]string `json:"annotations,omitempty"`

	// ExtraLabels can optionally be used to attach custom labels to Pods
	// created for this component. These will be attached to the underlying
	// Pods that the vtadmin Deployment creates.
	ExtraLabels map[string]string `json:"extraLabels,omitempty"`

	// Service can optionally be used to customize the vtadmin Service.
	Service *ServiceOverrides `json:"service,omitempty"`

	// Tolerations allow you to schedule pods onto nodes with matching taints.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

VtAdminSpec specifies deployment parameters for vtadmin.

func (*VtAdminSpec) DeepCopy

func (in *VtAdminSpec) DeepCopy() *VtAdminSpec

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

func (*VtAdminSpec) DeepCopyInto

func (in *VtAdminSpec) DeepCopyInto(out *VtAdminSpec)

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

type VtadminStatus

type VtadminStatus struct {
	// Available indicates whether the vtadmin service has available endpoints.
	Available corev1.ConditionStatus `json:"available,omitempty"`
	// ServiceName is the name of the Service for this cluster's vtadmin.
	ServiceName string `json:"serviceName,omitempty"`
}

VtadminStatus is a summary of the status of the vtadmin deployment.

func (*VtadminStatus) DeepCopy

func (in *VtadminStatus) DeepCopy() *VtadminStatus

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

func (*VtadminStatus) DeepCopyInto

func (in *VtadminStatus) DeepCopyInto(out *VtadminStatus)

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

type VttabletSpec

type VttabletSpec struct {
	// Resources specify the compute resources to allocate for just the vttablet
	// process (the Vitess query server that sits in front of MySQL).
	// This field is required.
	Resources corev1.ResourceRequirements `json:"resources"`

	// ExtraFlags can optionally be used to override default flags set by the
	// operator, or pass additional flags to vttablet. All entries must be
	// key-value string pairs of the form "flag": "value". The flag name should
	// not have any prefix (just "flag", not "-flag"). To set a boolean flag,
	// set the string value to either "true" or "false".
	ExtraFlags map[string]string `json:"extraFlags,omitempty"`

	// Lifecycle can optionally be used to add container lifecycle hooks
	// to vttablet container
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Lifecycle corev1.Lifecycle `json:"lifecycle,omitempty"`

	// TerminationGracePeriodSeconds can optionally be used to customize
	// terminationGracePeriodSeconds of the vttablet pod.
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
}

VttabletSpec configures the vttablet server within a tablet.

func (*VttabletSpec) DeepCopy

func (in *VttabletSpec) DeepCopy() *VttabletSpec

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

func (*VttabletSpec) DeepCopyInto

func (in *VttabletSpec) DeepCopyInto(out *VttabletSpec)

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

type WorkflowState

type WorkflowState string

WorkflowState represents the current state for the given Workflow.

const (
	// WorkflowRunning indicates that the workflow is currently in the Running state. This state
	// indicates that vreplication is ongoing, but we have moved passed the copying phase.
	WorkflowRunning WorkflowState = "Running"
	// WorkflowCopying indicates that the workflow is currently in the Copying state.
	WorkflowCopying WorkflowState = "Copying"
	// WorkflowError indicates that the workflow is currently experiencing some kind of error.
	WorkflowError WorkflowState = "Error"
	// WorkflowUnknown indicates that we could not discover the state for the given workflow.
	WorkflowUnknown WorkflowState = "Unknown"
)

Jump to

Keyboard shortcuts

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