Skip to main content

API Reference

This page is generated from the Go API types by crd-ref-docs. It lists every field; the topic guides show examples and explain behavior.

The API is still v1alpha1, so fields may change while the operator is under active development.

mysql.cnmsql.co/v1alpha1​

Package v1alpha1 contains API Schema definitions for the mysql v1alpha1 API group.

Resource Types​

AffinityConfiguration​

AffinityConfiguration contains the info we need to create the affinity rules for Pods.

Appears in:

FieldDescriptionDefaultValidation
enablePodAntiAffinity booleanActivates anti-affinity for the pods. The operator will define pods
anti-affinity unless this field is explicitly set to false
Optional: {}
topologyKey stringTopologyKey to use for anti-affinity configuration. See Kubernetes
documentation for more information on how this works
Optional: {}
nodeSelector object (keys:string, values:string)NodeSelector is map of key-value pairs used to define the nodes on which
the pods can run.
More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
Optional: {}
nodeAffinity NodeAffinityNodeAffinity describes node affinity scheduling rules for the pod.
More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
Optional: {}
tolerations Toleration arrayTolerations is a list of Tolerations that should be set for all the pods,
in order to allow them to run on tainted nodes.
More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
Optional: {}
podAntiAffinityType stringPodAntiAffinityType allows the user to decide whether pod anti-affinity
between cluster instances should be considered a strong requirement
("required") during scheduling or not ("preferred", default).
preferredEnum: [preferred required]
Optional: {}
additionalPodAntiAffinity PodAntiAffinityAdditionalPodAntiAffinity allows to specify pod anti-affinity terms to be
added to the ones generated by the operator if EnablePodAntiAffinity is
set to true (default) or to be used exclusively if set to false.
Optional: {}
additionalPodAffinity PodAffinityAdditionalPodAffinity allows to specify pod affinity terms to be passed to
all the cluster's pods.
Optional: {}

Backup​

Backup is a one-shot request to back up a Cluster with XtraBackup, a volume snapshot, or a logical dump. Deleting it leaves the backup files in place unless it carries the mysql.cnmsql.co/cleanup-backup-files finalizer.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringBackup
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec BackupSpecspec defines the desired state of BackupRequired: {}
status BackupStatusstatus defines the observed state of BackupOptional: {}

BackupConfiguration​

BackupConfiguration describes the continuous archiving target for the cluster.

Appears in:

FieldDescriptionDefaultValidation
objectStore S3ObjectStoreObjectStore is the S3-compatible destination for backups and binlog
archiving.
Optional: {}
retentionPolicy stringRetentionPolicy is a duration string (e.g. "30d", "8w") describing how
long to keep backups.
Pattern: ^[1-9][0-9]*[dwm]$
Optional: {}
reclaimPolicy BackupReclaimPolicyReclaimPolicy controls what happens to the cluster's entire object-store
archive (every base backup, the archived binlogs, and the archive index)
when the Cluster is deleted. With "Delete" the operator adds a cleanup
finalizer and wipes the archive on teardown; with "Retain" (the default)
the archive is kept so a deleted Cluster can still be recovered.
RetainEnum: [Retain Delete]
Optional: {}
target BackupTargetTarget instance to take backups from, defaults to a standby if available.prefer-standbyEnum: [primary prefer-standby]
Optional: {}
xtrabackupOptions string arrayXtrabackupOptions are extra flags passed to xtrabackup.Optional: {}
logicalOptions string arrayLogicalOptions are extra flags passed to the dump client (mysqldump /
mariadb-dump) for logical backups. A Backup's spec.logical.extraArgs
replaces them. The operator does not validate them: flags that change the
output format or GTID handling break restore.
Optional: {}
jobTemplate BackupJobTemplateJobTemplate is the default shaping applied to backup worker Jobs created for
this cluster: resources, scheduling (nodeSelector/tolerations/affinity/
priorityClassName), extra labels/annotations, and the finished-Job TTL. A
per-Backup spec.jobTemplate overrides it field by field. During recovery the
resources from this template are also applied to the restore Job.
Optional: {}
continuousArchiving ContinuousArchivingConfigurationContinuousArchiving configures continuous binary-log archiving to the
object store, the foundation for point-in-time recovery. Disabled by
default.
Optional: {}

BackupJobTemplate​

BackupJobTemplate is a curated subset of the pod configuration applied to the backup, restore and instance bootstrap worker Jobs. It deliberately does not expose a full PodTemplateSpec: the operator owns the bootstrap init container, the scratch/TLS volumes and mounts, the worker command and args, and the object-store credential env, and a free-form template would let those be broken. Every field is optional; a per-Backup template overrides the cluster-wide spec.backup.jobTemplate field by field.

Appears in:

FieldDescriptionDefaultValidation
ttl DurationTTL is how long the finished backup worker Job is kept before Kubernetes
garbage-collects it (its ttlSecondsAfterFinished). When unset on both the
Backup and the cluster, the operator keeps the Job for 24h. A zero duration
deletes the Job as soon as it finishes.
Optional: {}
activeDeadline DurationActiveDeadline bounds how long the backup worker Job may run (its
activeDeadlineSeconds). A worker still running past it is killed and the
Backup fails with reason DeadlineExceeded, so a stalled upload or source
stream surfaces as a failure instead of a Backup left running forever. When
unset on both the Backup and the cluster, the operator uses 24h. A zero
duration disables the deadline.
Optional: {}
resources ResourceRequirementsResources sets the resource requests and limits on the backup worker
container. Streaming xbstream can be memory-hungry, so operators often want
explicit limits. During recovery the cluster-level template's
requests/limits also apply to the restore Job. The other instance
bootstrap Jobs (initdb, join, import) always use spec.resources.
Optional: {}
nodeSelector object (keys:string, values:string)NodeSelector constrains the backup worker Job's pod to nodes with matching
labels, e.g. to keep backups off the critical nodes. Not applied to
instance bootstrap Jobs: they follow the instance's scheduling so the
data volume binds where the instance can run.
Optional: {}
tolerations Toleration arrayTolerations allow the backup worker Job's pod to schedule onto tainted
nodes. Added to the instance's tolerations on instance bootstrap Jobs.
Optional: {}
affinity AffinityAffinity sets the affinity/anti-affinity rules for the backup worker Job's
pod. Not applied to instance bootstrap Jobs: they follow the instance's
scheduling so the data volume binds where the instance can run.
Optional: {}
priorityClassName stringPriorityClassName sets the pod priority for the backup worker Job. Also
applies to instance bootstrap Jobs, over spec.priorityClassName.
Optional: {}
labels object (keys:string, values:string)Labels are merged onto the generated Job and its pod template. Operator
labels take precedence on conflict.
Optional: {}
annotations object (keys:string, values:string)Annotations are merged onto the generated Job and its pod template.Optional: {}

BackupList​

BackupList contains a list of Backup.

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringBackupList
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items Backup array

BackupMethod​

Underlying type: string

BackupMethod is the method used to take a backup.

Validation:

  • Enum: [xtrabackup volumeSnapshot logical]

Appears in:

FieldDescription
xtrabackupBackupMethodXtrabackup uses Percona XtraBackup to stream a physical backup
to the object store.
volumeSnapshotBackupMethodVolumeSnapshot uses CSI volume snapshots.
logicalBackupMethodLogical takes a SQL dump of the application schemas with the
engine's dump client (mysqldump / mariadb-dump). A logical backup is never a
base for recovery or point-in-time replay; load it into a new cluster
instead.

BackupPhase​

Underlying type: string

BackupPhase is the current phase of a Backup.

Appears in:

FieldDescription
pendingBackupPhasePending means the backup has not started yet.
runningBackupPhaseRunning means the backup is in progress.
completedBackupPhaseCompleted means the backup finished successfully.
failedBackupPhaseFailed means the backup failed.

BackupReclaimPolicy​

Underlying type: string

BackupReclaimPolicy describes what happens to an object-store archive when the Kubernetes object that owns it (a Backup or a Cluster) is deleted.

Validation:

  • Enum: [Retain Delete]

Appears in:

FieldDescription
RetainBackupReclaimRetain keeps object-store artifacts after the owning object is
deleted. This is the default: removing a Kubernetes object never destroys
the only copy of a recovery point unless the user opts in.
DeleteBackupReclaimDelete removes the object-store artifacts when the owning
object is deleted, via the cleanup finalizer.

BackupSpec​

BackupSpec defines the desired state of Backup.

Appears in:

FieldDescriptionDefaultValidation
cluster LocalObjectReferenceCluster references the cluster to back up.Required: {}
objectStore S3ObjectStoreObjectStore overrides the destination configured on the referenced
Cluster. When omitted, the Cluster's backup object store is used.
Optional: {}
method BackupMethodMethod is the backup method to use.xtrabackupEnum: [xtrabackup volumeSnapshot logical]
Optional: {}
target BackupTargetTarget instance to take the backup from.prefer-standbyEnum: [primary prefer-standby]
Optional: {}
online booleanOnline, when true, performs a non-blocking (hot) backup. Defaults to true.trueOptional: {}
reclaimPolicy BackupReclaimPolicyReclaimPolicy controls what happens to this backup's object-store archive
(the backup payload and its manifest) when the Backup object is deleted.
With "Delete" the operator adds the cleanup finalizer and removes the
archive on deletion; with "Retain" (the default) the archive is kept.
RetainEnum: [Retain Delete]
Optional: {}
jobTemplate BackupJobTemplateJobTemplate shapes the backup worker Job for this backup: resources,
scheduling (nodeSelector/tolerations/affinity/priorityClassName), extra
labels/annotations, and the finished-Job TTL. It overrides the cluster-wide
spec.backup.jobTemplate field by field.
Optional: {}
logical LogicalBackupOptionsLogical configures the dump when method is "logical".Optional: {}

BackupStatus​

BackupStatus defines the observed state of Backup.

Appears in:

FieldDescriptionDefaultValidation
phase BackupPhasePhase is the current phase of the backup.Optional: {}
instanceName stringInstanceName is the instance the backup was taken from.Optional: {}
method BackupMethodMethod is the method that was used.Enum: [xtrabackup volumeSnapshot logical]
Optional: {}
backupId stringBackupID is a unique identifier of the backup in the object store.Optional: {}
jobName stringJobName is the Kubernetes Job running this backup.Optional: {}
destinationPath stringDestinationPath is the full path of the backup in the object store.Optional: {}
objectStore S3ObjectStoreObjectStore records the destination the backup was uploaded to, resolved at
backup time from the Backup spec or the referenced Cluster. It is snapshotted
so the cleanup finalizer can still locate and remove the archive after the
referenced Cluster is gone.
Optional: {}
binlogObjectStore S3ObjectStoreBinlogObjectStore records the cluster's binary-log archive store when the
backup ran. Point-in-time recovery from this backup replays binlogs from
it. Unset on backups taken without continuous archiving or before this
field existed, in which case the archive is looked up in ObjectStore.
Optional: {}
sha256 stringSHA256 is the checksum of the uploaded backup artifact.Optional: {}
beginGTID stringBeginGTID/EndGTID record the GTID range covered by the backup. For a
physical backup EndGTID is its anchor, the GTID position of its
consistent point, which point-in-time recovery replays from. For a
logical backup both hold the dump's snapshot GTID (MariaDB only), for
reference.
Optional: {}
endGTID stringOptional: {}
beginBinlog stringBeginBinlog/EndBinlog record the binary log coordinates. For a logical
backup both hold the dump's snapshot position (file:position), for
reference.
Optional: {}
endBinlog stringOptional: {}
databases string arrayDatabases lists the schemas in a logical backup, which are the ones an
import can select.
Optional: {}
startedAt TimeStartedAt/StoppedAt record the backup timing.Optional: {}
stoppedAt TimeOptional: {}
error stringError holds the error message if the backup failed.Optional: {}
conditions Condition arrayConditions represent the latest observations of the backup state.Optional: {}

