Custom Resources

Sub Resources


BackupStatus represents the status of the last successful backup.

timeThe time of the backup. This is used to generate object keys of backup files in a bucket.metav1.Timetrue
elapsedElapsed is the time spent on the backup.metav1.Durationtrue
sourceIndexSourceIndex is the ordinal of the backup source instance.inttrue
sourceUUIDSourceUUID is the server_uuid of the backup source instance.stringtrue
binlogFilenameBinlogFilename is the binlog filename that the backup source instance was writing to at the backup.stringtrue
gtidSetGTIDSet is the GTID set of the full dump of database.stringtrue
dumpSizeDumpSize is the size in bytes of a full dump of database stored in an object storage bucket.int64true
binlogSizeBinlogSize is the size in bytes of a tarball of binlog files stored in an object storage bucket.int64true
workDirUsageWorkDirUsage is the max usage in bytes of the woking directory.int64true
warningsWarnings are list of warnings from the last backup, if any.[]stringtrue

Back to Custom Resources


MySQLCluster is the Schema for the mysqlclusters API


Back to Custom Resources


MySQLClusterCondition defines the condition of MySQLCluster.

typeType is the type of the condition.MySQLClusterConditionTypetrue
statusStatus is the status of the condition.corev1.ConditionStatustrue
reasonReason is a one-word CamelCase reason for the condition's last transition.stringfalse
messageMessage is a human-readable message indicating details about last transition.stringfalse
lastTransitionTimeLastTransitionTime is the last time the condition transits from one status to another.metav1.Timetrue

Back to Custom Resources


MySQLClusterList contains a list of MySQLCluster


Back to Custom Resources


MySQLClusterSpec defines the desired state of MySQLCluster

replicasReplicas is the number of instances. Available values are 1, 3, and 5.int32false
podTemplatePodTemplate is a Pod template for MySQL server container.PodTemplateSpectrue
volumeClaimTemplatesVolumeClaimTemplates is a list of PersistentVolumeClaim templates for MySQL server container. A claim named "mysql-data" must be included in the list.[]PersistentVolumeClaimtrue
serviceTemplateServiceTemplate is a Service template for both primary and replicas.*ServiceTemplatefalse
mysqlConfigMapNameMySQLConfigMapName is a ConfigMap name of MySQL config.*stringfalse
replicationSourceSecretNameReplicationSourceSecretName is a Secret name which contains replication source info. If this field is given, the MySQLCluster works as an intermediate primary.*stringfalse
collectorsCollectors is the list of collector flag names of mysqld_exporter. If this field is not empty, MOCO adds mysqld_exporter as a sidecar to collect and export mysqld metrics in Prometheus format.\n\nSee for flag names.\n\nExample: ["engine_innodb_status", "info_schema.innodb_metrics"][]stringfalse
serverIDBaseServerIDBase, if set, will become the base number of server-id of each MySQL instance of this cluster. For example, if this is 100, the server-ids will be 100, 101, 102, and so on. If the field is not given or zero, MOCO automatically sets a random positive integer.int32false
maxDelaySecondsMaxDelaySeconds, if set, configures the readiness probe of mysqld container. For a replica mysqld instance, if it is delayed to apply transactions over this threshold, the mysqld instance will be marked as non-ready. The default is 60 seconds.intfalse
startupDelaySecondsStartupWaitSeconds is the maximum duration to wait for mysqld container to start working. The default is 3600 seconds.int32false
logRotationScheduleLogRotationSchedule specifies the schedule to rotate MySQL logs. If not set, the default is to rotate logs every 5 minutes. See for the field format.stringfalse
backupPolicyNameThe name of BackupPolicy custom resource in the same namespace. If this is set, MOCO creates a CronJob to take backup of this MySQL cluster periodically.*stringtrue
restoreRestore is the specification to perform Point-in-Time-Recovery from existing cluster. If this field is not null, MOCO restores the data as specified and create a new cluster with the data. This field is not editable.*RestoreSpecfalse
disableSlowQueryLogContainerDisableSlowQueryLogContainer controls whether to add a sidecar container named "slow-log" to output slow logs as the containers output. If set to true, the sidecar container is not added. The default is false.boolfalse

