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
uuidSetUUIDSet is the server_uuid set of all candidate instances for the backup[string]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


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 positive odd numbers.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
primaryServiceTemplatePrimaryServiceTemplate is a Service template for primary.*ServiceTemplatefalse
replicaServiceTemplateReplicaServiceTemplate is a Service template for replica.*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 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. Setting this field to 0 disables the delay check in the probe.*intfalse
startupWaitSecondsStartupWaitSeconds 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.*stringfalse
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.[]metav1.Conditionfalse
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


OverwriteContainer defines the container spec used for overwriting.

nameName of the container to overwrite.OverwriteableContainerNametrue
resourcesResources is the container resource to be overwritten.*ResourceRequirementsApplyConfigurationfalse

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.PersistentVolumeClaimSpecApplyConfigurationtrue

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.PodSpecApplyConfigurationtrue
overwriteContainersOverwriteContainers overwrites the container definitions provided by default by the system.[]OverwriteContainerfalse

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*ServiceSpecApplyConfigurationfalse

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
backendTypeBackendType is an identifier for the object storage to be used.stringfalse
caCertPath to SSL CA certificate file used in addition to system default.stringfalse

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
cpuCPU is the amount of CPU requested for the Pod.*resource.Quantityfalse
maxCpuMaxCPU is the amount of maximum CPU for the Pod.*resource.Quantityfalse
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[]EnvFromSourceApplyConfigurationfalse
envList of environment variables to set in the container.\n\nYou can configure S3 bucket access parameters through environment variables. See[]EnvVarApplyConfigurationfalse
affinityIf specified, the pod's scheduling constraints.*AffinityApplyConfigurationfalse
volumesVolumes defines the list of volumes that can be mounted by containers in the Pod.[]VolumeApplyConfigurationfalse
volumeMountsVolumeMounts describes a list of volume mounts that are to be mounted in a container.[]VolumeMountApplyConfigurationfalse

Back to Custom Resources