BackupTarget​

Underlying type: string

BackupTarget describes which instance a backup is taken from.

Validation:

  • Enum: [primary prefer-standby]

Appears in:

FieldDescription
primaryBackupTargetPrimary takes backups from the primary instance.
prefer-standbyBackupTargetPreferStandby prefers a standby instance, falling back to the
primary if no standby is available.

BootstrapConfiguration​

BootstrapConfiguration describes how the cluster is initialised.

Appears in:

FieldDescriptionDefaultValidation
initdb BootstrapInitDBInitDB bootstraps a fresh, empty cluster.Optional: {}
recovery BootstrapRecoveryRecovery bootstraps the cluster by restoring a physical backup.Optional: {}

BootstrapImport​

BootstrapImport selects the logical backup a new cluster loads. Exactly one of Backup and Source is set.

Appears in:

FieldDescriptionDefaultValidation
backup LocalObjectReferenceBackup references a completed logical Backup in this namespace.Optional: {}
source stringSource is the name of an entry in ExternalClusters whose objectStore
holds the dump. The entry's name is the S3 key prefix to find it under.
Mutually exclusive with Backup.
Optional: {}
backupID stringBackupID selects a dump under Source. When empty, the latest completed
dump is used. Only valid with Source.
Optional: {}
databases string arrayDatabases loads only these schemas from the dump. Empty loads every
schema in it. Each one must be in the dump.
MaxItems: 256
items:MaxLength: 64
items:MinLength: 1
Optional: {}
postImportSQL string arrayPostImportSQL is a list of SQL statements run as root after the dump is
loaded.
Optional: {}

BootstrapInitDB​

BootstrapInitDB configures a fresh cluster initialisation.

Appears in:

FieldDescriptionDefaultValidation
database stringDatabase is the name of the application database to create.Optional: {}
owner stringOwner is the name of the application user that owns the database.Optional: {}
secret LocalObjectReferenceSecret references the credentials for the application user. If empty, a
secret is generated.
Optional: {}
postInitSQL string arrayPostInitSQL is a list of SQL statements run as root after the database is
created.
Optional: {}
characterSet stringEncoding/charset of the application database.Optional: {}
collation stringCollation of the application database.Optional: {}
import BootstrapImportImport loads a logical backup (a SQL dump) into the new cluster after it
is initialised. The dump must come from the same flavor, and it can come
from any supported server series. Replicas then clone the loaded primary.
Optional: {}

BootstrapRecovery​

BootstrapRecovery configures bootstrapping from a physical backup.

Appears in:

FieldDescriptionDefaultValidation
backup LocalObjectReferenceBackup references a Backup object to recover from.Optional: {}
source stringSource is the name of an entry in ExternalClusters to recover from.
Mutually exclusive with Backup. The entry's objectStore holds the
backups and its name is the S3 key prefix to discover them under.
Optional: {}
backupID stringBackupID narrows recovery to a specific base backup within the object
store. Only meaningful when Source is set; when empty, the latest
completed backup is selected. Ignored when Backup is set.
Optional: {}
recoveryTarget RecoveryTargetRecoveryTarget describes the point-in-time recovery target. When omitted,
recovery proceeds to the latest available point.
Optional: {}

CatalogImage​

CatalogImage maps a MySQL series to a container image. The series, not the integer major, is the upgrade unit: MySQL 8.0 and 8.4 are distinct upgrade targets that both live under integer major 8, so a catalog keyed by integer major could not express the 8.0 -> 8.4 hop.

Appears in:

FieldDescriptionDefaultValidation
series stringSeries is the MySQL release series in "major.minor" form (e.g. "8.0",
"8.4", "9.7"). It must match the image's server version line.
Pattern: ^[0-9]+\.[0-9]+$
Required: {}
image stringImage is the fully qualified Percona Server for MySQL image reference.Required: {}

CertificatesConfiguration​

CertificatesConfiguration contains the needed configurations to handle server and client certificates for TLS and mTLS communication.

Appears in:

FieldDescriptionDefaultValidation
serverCASecret stringThe secret containing the Server CA certificate. If not defined, a new
secret will be created with a self-signed CA and will be used to generate
the TLS certificate ServerTLSSecret.
Optional: {}
serverTLSSecret stringThe secret of type kubernetes.io/tls containing the server TLS certificate
and key that will be set as ssl-cert and ssl-key. Should be signed by the
CA in ServerCASecret. Its common name must not be cnmsql-operator.
Optional: {}
replicationTLSSecret stringThe secret of type kubernetes.io/tls containing the client certificate to
authenticate as the replication user. Should be signed by the CA in
ClientCASecret. It is the operator's client certificate for the instance
control API, so its common name must be cnmsql-operator.
Optional: {}
clientCASecret stringThe secret containing the Client CA certificate. If not defined, a new
secret will be created with a self-signed CA and will be used to generate
all the client certificates.
Optional: {}
serverAltDNSNames string arrayThe list of additional Subject Alternative Names (SANs) to be added to the
server certificate generated by the operator.
Optional: {}

CertificatesStatus​

CertificatesStatus contains configuration certificates and related expiration dates.

Appears in:

FieldDescriptionDefaultValidation
serverCASecret stringThe secret containing the Server CA certificate. If not defined, a new
secret will be created with a self-signed CA and will be used to generate
the TLS certificate ServerTLSSecret.
Optional: {}
serverTLSSecret stringThe secret of type kubernetes.io/tls containing the server TLS certificate
and key that will be set as ssl-cert and ssl-key. Should be signed by the
CA in ServerCASecret. Its common name must not be cnmsql-operator.
Optional: {}
replicationTLSSecret stringThe secret of type kubernetes.io/tls containing the client certificate to
authenticate as the replication user. Should be signed by the CA in
ClientCASecret. It is the operator's client certificate for the instance
control API, so its common name must be cnmsql-operator.
Optional: {}
clientCASecret stringThe secret containing the Client CA certificate. If not defined, a new
secret will be created with a self-signed CA and will be used to generate
all the client certificates.
Optional: {}
serverAltDNSNames string arrayThe list of additional Subject Alternative Names (SANs) to be added to the
server certificate generated by the operator.
Optional: {}
expirations object (keys:string, values:string)Expiration dates for all certificates.Optional: {}

Cluster​

Cluster describes a MySQL or MariaDB deployment: its topology, image, storage, bootstrap method, backups, and operational policy.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringCluster
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec ClusterSpecspec defines the desired state of ClusterRequired: {}
status ClusterStatusstatus defines the observed state of ClusterOptional: {}

ClusterImageCatalog​

ClusterImageCatalog maps each server series to an instance image, like ImageCatalog, but is cluster-scoped so Clusters in any namespace can use it.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringClusterImageCatalog
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec ImageCatalogSpecspec defines the desired state of ClusterImageCatalogRequired: {}

ClusterImageCatalogList​

ClusterImageCatalogList contains a list of ClusterImageCatalog.

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringClusterImageCatalogList
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items ClusterImageCatalog array

ClusterList​

ClusterList contains a list of Cluster.

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringClusterList
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items Cluster array

ClusterMonitoringTLSConfig​

ClusterMonitoringTLSConfig configures TLS for cluster metrics scraping.

Appears in:

FieldDescriptionDefaultValidation
enabled booleanEnabled serves metrics over TLS when true.falseOptional: {}

ClusterSpec​

ClusterSpec defines the desired state of Cluster.

Appears in:

FieldDescriptionDefaultValidation
description stringDescription of this MySQL cluster.Optional: {}
flavor FlavorFlavor selects the database engine flavor (mysql or mariadb).
Immutable after creation. Defaults to mysql.
mysqlEnum: [mysql mariadb]
Optional: {}
inheritedMetadata EmbeddedObjectMetadataMetadata that will be inherited by all objects related to the Cluster.Optional: {}
imageName stringImageName is the name of the Percona Server for MySQL container image to
use. Mutually exclusive with ImageCatalogRef.
Optional: {}
imageCatalogRef ImageCatalogRefImageCatalogRef resolves the image from an ImageCatalog or
ClusterImageCatalog based on the MySQL series. Mutually exclusive
with ImageName.
Optional: {}
imagePullPolicy PullPolicyImagePullPolicy is the policy used to pull the container image.Enum: [Always Never IfNotPresent]
Optional: {}
imagePullSecrets LocalObjectReference arrayImagePullSecrets is the list of pull secrets used to pull the image.Optional: {}
instances integerInstances is the number of MySQL instances (one primary + replicas).1Minimum: 1
Optional: {}
minSyncReplicas integerMinSyncReplicas is the minimum number of semi-synchronous replicas that
must acknowledge a transaction before it is committed on the primary.
MariaDB always waits for exactly one acknowledgement, so on that flavor
values above 1 have no effect.
Minimum: 0
Optional: {}
maxSyncReplicas integerMaxSyncReplicas is the maximum number of semi-synchronous replicas the
primary will wait for. Must be lower than the number of instances. On
MariaDB, values above 1 have no effect.
Minimum: 0
Optional: {}
mysql MySQLConfigurationMySQL holds the engine configuration (my.cnf parameters, replication
options).
Optional: {}
replication ReplicationConfigurationReplication selects and tunes the replication topology (asynchronous /
semi-synchronous GTID replication, or quorum-based Group Replication). The
mode is immutable after creation; when omitted the cluster is async.
Optional: {}
storage StorageConfigurationStorage configuration for the instance data directory.Required: {}
binlogStorage StorageConfigurationBinlogStorage, when set, places the binary logs on a separate volume from
the data directory.
Optional: {}
bootstrap BootstrapConfigurationBootstrap describes how the cluster is initialised (fresh init or recovery
from a backup).
Optional: {}
rootPasswordSecret LocalObjectReferenceRootPasswordSecret references a secret containing the password for the
MySQL root user. If not provided, a secret is generated.
Optional: {}
enableSuperuserAccess booleanEnableSuperuserAccess, when true, makes the root user reachable through the
generated/provided secret. Defaults to false.
falseOptional: {}
certificates CertificatesConfigurationCertificates configures the TLS/mTLS material used by the cluster.Optional: {}
resources ResourceRequirementsResources describes the compute resource requirements of the instance
pods.
Optional: {}
affinity AffinityConfigurationAffinity/anti-affinity rules for the instance pods.Optional: {}
topologySpreadConstraints TopologySpreadConstraint arrayTopologySpreadConstraints describes how the instance pods should be spread
across topology domains.
Optional: {}
priorityClassName stringPriorityClassName for the instance pods.Optional: {}
schedulerName stringSchedulerName to use for the instance pods.Optional: {}
primaryUpdateStrategy PrimaryUpdateStrategyPrimaryUpdateStrategy controls whether the operator performs the primary
update automatically (unsupervised) or waits for the user (supervised).
unsupervisedEnum: [unsupervised supervised]
Optional: {}
primaryUpdateMethod PrimaryUpdateMethodPrimaryUpdateMethod controls how the primary is updated: by switchover
(promoting a replica first) or by in-place restart.
switchoverEnum: [switchover restart]
Optional: {}
inPlaceInstanceManagerUpdates booleanInPlaceInstanceManagerUpdates, when true, rolls an operator upgrade out to
this cluster's instances by streaming the new instance-manager binary to each
Pod, which re-execs in place — no Pod restart and no switchover. When false
(the default) the operator instead deletes and recreates each Pod one at a
time (replicas first, primary last via switchover).
Optional: {}
upgrade UpgradeConfigurationUpgrade tunes MySQL server major-version upgrades.Optional: {}
maxStartDelay integerMaxStartDelay is the time in seconds allowed for an instance to start.3600Optional: {}
maxStopDelay integerMaxStopDelay is the time in seconds allowed for an instance to gracefully
shut down.
1800Optional: {}
smartShutdownTimeout integerSmartShutdownTimeout is the time in seconds reserved for a "smart"
(graceful) shutdown attempt before falling back to a "fast" shutdown.
Must be lower than maxStopDelay; the remaining time is used for the
fast/immediate fallback. Defaults to 180.
Minimum: 0
Optional: {}
maxSwitchoverDelay integerMaxSwitchoverDelay is the time in seconds allowed for a switchover to
complete before being considered failed.
3600Optional: {}
failoverDelay integerFailoverDelay is the amount of time in seconds the operator waits before
declaring an unreachable primary failed and triggering a failover.
0Optional: {}
enableFailover booleanEnableFailover, when true (default), lets the operator promote a replica
when the primary becomes unreachable. Set it to false to pin the primary
role to whichever instance currently holds it: the operator promotes
nothing, the failed primary's Pod is still recreated so it can recover in
place, and the cluster reports Blocked until the primary is back or a
manual switchover moves the role. Planned handoffs are unaffected — manual
switchover and enableSwitchoverOnDrain keep working. Group Replication
clusters ignore this switch: the group elects its own primary.
trueOptional: {}
enablePrimaryLease booleanEnablePrimaryLease, when true (default), makes the acting primary hold a
per-cluster Lease before accepting writes.
trueOptional: {}
failoverPolicy FailoverPolicyFailoverPolicy bounds and steers automatic primary election. When it is
unset, the operator promotes the most advanced reachable replica and puts
no limit on how far behind that replica may be.
Optional: {}
backup BackupConfigurationBackup configures continuous archiving and the object store target.Optional: {}
replica ReplicaClusterConfigurationReplica turns this cluster into a replica cluster that follows a source
defined in ExternalClusters.
Optional: {}
externalClusters ExternalCluster arrayExternalClusters is the list of external clusters that can be used as a
replication source or a recovery origin.
Optional: {}
managed ManagedConfigurationManaged describes the resources (roles, services) managed declaratively by
the operator.
Optional: {}
monitoring MonitoringConfigurationMonitoring configuration.Optional: {}
nodeMaintenanceWindow NodeMaintenanceWindowNodeMaintenanceWindow defines if the cluster is tolerant to node failures
during maintenance (e.g. PVC may be reused).
Optional: {}
enablePDB booleanEnablePDB, when true (default), makes the operator create a
PodDisruptionBudget for the cluster.
trueOptional: {}
enableSwitchoverOnDrain booleanEnableSwitchoverOnDrain, when true (default), makes the operator promote a
healthy replica via a planned switchover when the primary Pod is gracefully
terminated (e.g. a node drain or eviction), instead of waiting for the
primary to become unreachable and failing over. Falls back to failover when
no safe candidate exists or the handoff cannot complete in time.
trueOptional: {}
serviceAccountTemplate ServiceAccountTemplateServiceAccountTemplate to use for the generated service account.Optional: {}
env EnvVar arrayEnv is a list of additional environment variables added to the instance
containers.
Optional: {}
envFrom EnvFromSource arrayEnvFrom is a list of sources to populate environment variables in the
instance containers.
Optional: {}
podSecurityContext PodSecurityContextPodSecurityContext applied to the instance pods.Optional: {}
securityContext SecurityContextSecurityContext applied to the instance containers.Optional: {}
logLevel stringLogLevel sets the operator-side log level for this cluster.infoEnum: [error warning info debug trace]
Optional: {}