Back to Custom Resources


MySQLClusterStatus defines the observed state of MySQLCluster

conditionsConditions is an array of conditions.[]MySQLClusterConditionfalse
currentPrimaryIndexCurrentPrimaryIndex is the index of the current primary Pod in StatefulSet. Initially, this is zero.inttrue
syncedReplicasSyncedReplicas is the number of synced instances including the primary.intfalse
errantReplicasErrantReplicas is the number of instances that have errant transactions.intfalse
errantReplicaListErrantReplicaList is the list of indices of errant replicas.[]intfalse
backupBackup is the status of the last successful backup.BackupStatustrue
restoredTimeRestoredTime is the time when the cluster data is restored.*metav1.Timefalse
clonedCloned indicates if the initial cloning from an external source has been completed.boolfalse
reconcileInfoReconcileInfo represents version information for reconciler.ReconcileInfotrue

Back to Custom Resources


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

nameName is the name of the object.stringfalse
labelsLabels is a map of string keys and[string]stringfalse
annotationsAnnotations is a map of string keys and[string]stringfalse

Back to Custom Resources


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

metadataStandard object's metadata.ObjectMetatrue
specSpec defines the desired characteristics of a volume requested by a pod author.corev1.PersistentVolumeClaimSpectrue

Back to Custom Resources


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

metadataStandard object's metadata. The name in this metadata is ignored.ObjectMetafalse
specSpecification of the desired behavior of the pod. The name of the MySQL server container in this spec must be mysqld.corev1.PodSpectrue

Back to Custom Resources


ReconcileInfo is the type to record the last reconciliation information.

generationGeneration is the metadata.generation value of the last reconciliation. See also
reconcileVersionReconcileVersion is the version of the operator reconciler.inttrue

Back to Custom Resources


RestoreSpec represents a set of parameters for Point-in-Time Recovery.

sourceNameSourceName is the name of the source MySQLCluster.stringtrue
sourceNamespaceSourceNamespace is the namespace of the source MySQLCluster.stringtrue
restorePointRestorePoint is the target date and time to restore data. The format is RFC3339. e.g. "2006-01-02T15:04:05Z"metav1.Timetrue
jobConfigSpecifies parameters for restore Pod.JobConfigtrue

Back to Custom Resources


ServiceTemplate defines the desired spec and annotations of Service

metadataStandard object's metadata. Only annotations and labels are valid.ObjectMetafalse
specSpec is the ServiceSpec*corev1.ServiceSpecfalse

Back to Custom Resources


BucketConfig is a set of parameter to access an object storage bucket.

bucketNameThe name of the bucketstringtrue
regionThe region of the bucket. This can also be set through AWS_REGION environment variable.stringfalse
endpointURLThe API endpoint URL. Set this for non-S3 object storages.stringfalse
usePathStyleAllows you to enable the client to use path-style addressing, i.e., https?://ENDPOINT/BUCKET/KEY. By default, a virtual-host addressing is used (https?://BUCKET.ENDPOINT/KEY).boolfalse

Back to Custom Resources


JobConfig is a set of parameters for backup and restore job Pods.

serviceAccountNameServiceAccountName specifies the ServiceAccount to run the Pod.stringtrue
bucketConfigSpecifies how to access an object storage bucket.BucketConfigtrue
workVolumeWorkVolume is the volume source for the working directory. Since the backup or restore task can use a lot of bytes in the working directory, You should always give a volume with enough capacity.\n\nThe recommended volume source is a generic ephemeral volume.
threadsThreads is the number of threads used for backup or restoration.intfalse
memoryMemory is the amount of memory requested for the Pod.*resource.Quantityfalse
maxMemoryMaxMemory is the amount of maximum memory for the Pod.*resource.Quantityfalse
envFromList of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence.\n\nYou can configure S3 bucket access parameters through environment variables. See[]corev1.EnvFromSourcefalse
envList of environment variables to set in the container.\n\nYou can configure S3 bucket access parameters through environment variables. See[]corev1.EnvVarfalse

Back to Custom Resources