ClusterStatus​

ClusterStatus defines the observed state of Cluster.

Appears in:

FieldDescriptionDefaultValidation
flavor FlavorFlavor echoes the resolved engine flavor (spec.flavor, default mysql).Enum: [mysql mariadb]
Optional: {}
instances integerInstances is the total number of instances reported.Optional: {}
readyInstances integerReadyInstances is the number of ready instances.Optional: {}
labelSelector stringLabelSelector is the serialized label selector that identifies the
instance Pods managed by this Cluster. It is populated by the operator
and exposed through the scale sub-resource (selectorpath) so that
autoscalers such as the Vertical Pod Autoscaler can discover the managed
Pods to resize.
Optional: {}
instanceNames string arrayInstanceNames is the list of instance (pod) names.Optional: {}
currentPrimary stringCurrentPrimary is the name of the instance currently acting as primary.Optional: {}
targetPrimary stringTargetPrimary is the name of the instance that should become primary (used
during switchover/failover).
Optional: {}
currentPrimaryTimestamp TimeCurrentPrimaryTimestamp is when the current primary was elected.Optional: {}
currentPrimaryGeneration integerCurrentPrimaryGeneration counts the changes of currentPrimary: the
instance that records itself as currentPrimary raises it by one in the
same update (the operator does under Group Replication). It fences the
binlog archive: a primary stamps its generation into the archive index,
and a writer with a lower generation, a demoted primary still finishing a
pass, never judges the archive's segments.
Optional: {}
targetPrimaryTimestamp TimeTargetPrimaryTimestamp is when the current switchover request to
TargetPrimary was started. It bounds the switchover by spec.maxSwitchoverDelay.
Optional: {}
divergedInstances string arrayDivergedInstances are replicas whose executed GTID set is not contained in
the primary's (errant transactions). They cannot safely rejoin; their
in-Pod reconciler reads this list and refuses to self-configure as a
replica, leaving them read-only for an operator to resolve.
Optional: {}
fencedInstances string arrayFencedInstances are instances the operator has fenced because their Pod
carries the fencing annotation. A fenced instance is pulled out of the
routing Services, kept read-only by its in-Pod reconciler (so it stops
archiving and refuses writes), and is excluded as a failover candidate.
Clearing the annotation removes it from this list and restores it.
Optional: {}
failedInstances string arrayFailedInstances are instances whose Pod shows positive evidence of being
unable to run: a Failed Pod phase, or a container stuck in CrashLoopBackOff
after repeated restarts. Unlike a not-yet-ready instance (which is expected
during initial provisioning), a failed instance is a degradation regardless
of whether the cluster ever finished provisioning, so it is surfaced
independently of the phase. It is the cluster's "unhealthy" bucket.
Optional: {}
replicationBrokenInstances string arrayReplicationBrokenInstances are reachable replicas whose replication has
aborted with a recorded error — a stopped IO or SQL thread, e.g. a
duplicate-key conflict that halts replication. Unlike a diverged instance
(detected by comparing GTID sets and listed in DivergedInstances), this is
derived from the SQL-layer replication error the in-Pod reconciler reports,
so a replica that is Running but cannot replicate is surfaced as a
degradation rather than being mistaken for one still finishing provisioning.
Optional: {}
resizingPVC string arrayResizingPVC lists the PVCs whose storage is currently being expanded — the
volume-level resize or the node-side filesystem grow has not yet completed.
For a backend that cannot expand a volume in use (storage.resizeInUseVolumes
false) a name lingers here until the operator recycles the owning Pod and the
fresh mount finishes the resize.
Optional: {}
primaryFailingSince TimePrimaryFailingSince records when the current primary first became
unreachable. It is used to enforce spec.failoverDelay before an automatic
failover, and is cleared once the primary is healthy again.
Optional: {}
primaryHealthySince TimePrimaryHealthySince records when the current primary began the unbroken
stretch of health it is now in: it is stamped the first time the primary is
observed healthy and re-stamped whenever it recovers from a failing stretch,
so it moves forward every time the primary drops out. It is what
spec.failoverPolicy.primaryStabilityWindow is measured from. Never earlier
than CurrentPrimaryTimestamp, since a primary's health cannot predate its
election.
Optional: {}
lastFailoverTimestamp TimeLastFailoverTimestamp records when the operator last promoted a replica in an
automatic failover. It is what spec.failoverPolicy.minTimeBetweenFailovers is
measured from. A switchover, planned or requested, does not set it: the
cooldown exists to damp the operator reacting to failures, not to delay a
promotion somebody asked for.
Optional: {}
latestGeneratedNode integerLatestGeneratedNode is the serial of the latest generated instance.Optional: {}
establishedAt TimeEstablishedAt records the first time the cluster reached full readiness
(every instance ready together), marking that it completed initial
provisioning at least once. It is sticky: once set it is never cleared, so a
later degradation cannot reset it. Its presence is what distinguishes a
cluster that is still being provisioned (a drop below readiness is expected)
from an established one (a drop below readiness is a degradation). It is
deliberately independent of Phase, which intermediate reconcile steps
re-stamp and which therefore cannot carry this fact reliably.
Optional: {}
phase stringPhase is a high-level human-readable cluster phase.Optional: {}
phaseReason stringPhaseReason gives more detail about the current phase.Optional: {}
image stringImage is the resolved image currently in use.Optional: {}
targetImage ImageInfoTargetImage is what the operator learned about the image it rolls the
instances to, by running it in a probe Pod: the server version and flavor
the image's server binary reports, and the digest the kubelet pulled. A
new image is probed and validated before any instance moves to it; until
then the cluster stays on this one (see the ImageReady condition).
Optional: {}
gtidExecutedByInstance object (keys:string, values:string)GTIDExecutedByInstance maps an instance name to its gtid_executed set.Optional: {}
mariadbTimeline MariaDBEpoch arrayMariaDBTimeline (MariaDB) records each change of primary, oldest first.
Entry i says that, in every replication domain, the transactions after
its handoff up to the next entry's handoff were authored by its server
id. A MariaDB GTID position names only the author of its last
transaction; this history is what tells a forked former primary from a
lagging one. The oldest entries are dropped once no instance position or
archive segment needs them. Not recorded on replica clusters.
MaxItems: 256
Optional: {}
gtidExecutedUpdatedAt TimeGTIDExecutedUpdatedAt records when GTIDExecutedByInstance was last
refreshed. Because gtid_executed advances on every write, the operator
throttles how often it persists the map; this timestamp marks the last
persisted snapshot.
Optional: {}
replicationLagByInstance object (keys:string, values:integer)ReplicationLagByInstance maps an instance name to its replication lag in
milliseconds, as measured by the heartbeat (see
spec.replication.heartbeat). Instances that reported no reading are absent
rather than zero, since zero would say "in sync", which is the opposite of
what an unreadable heartbeat means.
It is here to be looked at. The failover bound does not read it: it asks the
surviving replicas for their readings at the moment it elects, which is both
fresher than this snapshot and, unlike the departing primary's GTID
position, still answerable. Expect these values to climb while a primary is
down, because nothing is stamping the heartbeat any more.
Optional: {}
replicationLagUpdatedAt TimeReplicationLagUpdatedAt records when ReplicationLagByInstance was last
refreshed. Lag moves constantly, so the operator throttles how often it
persists the map; this timestamp says how old the readings are, and is the
only way to tell a replica that is genuinely one second behind from one
whose last reading merely happened to say so.
Optional: {}
executableHashByInstance object (keys:string, values:string)ExecutableHashByInstance maps an instance name to the SHA-256 hash of its
running instance manager binary, as reported by the in-Pod control API.
The operator uses it to detect stale instance managers when upgrading.
Optional: {}
operatorExecutableHash stringOperatorExecutableHash is the SHA-256 hash of the running operator binary.
It is the target hash every instance manager should match after an upgrade.
Optional: {}
certificates CertificatesStatusCertificates reports the status of the managed certificates.Optional: {}
continuousArchiving ContinuousArchivingStatusContinuousArchiving reports the health of continuous binlog archiving when
it is enabled.
Optional: {}
lastRetentionRunTime TimeLastRetentionRunTime is when the operator last ran a backup-retention GC
pass against the object store. It throttles the periodic pass.
Optional: {}
dumpAccountSecretVersion stringDumpAccountSecretVersion is the resourceVersion of the <cluster>-dump
Secret last applied to the cnmsql_dump account on the primary. The
operator re-applies the account when the Secret changes. Written only by
the operator.
Optional: {}
dumpAccountServerVersion stringDumpAccountServerVersion is the server version of the primary the
cnmsql_dump account was last applied on. Its grants depend on the
version, so the operator re-applies the account when the primary's
version changes, after an in-place upgrade. Written only by the operator.
Optional: {}
observedGeneration integerObservedGeneration is the generation observed by the controller.Optional: {}
conditions Condition arrayConditions represent the latest available observations of the cluster's
state.
Optional: {}
managedRolesStatus ManagedRolesStatusManagedRolesStatus reports the reconciliation state of the declarative
managed roles.
Optional: {}
groupReplication GroupReplicationStatusGroupReplication reflects the live group membership and quorum, mirrored
from performance_schema.replication_group_members. Nil for async clusters.
The operator is the sole writer of this block.
Optional: {}

ConfigMapKeySelector​

ConfigMapKeySelector selects a key from a ConfigMap in the same namespace.

Appears in:

FieldDescriptionDefaultValidation
name stringName of the ConfigMapRequired: {}
key stringKey within the ConfigMap to selectRequired: {}

ContinuousArchivingConfiguration​

ContinuousArchivingConfiguration configures continuous binary-log (binlog) archiving: the current primary's instance manager ships rotated binlog files to the object store so the cluster keeps a gapless, GTID-addressable change history.

Appears in:

FieldDescriptionDefaultValidation
enabled booleanEnabled turns continuous binlog archiving on. Requires Backup.ObjectStore.falseOptional: {}
targetRPOSeconds integerTargetRPOSeconds bounds the recovery point objective: the primary forces a
binary-log rotation at least this often so a low-write cluster still
archives promptly. Defaults to 300 (5 minutes).
300Minimum: 10
Optional: {}
maxBinlogSizeMB integerMaxBinlogSizeMB caps the active binary log before mysqld rotates it,
bounding the size-based RPO and per-object size. Defaults to 16 MiB.
16Minimum: 1
Optional: {}
binlogExpireSeconds integerBinlogExpireSeconds is how long mysqld keeps a binary log on the instance's
data volume before expiring it. With the active purge gate off (the
default) this is the only mechanism that reclaims binlog space, so it also
sets the window in which a lagged or returning replica can still catch up
from the primary's logs. Budget disk for it: the data volume must hold this
many seconds of binlog writes on top of the dataset. 0 selects the default.
Defaults to 604800 (7 days).
604800Minimum: 0
Optional: {}
purgeAfterArchive booleanPurgeAfterArchive turns on the active purge gate: the primary runs PURGE
BINARY LOGS on a binary log once it is safely in the object store and
every other instance of the cluster has applied the transactions it holds,
reclaiming binlog space without waiting for binlogExpireSeconds.
The replicas' positions come from status.gtidExecutedByInstance, which the
operator refreshes at least every five minutes, so purging trails writes by
about that much. An instance whose position is unknown (still joining, for
example) holds every file; a fenced instance holds the files it has not
applied; a diverged instance, which must be re-cloned anyway, holds none.
When the same file stays held for a while the BinlogPurgeHeld condition
names the instances holding it. binlogExpireSeconds still applies on its
own, so a replica down for longer than that must be re-cloned.
Defaults to false.
falseOptional: {}
objectStore S3ObjectStoreObjectStore is where the binary-log archive is written. When unset, the
archive goes to spec.backup.objectStore next to the base backups. The
archive keeps the same layout in either store: <path>/<cluster>/binlogs/.
Changing it starts a new archive in the new store from the oldest binary
log still on the primary; take a new base backup afterwards.
Optional: {}

ContinuousArchivingStatus​

ContinuousArchivingStatus reports the health and frontier of continuous binary-log archiving.

Appears in:

FieldDescriptionDefaultValidation
enabled booleanEnabled mirrors whether continuous archiving is configured on.Optional: {}
destination stringDestination is the archive location in use, <endpoint>/<bucket>/<path>
(endpoint empty for AWS). A change is reported with an ArchiveMoved
Warning event.
Optional: {}
lastArchivedBinlog stringLastArchivedBinlog is the most recent binary-log file shipped by the
current primary.
Optional: {}
lastArchivedGTID stringLastArchivedGTID is the last GTID covered by the archive.Optional: {}
lastArchivedTime TimeLastArchivedTime is when the most recent file finished archiving.Optional: {}
pendingFiles integerPendingFiles is the number of rotated binary logs not yet archived
(archive lag). A growing value means the archiver is falling behind.
Optional: {}
lastFailureReason stringLastFailureReason and LastFailureTime record the most recent archiving
failure on the current primary, if any.
Optional: {}
lastFailureTime TimeOptional: {}
purgeHeldBy string arrayPurgeHeldBy lists the instances that have not applied the oldest archived
binary log on the primary, which keeps the purge gate from removing it.
Empty when the purge gate is off or holds nothing back.
Optional: {}
purgeHeldSince TimePurgeHeldSince is when the purge gate started keeping that binary log.Optional: {}
forkGTIDs string arrayForkGTIDs lists, one entry per archive segment, the archived
transactions the surviving timeline never executed (a dead branch left
by a lagged promotion): the MySQL GTID set, or a MariaDB range such as
0-1-219..0-1-225. Point-in-time recovery to a time or to the latest
point leaves them out; an explicit targetGTID can still recover them.
Optional: {}
forkDetectedAt TimeForkDetectedAt is when the earliest of those records was written.Optional: {}
oldestSegmentPosition stringOldestSegmentPosition (MariaDB) is the lowest GTID position any archive
segment reached, per domain. The operator keeps the MariaDB primary
timeline back to it.
Optional: {}
disownedGTIDs stringDisownedGTIDs (MySQL) is every transaction the archive recorded as
disowned, including dead branches whose segment retention already
dropped and the dead part of base backups. An instance holding any of
them is diverged.
Optional: {}
gaps string arrayGaps lists the stretches of the timeline the archive is missing between
transactions it holds (a MySQL GTID set, or a MariaDB
domain-first..last range): point-in-time recovery from a base backup
taken before one of them cannot cross it. They come from a binary log
that left the server before it was archived, typically a successor
cloned after the last archived file whose predecessor then died.
Optional: {}
gapsSince TimeGapsSince is when the archive started reporting these gaps. A gap the
former primary's drain fills soon after a failover never raises
ArchiveGap; one that outlives the grace period does.
Optional: {}
coveredGTIDSet stringCoveredGTIDSet (MySQL) is every transaction the archive holds. Failover
prefers, among equally advanced replicas, one whose binary-log history
the archive already covers.
Optional: {}

Database​

Database declares a MySQL schema and the accounts scoped to it on a Cluster in the same namespace. The controller issues only the SQL needed to converge and drops nothing unless asked to.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringDatabase
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec DatabaseSpecspec defines the desired state of DatabaseRequired: {}
status DatabaseStatusstatus defines the observed state of DatabaseOptional: {}

DatabaseGrant​

DatabaseGrant describes a single MySQL GRANT statement.

Appears in:

FieldDescriptionDefaultValidation
privileges string arrayPrivileges is the list of privileges (e.g. "SELECT", "INSERT", "ALL").Required: {}
on stringOn is the target of the grant (e.g. "mydb.*"). Defaults to the managed
database.
Optional: {}

DatabaseList​

DatabaseList contains a list of Database.

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringDatabaseList
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items Database array

DatabaseSpec​

DatabaseSpec defines the desired state of Database.

Appears in:

FieldDescriptionDefaultValidation
cluster LocalObjectReferenceCluster references the MySQL cluster this database belongs to.Required: {}
name stringName is the name of the MySQL database (schema). Defaults to the resource
name if empty.
Optional: {}
ensure EnsureOptionEnsure controls whether the database is created or dropped.presentEnum: [present absent]
Optional: {}
characterSet stringCharacterSet of the database (e.g. "utf8mb4").Optional: {}
collation stringCollation of the database (e.g. "utf8mb4_0900_ai_ci").Optional: {}
users InlineUser arrayUsers is the list of users managed for this database.Optional: {}
reclaimPolicy stringReclaimPolicy controls what happens to the MySQL database when the
Database object is deleted.
retainEnum: [delete retain]
Optional: {}
driftDetection booleanDriftDetection controls whether the operator periodically re-applies this
database and its declared users to correct out-of-band drift. When true
(the default) the controller re-asserts the desired state on every resync,
so a manually dropped schema or altered user is restored within
readyResync. When false the controller reconciles only on changes to the
spec or to a referenced password Secret, and does not periodically
re-apply; drift introduced out of band is not corrected until the next
such change.
trueOptional: {}

DatabaseStatus​

DatabaseStatus defines the observed state of Database.

Appears in:

FieldDescriptionDefaultValidation
applied booleanApplied is true once the desired state has been reconciled.Optional: {}
message stringMessage provides additional detail, typically an error.Optional: {}
observedGeneration integerObservedGeneration is the generation observed by the controller.Optional: {}
passwordStatus object (keys:string, values:string)PasswordStatus records, per managed user ("name@host"), the source Secret
resourceVersion last applied to MySQL. It lets the controller re-apply a
password only when its Secret changes.
Optional: {}
conditions Condition arrayConditions represent the latest observations of the database state.Optional: {}

DatabaseUser​

DatabaseUser declares one installation-wide MySQL account (name@host) and its grants on a Cluster in the same namespace. Unlike the inline users of a Database, it is not scoped to a single schema.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringDatabaseUser
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec DatabaseUserSpecspec defines the desired state of DatabaseUserRequired: {}
status DatabaseUserStatusstatus defines the observed state of DatabaseUserOptional: {}

DatabaseUserGrant​

DatabaseUserGrant describes a single MySQL GRANT statement.

Appears in:

FieldDescriptionDefaultValidation
privileges string arrayPrivileges is the list of privileges (e.g. "SELECT", "INSERT", "ALL").MinItems: 1
on stringOn is the target of the grant (e.g. ".", "mydb.", "mydb.mytable").
Defaults to "
.*".
.Optional: {}

DatabaseUserList​

DatabaseUserList contains a list of DatabaseUser.

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringDatabaseUserList
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items DatabaseUser array

DatabaseUserRevoke​

DatabaseUserRevoke describes a single MySQL REVOKE statement, applied after the grants. The target is required: a revoke must name the schema (or schema object) it carves out, so it cannot accidentally strip a global grant.

Appears in:

FieldDescriptionDefaultValidation
privileges string arrayPrivileges is the list of privileges to revoke (e.g. "INSERT", "UPDATE").MinItems: 1
on stringOn is the target to revoke from (e.g. "mysql.", "sys.").Required: {}

DatabaseUserSpec​

DatabaseUserSpec defines the desired state of DatabaseUser. A DatabaseUser owns a single installation-wide MySQL account (name@host); unlike the inline users of a Database, it is not scoped to a single schema and its grants may target anything in the instance.

Appears in:

FieldDescriptionDefaultValidation
cluster LocalObjectReferenceCluster references the MySQL cluster this user belongs to.Required: {}
name stringName is the MySQL user name. Defaults to the resource name if empty.MaxLength: 32
Optional: {}
host stringHost the user connects from. Defaults to "%".%Optional: {}
ensure EnsureOptionEnsure controls whether the user is created or dropped.presentEnum: [present absent]
Optional: {}
passwordSecret SecretKeySelectorPasswordSecret references the secret key holding the user's password.
Required when Ensure=present.
Optional: {}
superuser booleanSuperuser grants ALL PRIVILEGES on . WITH GRANT OPTION. It is unsafe for
multi-tenant use and is mutually exclusive with Grants. For a constrained
"DBaaS admin", use a Grants entry with ALL on . instead, which omits
WITH GRANT OPTION.
falseOptional: {}
maxUserConnections integerMaxUserConnections resource limit. 0 = no limit.Minimum: 0
Optional: {}
maxQueriesPerHour integerMaxQueriesPerHour resource limit. 0 = no limit.Minimum: 0
Optional: {}
maxUpdatesPerHour integerMaxUpdatesPerHour resource limit. 0 = no limit.Minimum: 0
Optional: {}
maxConnectionsPerHour integerMaxConnectionsPerHour resource limit. 0 = no limit.Minimum: 0
Optional: {}
requireTLS stringRequireTLS sets REQUIRE X509, REQUIRE SSL, or none.noneEnum: [x509 ssl none]
Optional: {}
comment stringComment is an optional user comment.Optional: {}
grants DatabaseUserGrant arrayGrants is the list of grants applied to the user. Targets are
installation-wide and have no default schema (unlike Database.spec.users).
Optional: {}
revokes DatabaseUserRevoke arrayRevokes lists privileges to revoke after Grants are applied, each scoped to
an explicit target (typically a system schema such as "mysql."). Combined
with partial_revokes=ON on the cluster, this carves the system schemas out
of a broad "
.*" grant so a cross-database admin cannot modify the grant
tables and self-escalate. Revokes are applied after Grants, in order.
Not supported on MariaDB: it has neither partial_revokes nor DENY (DENY is
planned for MariaDB 13.1), so the carve-out cannot be enforced. A
DatabaseUser with revokes on a MariaDB cluster is rejected at admission and
stays unapplied (reason UnsupportedOnMariaDB).
Optional: {}
reclaimPolicy stringReclaimPolicy controls what happens to the MySQL user when the
DatabaseUser object is deleted.
retainEnum: [delete retain]
Optional: {}
driftDetection booleanDriftDetection controls whether the operator periodically re-applies this
user to correct out-of-band drift. When true (the default) the controller
re-asserts the desired state on every resync, so a manually altered or
dropped account is restored within readyResync. When false the controller
reconciles only on changes to the spec or to the referenced password
Secret, and does not periodically re-apply; drift introduced out of band
is not corrected until the next such change.
trueOptional: {}

DatabaseUserStatus​

DatabaseUserStatus defines the observed state of DatabaseUser.

Appears in:

FieldDescriptionDefaultValidation
applied booleanApplied is true once the desired state has been reconciled.Optional: {}
message stringMessage provides additional detail, typically an error.Optional: {}
observedGeneration integerObservedGeneration is the generation observed by the controller.Optional: {}
passwordSecretResourceVersion stringPasswordSecretResourceVersion records the source Secret resourceVersion
last applied to MySQL, so the password is re-applied only when it changes.
Optional: {}
conditions Condition arrayConditions represent the latest observations of the user state.Optional: {}

EmbeddedObjectMetadata​

EmbeddedObjectMetadata contains metadata to be inherited by all resources related to a Cluster.

Appears in:

FieldDescriptionDefaultValidation
labels object (keys:string, values:string)Optional: {}
annotations object (keys:string, values:string)Optional: {}

EnsureOption​

Underlying type: string

EnsureOption controls whether a declarative object must be present or absent.

Validation:

  • Enum: [present absent]

Appears in:

FieldDescription
presentEnsurePresent means the object must exist.
absentEnsureAbsent means the object must not exist.

ExternalCluster​

ExternalCluster describes a MySQL server external to this Cluster, used as a replication source or recovery origin.

Appears in:

FieldDescriptionDefaultValidation
name stringName of the external cluster, referenced by Replica.Source and
BootstrapRecovery.Source.
Required: {}
connectionParameters object (keys:string, values:string)ConnectionParameters is a key/value map of connection settings (host,
port, etc.).
Optional: {}
password SecretKeySelectorPassword references a secret key holding the password for the connection.Optional: {}
sslCert SecretKeySelectorSSLCert/SSLKey/SSLRootCert reference secret keys for mTLS to the source.Optional: {}
sslKey SecretKeySelectorOptional: {}
sslRootCert SecretKeySelectorOptional: {}
objectStore S3ObjectStoreObjectStore allows recovering from a backup stored in an object store.Optional: {}
binlogObjectStore S3ObjectStoreBinlogObjectStore is where the external cluster's binary-log archive
lives, when it is not in ObjectStore. Recovery reads base backups from
ObjectStore and binlogs from here.
Optional: {}

FailoverPolicy​

FailoverPolicy bounds and steers the operator's automatic election of a new primary.

Appears in:

FieldDescriptionDefaultValidation
maxTransactionsBehind integerMaxTransactionsBehind caps how many transactions a replica may be missing
and still be promoted during an unplanned failover. The operator measures
the gap in GTIDs, against the last position it recorded for the primary in
status.gtidExecutedByInstance, because the primary itself cannot be asked
once it is down. It refreshes that snapshot periodically rather than on
every commit, so the gap is a lower bound on the true loss and can under
report it, but never over report it.
The gap is not read from Seconds_Behind_Source. That column reports how far
the SQL applier trails the events it has already received. A replica that
stopped receiving reads zero there once it drains its relay log, no matter
how many transactions the primary committed without it, which is precisely
the case that loses data. The column is also NULL whenever the replication
IO thread is disconnected, and it always is on a replica whose primary has
just failed.
If every replica exceeds the bound, the operator refuses the failover and
moves the cluster to Blocked, reporting the size of the gap, rather than
promote a replica and discard the transactions it never received. Writes
then stay down until the old primary comes back with its data, or until an
operator accepts the loss by raising this bound. Leave it unset for no
bound, in which case the most advanced replica is promoted however far
behind it is.
Minimum: 0
Optional: {}
maxReplicationLag DurationMaxReplicationLag caps how far behind a replica may be, in seconds of
writes, and still be promoted during an unplanned failover. It states the
same bound as MaxTransactionsBehind in the unit a recovery objective is
normally written in: a hundred transactions may be a millisecond of writes
or an hour of them, and only the clock version can be held against an RPO.
The measurement comes from the heartbeat the primary stamps into a
replicated table (see spec.replication.heartbeat), which must be enabled for
this bound to have anything to read. A replica's raw reading climbs by one
second per second once the primary stops stamping, so the operator subtracts
how long the primary has been failing and is left with the delay as it stood
when the primary died. That subtraction starts from the moment the operator
noticed the failure, which is never earlier than the failure itself, so the
result overstates the loss rather than understating it.
It is checked only against replicas that actually missed transactions. A
replica holding every transaction the primary committed loses nothing by
being promoted, however far its applier has fallen behind, and the wait for
it to drain its relay log is delay rather than loss.
If no replica is within the bound, the operator refuses the failover and
moves the cluster to Blocked, exactly as it does for MaxTransactionsBehind.
Leave it unset for no time bound.
Optional: {}
preferredPrimary string arrayPreferredPrimary names the instances that should hold the primary role, most
preferred first, as a way to steer the primary onto particular nodes: pin an
instance to a node with the storage or the zone you want writes to land on,
and name it here.
It steers two things. In an election it orders the candidates, so the most
preferred one that is also safe wins. It is only ever a tie-break: a
preferred instance that has diverged, that is missing transactions the bounds
above refuse to lose, or that cannot be proven to hold every other candidate's
transactions, is passed over for one that can. Preference never promotes a
replica that the operator would otherwise have refused.
It also brings the primary back. When the primary is not the most preferred
instance that is currently available, and that instance is a healthy replica
fit to be a switchover target, the operator performs a planned switchover to
it. That happens after any failover away from it has healed, so a preferred
instance that keeps failing does not cause the primary to bounce back to it:
the failback waits out MinTimeBetweenFailovers like any other automatic
promotion.
Names are instance (Pod) names, e.g. "my-cluster-1". Instances that do not
exist are ignored, so a list may name instances of a cluster larger than the
current one. Leave it unset to let the election pick purely on safety and
ordinal order, and to never move a healthy primary.
Optional: {}
minTimeBetweenFailovers DurationMinTimeBetweenFailovers damps a flapping primary: it refuses an automatic
failover that comes less than this long after the previous one settled, so a
primary that dies, is replaced, and whose replacement dies again does not walk
the role through every instance in the cluster in a matter of minutes.
A refusal moves the cluster to Blocked and names the time remaining. It does
not stop the operator from recreating the failed primary's Pod, which is the
outcome the wait exists to allow: a primary that is failing intermittently is
usually better restarted in place than replaced.
It bounds automatic promotions only. A switchover you request by writing
status.targetPrimary is honoured immediately, since a human asking for the
primary to move is not the operator flapping.
Leave it unset to allow a failover as soon as spec.failoverDelay has elapsed,
however recently the last one happened.
Optional: {}
primaryStabilityWindow DurationPrimaryStabilityWindow decides when a promoted primary counts as settled, and
so when MinTimeBetweenFailovers starts running. Without it the cooldown runs
from the moment of the promotion, and a primary that comes up, flaps, and
comes up again still burns the cooldown down while it is misbehaving; once the
cooldown expires the operator fails away from an instance that was never
really working.
With it, the cooldown runs from the point the primary had been continuously
healthy for this long. Every time it drops out, the clock restarts, so an
instance that cannot stay up never settles and the operator keeps declining to
fail over on its behalf, leaving it to recover or an operator to intervene
rather than dragging the rest of the cluster through the churn.
A primary that has been healthy for longer than this window settled long ago,
which is every primary in a cluster that is not flapping, so this costs
nothing in the ordinary case. A promoted primary that never became healthy at
all cannot settle by staying up, so the cooldown falls back to running from
the promotion and the operator is never trapped waiting on an instance that
will not arrive.
It has no effect on its own without MinTimeBetweenFailovers, which is the
bound it qualifies.
Optional: {}

Flavor​

Underlying type: string

Flavor selects the database engine a Cluster runs.

Validation:

  • Enum: [mysql mariadb]

Appears in:

FieldDescription
mysql
mariadb

GroupMember​

GroupMember is one member's state within the group.

Appears in:

FieldDescriptionDefaultValidation
instance stringInstance is the pod name of the member.
state stringState is the member's group state: ONLINE, RECOVERING, OFFLINE, ERROR or
UNREACHABLE.
role stringRole is the member's group role: PRIMARY or SECONDARY.
reachable booleanReachable reports whether the group currently considers this member
reachable (not UNREACHABLE).

GroupReplicationConfiguration​

GroupReplicationConfiguration tunes MySQL Group Replication. All fields map to group_replication_* server variables; the operator owns the rest of the namespace (group name, addresses, seeds, start/bootstrap control).

Appears in:

FieldDescriptionDefaultValidation
consistency stringConsistency maps to group_replication_consistency, the transaction
consistency guarantee the group enforces.
BEFORE_ON_PRIMARY_FAILOVEREnum: [EVENTUAL BEFORE_ON_PRIMARY_FAILOVER BEFORE AFTER BEFORE_AND_AFTER]
Optional: {}
exitStateAction stringExitStateAction maps to group_replication_exit_state_action: what a member
does when it involuntarily leaves the group (e.g. on an unrecoverable error
or loss of quorum).
READ_ONLYEnum: [READ_ONLY OFFLINE_MODE ABORT_SERVER]
Optional: {}
autoRejoinTries integerAutoRejoinTries maps to group_replication_autorejoin_tries: how many times a
member tries to automatically rejoin after being expelled before giving up.
3Minimum: 0
Optional: {}
groupName stringGroupName, when set, pins group_replication_group_name (a UUID). When unset
the operator generates one on first bootstrap and persists it to
status.groupReplication.groupName. Immutable once the group exists; a
changed group name fractures the group.
Optional: {}

GroupReplicationStatus​

GroupReplicationStatus is the operator's cross-validated view of the group, aggregated from every member's reported replication_group_members.

Appears in:

FieldDescriptionDefaultValidation
groupName stringGroupName is the pinned group_replication_group_name (a UUID). Sticky and
immutable once set: a changed group name fractures the group.
Optional: {}
bootstrapped booleanBootstrapped records that the group has been created at least once. Sticky:
false→true on first bootstrap, never auto-cleared. It makes group bootstrap
exactly-once across restarts and re-elections; re-arming it is the path to a
split-brain second group.
Optional: {}
primaryMember stringPrimaryMember is the pod name of the member the group elected PRIMARY.
status.currentPrimary is mirrored from this field.
Optional: {}
members GroupMember arrayMembers is the per-member view of the group.Optional: {}
hasQuorum booleanHasQuorum reports whether a majority of configured members is ONLINE and
reachable, i.e. the group can make progress.
observedViewMax integerObservedViewMax is the largest group view size the operator has ever
observed for this group. Sticky: never decreases. Used as the quorum
denominator so that a group that loses members is recognised as
quorum-lost, while a bootstrapping group uses its current view size.
Optional: {}
observedOnlineMax integerObservedOnlineMax is the largest number of ONLINE members the operator
has ever observed for this group. Sticky, tracked alongside ViewMax.
Optional: {}
viewId stringViewID is the current group view identifier. It changes on every membership
change and is one of the signals the operator reconciles on.
Optional: {}
communicationProtocol stringCommunicationProtocol is the effective minimum-compatible protocol
reported by group_replication_get_communication_protocol(). It can differ
from the server version passed to the setter (MySQL 8.4 reports 8.0.27).
Optional: {}
communicationProtocolTarget stringCommunicationProtocolTarget is the MySQL server version most recently
passed successfully to group_replication_set_communication_protocol(). It
is the idempotency marker for post-upgrade protocol finalization.
Optional: {}

ImageCatalog​

ImageCatalog maps each server series to an instance image for Clusters in its namespace. A Cluster selects an entry with spec.imageCatalogRef.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringImageCatalog
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec ImageCatalogSpecspec defines the desired state of ImageCatalogRequired: {}

ImageCatalogList​

ImageCatalogList contains a list of ImageCatalog.

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringImageCatalogList
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items ImageCatalog array

ImageCatalogRef​

ImageCatalogRef references an ImageCatalog or ClusterImageCatalog entry to resolve a container image for a given MySQL series.

Appears in:

FieldDescriptionDefaultValidation
apiGroup stringAPIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in the core API group.
For any other third-party types, APIGroup is required.
Optional: {}
kind stringKind is the type of resource being referenced
name stringName is the name of resource being referenced
series stringSeries is the MySQL release series to resolve in the catalog, in
"major.minor" form (e.g. "8.0", "8.4", "9.7").
Pattern: ^[0-9]+\.[0-9]+$
Required: {}

ImageCatalogSpec​

ImageCatalogSpec is the shared spec for ImageCatalog and ClusterImageCatalog.

Appears in:

FieldDescriptionDefaultValidation
flavor FlavorFlavor is the advisory engine flavor for the series in this catalog
(mysql or mariadb). It is non-gating: a mismatch does not block
resolution, but improves the admission error message.
Enum: [mysql mariadb]
Optional: {}
images CatalogImage arrayImages is the list of MySQL series to container image mappings. Each
series must appear at most once.
MaxItems: 8
MinItems: 1

ImageInfo​

ImageInfo describes an instance image as its own server binary reports it.

Appears in:

FieldDescriptionDefaultValidation
image stringImage is the image reference that was probed, as resolved from
spec.imageName or the image catalog.
imageID stringImageID is the image the kubelet pulled for the probe, as reported in
the probe Pod's container status (typically repository@sha256:digest).
Optional: {}
flavor FlavorFlavor is the engine the image contains (mysql or mariadb).Enum: [mysql mariadb]
serverVersion stringServerVersion is the server release the image contains, e.g. "8.4.11".

InlineUser​

InlineUser describes a MySQL user managed declaratively as part of a Database. For an installation-wide user not scoped to a single database, use the standalone DatabaseUser CRD instead.

Appears in:

FieldDescriptionDefaultValidation
name stringName of the user.Required: {}
host stringHost the user connects from. Defaults to "%".%Optional: {}
ensure EnsureOptionEnsure controls whether the user is created or dropped.presentEnum: [present absent]
Optional: {}
passwordSecret SecretKeySelectorPasswordSecret references the secret key holding the user's password.Optional: {}
grants DatabaseGrant arrayGrants is the list of grants applied to the user.Optional: {}

LocalObjectReference​

LocalObjectReference contains the reference to a Kubernetes object in the same namespace, identified by name.

Appears in:

FieldDescriptionDefaultValidation
name stringName of the referentRequired: {}

LogicalBackupOptions​

LogicalBackupOptions configures a logical (SQL dump) backup.

Appears in:

FieldDescriptionDefaultValidation
databases string arrayDatabases limits the dump to these schemas. Empty means every application
schema. The system schemas (mysql, sys, performance_schema,
information_schema) and operator-owned schemas are always excluded.
MaxItems: 256
items:MaxLength: 64
items:MinLength: 1
Optional: {}
extraArgs string arrayExtraArgs are appended to the dump command. They replace the cluster's
spec.backup.logicalOptions. The operator does not validate them: flags
that change the output format or GTID handling break restore.
Optional: {}

LogicalRestore​

LogicalRestore loads selected databases from a logical backup into a running cluster's primary.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringLogicalRestore
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec LogicalRestoreSpecspec defines the desired state of LogicalRestoreRequired: {}
status LogicalRestoreStatusstatus defines the observed state of LogicalRestoreOptional: {}

LogicalRestoreList​

LogicalRestoreList contains a list of LogicalRestore.

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringLogicalRestoreList
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items LogicalRestore array

LogicalRestorePhase​

Underlying type: string

LogicalRestorePhase is the current phase of a LogicalRestore.

Appears in:

FieldDescription
pendingLogicalRestorePhasePending means the restore has not started: the dump or
the cluster's primary is not ready yet.
runningLogicalRestorePhaseRunning means the restore worker Job is loading the
dump.
completedLogicalRestorePhaseCompleted means every selected database was loaded.
failedLogicalRestorePhaseFailed means the restore failed. The status error says
whether the selected databases were changed.

LogicalRestorePolicy​

Underlying type: string

LogicalRestorePolicy says what a restore does with a selected database that already holds objects.

Validation:

  • Enum: [FailIfExists DropAndRecreate]

Appears in:

FieldDescription
FailIfExistsLogicalRestoreFailIfExists refuses the whole restore when a selected
database holds a table, view, routine or event. Nothing is changed. An
empty database, such as one a Database resource created, is loaded into.
DropAndRecreateLogicalRestoreDropAndRecreate drops each selected database, then loads it
from the dump. Schema-level grants survive the drop.

LogicalRestoreSpec​

LogicalRestoreSpec defines the desired state of LogicalRestore. It is immutable: a restore is a one-shot action.

Appears in:

FieldDescriptionDefaultValidation
cluster LocalObjectReferenceCluster is the running cluster to load into. The dump is loaded into its
current primary and reaches the replicas through replication.
Required: {}
backup LocalObjectReferenceBackup references a completed logical Backup in this namespace. Mutually
exclusive with Source.
Optional: {}
source stringSource names an entry of the target Cluster's spec.externalClusters whose
object store holds the dump. Mutually exclusive with Backup.
Optional: {}
backupID stringBackupID selects a dump under Source. Empty picks the latest.Optional: {}
databases string arrayDatabases are the schemas loaded from the dump. It is required: a restore
never loads a whole dump implicitly. Each must be in the dump.
MaxItems: 256
MinItems: 1
items:MaxLength: 64
items:MinLength: 1
policy LogicalRestorePolicyPolicy says what to do with a selected database that already holds
objects: FailIfExists refuses the restore, DropAndRecreate drops the
database first. It is required, so an overwrite is always explicit.
Enum: [FailIfExists DropAndRecreate]
Required: {}
jobTemplate BackupJobTemplateJobTemplate shapes the restore worker Job: resources, scheduling, extra
labels and annotations, the finished-Job TTL and the deadline. It
overrides the cluster-wide spec.backup.jobTemplate field by field, like a
Backup's.
Optional: {}

LogicalRestoreStatus​

LogicalRestoreStatus defines the observed state of LogicalRestore.

Appears in:

FieldDescriptionDefaultValidation
phase LogicalRestorePhasePhase is the current phase of the restore.Optional: {}
targetInstance stringTargetInstance is the primary the dump is loaded into.Optional: {}
jobName stringJobName is the Kubernetes Job running the restore.Optional: {}
backupID stringBackupID identifies the dump in the object store.Optional: {}
sourcePath stringSourcePath is the full object-store path of the dump.Optional: {}
databases string arrayDatabases lists the schemas restored.Optional: {}
startedAt TimeStartedAt/StoppedAt record the restore timing.Optional: {}
stoppedAt TimeOptional: {}
error stringError holds the error message if the restore failed, and says whether
the selected databases were changed.
Optional: {}
conditions Condition arrayConditions represent the latest observations of the restore state.Optional: {}

ManagedConfiguration​

ManagedConfiguration describes resources managed declaratively by the operator.

Appears in:

FieldDescriptionDefaultValidation
services ManagedServicesServices describes the services managed for the cluster.Optional: {}
roles RoleConfiguration arrayRoles is the list of MySQL users (roles) managed declaratively on the
primary instance.
Optional: {}

ManagedRoleStatus​

Underlying type: string

ManagedRoleStatus is the reconciliation state of a single managed role.

Appears in:

FieldDescription
reconciledManagedRoleReconciled means the role matches its desired state.
not-managedManagedRoleNotManaged means the MySQL user exists but is not managed.
pending-reconciliationManagedRolePendingReconciliation means the role still needs work.
reservedManagedRoleReserved means the role name is reserved by the operator.

ManagedRolesStatus​

ManagedRolesStatus reports the reconciliation state of managed roles.

Appears in:

FieldDescriptionDefaultValidation
byStatus object (keys:ManagedRoleStatus, values:string array)ByStatus groups managed role names by their reconciliation status.Optional: {}
cannotReconcile object (keys:string, values:string array)CannotReconcile maps a role name to the reasons it could not be reconciled.Optional: {}
passwordStatus object (keys:string, values:RolePasswordState)PasswordStatus tracks the applied password Secret version per role.Optional: {}

ManagedService​

ManagedService describes a user-defined managed service.

Appears in:

FieldDescriptionDefaultValidation
selectorType ServiceSelectorTypeSelectorType specifies the type of selectors the service will have.
Valid values are "rw", "r", and "ro".
Enum: [rw r ro]
Required: {}
name stringName is the name of the additional service. Must be unique among all
managed services and must not collide with the default service names
(<cluster>-rw, <cluster>-ro, <cluster>-r).
Required: {}
updateStrategy ServiceUpdateStrategyUpdateStrategy describes how the service template is reconciled with the
operator defaults.
patchEnum: [patch replace]
Optional: {}
serviceTemplate ServiceTemplateSpecServiceTemplate is the template specification for the service. When
UpdateStrategy is "patch", fields here are merged on top of the
role-specific defaults. When "replace", they replace the defaults
entirely (except for selector and owner reference).
Optional: {}

ManagedServices​

ManagedServices controls the services generated for the cluster.

Appears in:

FieldDescriptionDefaultValidation
disabledDefaultServices ServiceSelectorType arrayDisabledDefaultServices is the list of default services (rw, ro, r) to
disable. The rw service cannot be disabled.
Enum: [rw ro r]
Optional: {}
template ServiceTemplateSpecTemplate applies to the three default services (rw, ro, r). Fields set
here are merged into each default service. The operator still chooses the
selector and port based on the service role.
Optional: {}
additional ManagedService arrayAdditional is a list of additional managed services specified by the
user. Each entry declares a selectorType and an optional template to
overlay on top of the role-specific defaults.
Optional: {}

MariaDBEpoch​

MariaDBEpoch is one change of primary on a MariaDB cluster.

Appears in:

FieldDescriptionDefaultValidation
instance stringInstance is the primary of this epoch.
serverID integerServerID is its @@server_id, the server component of the GTIDs it
authors.
handoff stringHandoff is its @@gtid_slave_pos when it took authority: per domain, the
last transaction it inherited.
Optional: {}
since TimeSince is when the operator first observed it as primary.

Metadata​

Metadata is a structure similar to the metav1.ObjectMeta, but still parseable by controller-gen to create a suitable CRD for the user. The comment of PodTemplateSpec has an explanation of why we are not using the core data types.

Appears in:

FieldDescriptionDefaultValidation
name stringThe name of the resource. Only supported for certain typesOptional: {}
labels object (keys:string, values:string)Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
More info: http://kubernetes.io/docs/user-guide/labels
Optional: {}
annotations object (keys:string, values:string)Annotations is an unstructured key value map stored with a resource that
may be set by external tools to store and retrieve arbitrary metadata. They
are not queryable and should be preserved when modifying objects.
More info: http://kubernetes.io/docs/user-guide/annotations
Optional: {}

MonitoringConfiguration​

MonitoringConfiguration configures cluster monitoring.

Appears in:

FieldDescriptionDefaultValidation
enablePodMonitor booleanEnablePodMonitor creates a PodMonitor for the cluster pods.falseOptional: {}
customQueriesConfigMap ConfigMapKeySelector arrayCustomQueriesConfigMap references config maps holding custom monitoring
queries.
Optional: {}
customQueriesSecret SecretKeySelector arrayCustomQueriesSecret references secrets holding custom monitoring queries.Optional: {}
disableDefaultQueries booleanDisableDefaultQueries disables the built-in monitoring query set.Optional: {}
metricsQueriesTTL DurationMetricsQueriesTTL is the minimum interval between executions of the
default and custom monitoring queries.
Optional: {}
privileges RolePrivilege arrayPrivileges are extra grants for the cnmsql_metrics account that custom
queries run as. Only SELECT and SHOW VIEW on a database (db.*) or a
table (db.table) are allowed; . and the mysql schema are refused. The
operator applies them on the primary and revokes any other grant the
account holds, except its built-in ones. Each entry must set on.
MaxItems: 32
Optional: {}
tls ClusterMonitoringTLSConfigTLS configures TLS for the instance metrics endpoint.Optional: {}

MySQLConfiguration​

MySQLConfiguration holds the MySQL engine configuration.

Appears in:

FieldDescriptionDefaultValidation
parameters object (keys:string, values:string)Parameters is a key/value map of my.cnf settings applied under the
[mysqld] section.
Optional: {}
binlogFormat stringBinlogFormat is the binary log format. ROW is required for safe
replication and PITR and is the default.
ROWEnum: [ROW STATEMENT MIXED]
Optional: {}
semiSync SemiSyncConfigurationSemiSync configures semi-synchronous replication.Optional: {}
additionalConfigFiles object (keys:string, values:string)AdditionalConfigFiles are extra files dropped into the MySQL configuration
directory, keyed by file name.
Optional: {}

NodeMaintenanceWindow​

NodeMaintenanceWindow contains information that the operator will use while upgrading the underlying nodes.

Appears in:

FieldDescriptionDefaultValidation
reusePVC booleanReusePVC, when true, reuses the existing PVC during a node maintenance
(instead of provisioning a fresh one).
trueOptional: {}
inProgress booleanInProgress signals that a node maintenance is in progress.falseOptional: {}

ObjectMetaTemplate​

ObjectMetaTemplate carries the user-configurable metadata fields.

Appears in:

FieldDescriptionDefaultValidation
labels object (keys:string, values:string)Labels added to the Service.Optional: {}
annotations object (keys:string, values:string)Annotations added to the Service.Optional: {}

PrimaryUpdateMethod​

Underlying type: string

PrimaryUpdateMethod contains the method to use when upgrading the primary server of the cluster as part of rolling updates.

Validation:

  • Enum: [switchover restart]

Appears in:

FieldDescription
switchoverPrimaryUpdateMethodSwitchover means the operator promotes a replica before
updating the former primary.
restartPrimaryUpdateMethodRestart means the operator restarts the primary in
place.

PrimaryUpdateStrategy​

Underlying type: string

PrimaryUpdateStrategy contains the strategy to follow when upgrading the primary server of the cluster as part of rolling updates.

Validation:

  • Enum: [unsupervised supervised]

Appears in:

FieldDescription
unsupervisedPrimaryUpdateStrategyUnsupervised means that the operator performs the
switchover/restart of the primary automatically.
supervisedPrimaryUpdateStrategySupervised means that the operator waits for the user
to manually trigger the primary update.

RecoveryTarget​

RecoveryTarget allows to specify a point in time to recover to.

Appears in:

FieldDescriptionDefaultValidation
targetTime stringTargetTime is an RFC3339 timestamp to recover to.Optional: {}
targetGTID stringTargetGTID is the GTID set to recover up to.Optional: {}
targetImmediate booleanTargetImmediate stops recovery as soon as a consistent state is reached.Optional: {}

ReplicaClusterConfiguration​

ReplicaClusterConfiguration turns the cluster into a replica that follows an external source.

Appears in:

FieldDescriptionDefaultValidation
enabled booleanEnabled controls whether the cluster runs in replica mode.trueOptional: {}
source stringSource is the name of the entry in ExternalClusters to replicate from.Required: {}

ReplicationConfiguration​

ReplicationConfiguration selects and tunes the replication topology.

Appears in:

FieldDescriptionDefaultValidation
mode stringMode is the replication topology. Immutable after creation.asyncEnum: [async groupReplication]
Optional: {}
groupReplication GroupReplicationConfigurationGroupReplication tunes the group when Mode=groupReplication. It must not be
set unless Mode is groupReplication.
Optional: {}
heartbeat ReplicationHeartbeatHeartbeat tunes the replication-lag heartbeat, which is on by default.Optional: {}
maxReadyLag DurationMaxReadyLag is the maximum replication lag a replica may report and still
be Ready. It shapes read traffic, not failover: a replica that is further
behind than this bound keeps failing its readiness probe, so the Kubernetes
endpoints controller holds it out of the -ro and -r Services and the
Cluster reports Degraded until it has caught up. This closes the window in
which a replica returning from a long outage — or scaled up from a volume
cloned hours earlier — serves reads that are hours old while its
replication threads are nominally running.
The measurement is the heartbeat lag the instance already computes (see
spec.replication.heartbeat): the age of the newest stamp it has applied,
which grows in wall-clock seconds no matter how fast the applier chases
the primary. The heartbeat must be enabled for the bound to have anything
to read, so setting this bound while explicitly disabling the heartbeat is
rejected. A replica that cannot produce a heartbeat reading at all —
before its first stamp arrives, or while the heartbeat read is failing —
is treated as over the bound rather than assumed caught up, so it stays
out of the read Services until it can prove otherwise. The bound must be
at least three heartbeat intervals: the reading grows by up to one
interval between stamps even on a caught-up replica.
The reading compares the primary's clock (the stamp) with the replica's,
so clock skew between their nodes adds to it; keep the bound well above
the skew NTP allows. While the primary is down or stops stamping (a
failover, a primary that cannot write), every replica's reading grows,
so once it passes the bound all replicas leave the read Services until a
primary stamps again.
It gates async replicas only. Under Group Replication a member is ready
only once it is ONLINE, which already excludes a member that is still
recovering; leave this unset there. It is also not a failover bound: what
a replica may lose when promoted is governed by
failoverPolicy.maxReplicationLag and failoverPolicy.maxTransactionsBehind.
Leave it unset (or zero) to disable the gate, which is the default: a
replica whose replication threads are running is Ready however far behind
it is.
Optional: {}

ReplicationHeartbeat​

ReplicationHeartbeat configures the replication-lag heartbeat: the writable primary's instance manager stamps the current time into a small replicated table, and every instance reads it back to measure how old the newest write it has caught up to is.

It exists because the server cannot answer that question itself. Seconds_Behind_Source times the SQL applier against the events it has already received, so a replica that stopped receiving anything reports zero once its relay log drains, no matter how far the primary ran on without it, and it reports NULL whenever the IO thread is disconnected, which is the state every replica is in the moment its primary dies.

The table is heartbeat.heartbeat, in pt-heartbeat's shape, so the heartbeat collector already built into mysqld_exporter scrapes it as-is.

Appears in:

FieldDescriptionDefaultValidation
enabled booleanEnabled turns the heartbeat on. It defaults to true: the cost is one small
replicated write per interval on the primary, and it is what
failoverPolicy.maxReplicationLag and the lag metrics read.
trueOptional: {}
interval DurationInterval is how often the primary stamps the table. It sets the floor on
every lag reading, because a replica in perfect sync still reports an age of
up to one interval simply because the next stamp is not written yet. Keep it
well under any maxReplicationLag you set. Defaults to 1s.
1sOptional: {}

RoleConfiguration​

RoleConfiguration describes a MySQL user managed declaratively against the primary instance.

Appears in:

FieldDescriptionDefaultValidation
name stringName is the MySQL user name.MaxLength: 32
Required: {}
host stringHost is the MySQL host part. Defaults to "%".%Optional: {}
ensure EnsureOptionEnsure controls whether the user should exist or be absent.presentEnum: [present absent]
Optional: {}
passwordSecret SecretKeySelectorPasswordSecret references a Secret key holding the user's password. When
unset, the operator generates a password and stores it in a Secret named
<cluster>-<name> with key "password".
Optional: {}
superuser booleanSuperuser grants ALL PRIVILEGES on . WITH GRANT OPTION.falseOptional: {}
maxUserConnections integerMaxUserConnections resource limit. 0 = no limit.Minimum: 0
Optional: {}
maxQueriesPerHour integerMaxQueriesPerHour resource limit. 0 = no limit.Minimum: 0
Optional: {}
maxUpdatesPerHour integerMaxUpdatesPerHour resource limit. 0 = no limit.Minimum: 0
Optional: {}
maxConnectionsPerHour integerMaxConnectionsPerHour resource limit. 0 = no limit.Minimum: 0
Optional: {}
requireTLS stringRequireTLS sets the connection TLS requirement: x509, ssl, or none.noneEnum: [x509 ssl none]
Optional: {}
privileges RolePrivilege arrayPrivileges are grants (global or per-database). Mutually exclusive with
Superuser.
Optional: {}

RolePasswordState​

RolePasswordState records the password Secret version last applied for a role.

Appears in:

FieldDescriptionDefaultValidation
secretResourceVersion stringSecretResourceVersion is the resourceVersion of the password Secret last
applied.
Optional: {}
lastApplied TimeLastApplied is when the password was last applied.Optional: {}

RolePrivilege​

RolePrivilege is a grant of one or more privileges on a target.

Appears in:

FieldDescriptionDefaultValidation
privileges string arrayPrivileges is the grant list (SELECT, INSERT, ALL, etc.).MinItems: 1
on stringOn is the target (e.g. ".", "mydb."). Defaults to ".*".Optional: {}

S3Credentials​

S3Credentials holds the references to the secrets containing the credentials used to access an S3-compatible object store.

Appears in:

FieldDescriptionDefaultValidation
accessKeyId SecretKeySelectorThe reference to the secret key containing the access key id.Optional: {}
secretAccessKey SecretKeySelectorThe reference to the secret key containing the secret access key.Optional: {}
sessionToken SecretKeySelectorThe reference to the secret key containing the session token, used for
temporary credentials.
Optional: {}
inheritFromIAMRole booleanInheritFromIAMRole, when true, makes the credentials be retrieved from the
pod's environment (IRSA / instance profile) instead of from a secret.
falseOptional: {}

S3ObjectStore​

S3ObjectStore describes an S3-compatible object store, designed to be compatible with as many providers as possible (AWS S3, MinIO, Ceph RGW, Wasabi, Backblaze B2, etc.).

Appears in:

FieldDescriptionDefaultValidation
endpoint stringEndpoint is the URL of the S3-compatible service. Leave empty to target
AWS S3 with the region's default endpoint.
Optional: {}
region stringRegion is the bucket region. Required by most providers; for AWS it
selects the regional endpoint. When empty it defaults to the region the
endpoint expects requests to be signed with: "auto" for Cloudflare R2,
"us-east-1" everywhere else (which MinIO, Ceph and friends accept).
Optional: {}
bucket stringBucket is the destination bucket name.Required: {}
path stringPath is the key prefix (folder) inside the bucket under which backups are
stored.
Optional: {}
forcePathStyle booleanForcePathStyle uses path-style addressing (endpoint/bucket/key) instead of
virtual-hosted style (bucket.endpoint/key). Required by MinIO, Ceph and
most non-AWS providers; defaults to true for maximum compatibility.
trueOptional: {}
signatureVersion S3SignatureVersionSignatureVersion selects the request signing scheme. Defaults to s3v4;
set to s3v2 for legacy providers.
s3v4Enum: [s3v4 s3v2]
Optional: {}
serverSideEncryption stringServerSideEncryption sets the SSE algorithm applied to every uploaded
object: AES256 (SSE-S3), aws:kms, or aws:kms:<key-id>. Leave unset on
providers that encrypt at rest unconditionally (MinIO, R2, B2), which
reject or silently ignore the SSE header.
Optional: {}
storageClass stringStorageClass sets the storage class of every uploaded object (e.g.
"STANDARD_IA"). Leave unset on providers with a single class; a class the
provider does not know is rejected at upload time.
Optional: {}
credentials S3CredentialsCredentials to access the object store.Required: {}
tls S3TLSConfigTLS configuration for the endpoint connection.Optional: {}

S3SignatureVersion​

Underlying type: string

S3SignatureVersion is the AWS Signature version used to sign object-store requests.

Validation:

  • Enum: [s3v4 s3v2]

Appears in:

FieldDescription
s3v4SignatureVersionV4 is the default AWS Signature V4.
s3v2SignatureVersionV2 is the legacy AWS Signature V2, kept for older
S3-compatible providers.

S3TLSConfig​

S3TLSConfig configures TLS verification against the object-store endpoint.

Appears in:

FieldDescriptionDefaultValidation
insecureSkipVerify booleanInsecureSkipVerify disables TLS certificate verification against the
endpoint. Use only for testing.
falseOptional: {}
caBundleSecret SecretKeySelectorCABundleSecret references a secret key holding a PEM CA bundle used to
verify the endpoint certificate (for private CAs / self-signed endpoints).
Optional: {}

ScheduledBackup​

ScheduledBackup creates Backup objects for a Cluster on a cron schedule.

Appears in:

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringScheduledBackup
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec ScheduledBackupSpecspec defines the desired state of ScheduledBackupRequired: {}
status ScheduledBackupStatusstatus defines the observed state of ScheduledBackupOptional: {}

ScheduledBackupList​

ScheduledBackupList contains a list of ScheduledBackup.

FieldDescriptionDefaultValidation
apiVersion stringmysql.cnmsql.co/v1alpha1
kind stringScheduledBackupList
kind stringKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion stringAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ListMetaRefer to Kubernetes API documentation for fields of metadata.
items ScheduledBackup array

ScheduledBackupSpec​

ScheduledBackupSpec defines the desired state of ScheduledBackup.

Appears in:

FieldDescriptionDefaultValidation
schedule stringSchedule is a cron expression (6 fields, including seconds) defining when
backups are taken.
Required: {}
cluster LocalObjectReferenceCluster references the cluster to back up.Required: {}
suspend booleanSuspend, when true, pauses the schedule.falseOptional: {}
immediate booleanImmediate, when true, takes a backup as soon as the ScheduledBackup is
created, in addition to the schedule.
falseOptional: {}
backupOwnerReference stringBackupOwnerReference controls the owner reference set on the generated
Backup objects.
selfEnum: [none self cluster]
Optional: {}
reclaimPolicy BackupReclaimPolicyReclaimPolicy is propagated to every generated Backup as its
spec.reclaimPolicy. With "Delete" each generated Backup carries the cleanup
finalizer, so deleting it also removes its archive (the backup payload
and its manifest) from the object store. Defaults to "Retain", the
non-destructive default.
RetainEnum: [Retain Delete]
Optional: {}
method BackupMethodMethod is the backup method used for the generated backups.xtrabackupEnum: [xtrabackup volumeSnapshot logical]
Optional: {}
target BackupTargetTarget instance to take the generated backups from.prefer-standbyEnum: [primary prefer-standby]
Optional: {}
online booleanOnline, when true, performs non-blocking (hot) backups.trueOptional: {}
jobTemplate BackupJobTemplateJobTemplate is propagated to every generated Backup as its spec.jobTemplate,
shaping the backup worker Job (resources, scheduling, labels/annotations, and
the finished-Job TTL). When unset the generated Backups fall back to the
cluster-wide spec.backup.jobTemplate.
Optional: {}
logical LogicalBackupOptionsLogical is propagated to every generated Backup as its spec.logical when
method is "logical".
Optional: {}
successfulBackupsHistoryLimit integerSuccessfulBackupsHistoryLimit caps how many completed Backup objects this
schedule keeps. The newest that many are retained and older completed Backups
are garbage-collected. Unset means no count limit. The single newest completed
Backup is always kept regardless, so a schedule never prunes its last recovery
point. Deleting a Backup honours its reclaimPolicy: a Delete-policy Backup also
reclaims its object-store archive, a Retain-policy one leaves the archive (see
spec.backup.retentionPolicy on the Cluster for object-store retention).
Minimum: 0
Optional: {}
failedBackupsHistoryLimit integerFailedBackupsHistoryLimit caps how many failed Backup objects this schedule
keeps. The newest that many are retained and older failed Backups are
garbage-collected. Unset means no count limit.
Minimum: 0
Optional: {}
retentionPolicy stringRetentionPolicy is a time window (e.g. "30d", "8w", "3m"; days, weeks, months,
where a month is 30 days) after which this schedule's terminal Backup objects
are garbage-collected. It uses the same syntax as the Cluster
spec.backup.retentionPolicy. A terminal Backup is pruned when it exceeds the
history limit OR ages past this window, whichever applies. Unset means no time
limit. The newest completed Backup is always kept.
Pattern: ^[1-9][0-9]*[dwm]$
Optional: {}

ScheduledBackupStatus​

ScheduledBackupStatus defines the observed state of ScheduledBackup.

Appears in:

FieldDescriptionDefaultValidation
lastCheckTime TimeLastCheckTime is the last time the schedule was evaluated.Optional: {}
lastScheduleTime TimeLastScheduleTime is the last time a backup was triggered.Optional: {}
nextScheduleTime TimeNextScheduleTime is the next time a backup will be triggered.Optional: {}

SecretKeySelector​

SecretKeySelector selects a key from a Secret in the same namespace.

Appears in:

FieldDescriptionDefaultValidation
name stringName of the SecretRequired: {}
key stringKey within the Secret to selectRequired: {}

SemiSyncConfiguration​

SemiSyncConfiguration configures semi-synchronous replication.

Appears in:

FieldDescriptionDefaultValidation
enabled booleanEnabled turns on semi-synchronous replication.falseOptional: {}
timeoutMillis integerTimeout in milliseconds the primary waits for a replica acknowledgement
before falling back to asynchronous replication.
Minimum: 0
Optional: {}
dataDurability stringDataDurability controls how strictly minSyncReplicas is enforced when
replicas are unhealthy. "preferred" (the default) keeps the primary
writable by self-healing the acknowledgement count down to the number of
healthy replicas; "required" leaves it fixed so writes block until enough
replicas acknowledge. It has no effect on MariaDB, whose primary always
waits for exactly one acknowledgement.
preferredEnum: [preferred required]
Optional: {}

ServiceAccountTemplate​

ServiceAccountTemplate contains the template needed to generate the service accounts.

Appears in:

FieldDescriptionDefaultValidation
metadata MetadataRefer to Kubernetes API documentation for fields of metadata.Optional: {}

ServiceSelectorType​

Underlying type: string

ServiceSelectorType is the type of a default service.

Validation:

  • Enum: [rw ro r]

Appears in:

FieldDescription
rwServiceSelectorTypeRW selects the read-write (primary) service.
roServiceSelectorTypeRO selects the read-only (replicas) service.
rServiceSelectorTypeR selects the read (any instance) service.

ServiceTemplateServiceSpec​

ServiceTemplateServiceSpec exposes the subset of corev1.ServiceSpec fields that users are allowed to customise. The operator retains control over the selector, ports, clusterIP, and owner reference.

Appears in:

FieldDescriptionDefaultValidation
type ServiceTypeType determines how the Service is exposed. Defaults to ClusterIP.Enum: [ClusterIP NodePort LoadBalancer ExternalName]
Optional: {}
externalTrafficPolicy ServiceExternalTrafficPolicyExternalTrafficPolicy describes how nodes distribute service traffic.Optional: {}
sessionAffinity ServiceAffinitySessionAffinity configures session affinity.Optional: {}
loadBalancerSourceRanges string arrayLoadBalancerSourceRanges restricts load balancer access.Optional: {}
externalName stringExternalName is the external reference for ExternalName services.Optional: {}
healthCheckNodePort integerHealthCheckNodePort specifies the health check node port.Optional: {}

ServiceTemplateSpec​

ServiceTemplateSpec describes the user-customisable parts of a managed Service.

Appears in:

FieldDescriptionDefaultValidation
metadata ObjectMetaTemplateRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec ServiceTemplateServiceSpecSpecification of the desired behavior of the Service. The selector field
is operator-managed and cannot be overridden.
Optional: {}

ServiceUpdateStrategy​

Underlying type: string

ServiceUpdateStrategy describes how the service template is reconciled.

Validation:

  • Enum: [patch replace]

Appears in:

FieldDescription
patchServiceUpdateStrategyPatch merges user fields onto operator defaults.
replaceServiceUpdateStrategyReplace replaces operator defaults with the user template.

StorageConfiguration​

StorageConfiguration is the configuration used to create and reconcile PVCs, usable for the instance data directory or for separate binlog storage.

Appears in:

FieldDescriptionDefaultValidation
storageClass stringStorageClass to use for PVCs. Applied after evaluating the PVC template,
if available. If not specified, the generated PVCs will use the default
storage class.
Optional: {}
size stringSize of the storage. Required if not already specified in the PVC template.
Changes to this field are automatically reapplied to the created PVCs.
Size cannot be decreased.
Optional: {}
resizeInUseVolumes booleanResizeInUseVolumes, when true (the default), grows mounted PVCs in place and
relies on the storage backend to expand the filesystem online. Set it to
false when the backend cannot expand a volume in use: the operator then
completes a resize by recycling the instance Pod (serialised
replica-by-replica, primary last) so the volume is detached and remounted.
trueOptional: {}
pvcTemplate PersistentVolumeClaimSpecTemplate to be used to generate the Persistent Volume ClaimOptional: {}

UpgradeConfiguration​

UpgradeConfiguration tunes MySQL server major-version upgrades.

Appears in:

FieldDescriptionDefaultValidation
backupBeforeUpgrade booleanBackupBeforeUpgrade controls whether the operator takes a fresh backup
before starting a major-version upgrade and waits for it to succeed before
rolling any instance. Defaults to true. Set false to skip (e.g. when an
external backup process is in place). The data-dictionary upgrade is
irreversible, so the backup is the only rollback path.
Optional: {}