Skip to main content

API Reference

Field tables on this page are auto-generated from the CRD OpenAPI schemas via crd-ref-docs. Narrative sections with YAML examples, behavioral semantics, and constraints are hand-maintained.

The API group is:

mysql.cnmsql.co/v1alpha1

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

Packages​

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 namespaced one-shot physical backup request. Short name: mybackup

Example:

apiVersion: mysql.cnmsql.co/v1alpha1
kind: Backup
metadata:
name: backup-sample
spec:
cluster:
name: cluster-sample
method: xtrabackup
target: prefer-standby
online: true

By default, deleting a Backup object does not delete remote object-store data. To opt a Backup into remote cleanup, add the mysql.cnmsql.co/cleanup-backup-files finalizer: the operator then deletes the backup's archive (backup.xbstream + metadata.json) from the object store when the Backup is deleted, and releases the finalizer only after cleanup succeeds. The operator never adds this finalizer on its own.

Backup is the Schema for the backups API.

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.
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: {}
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 init container.
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 operators may set on the backup worker Job. 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: {}
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 same requests/limits from the
cluster-level template are applied to the restore init container.
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.
Optional: {}
tolerations Toleration arrayTolerations allow the backup worker Job's pod to schedule onto tainted
nodes.
Optional: {}
affinity AffinityAffinity sets the affinity/anti-affinity rules for the backup worker Job's
pod.
Optional: {}
priorityClassName stringPriorityClassName sets the pod priority for the backup worker Job.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 physical backup. +kubebuilder:validation:Enum=xtrabackup;volumeSnapshot

Validation:

  • Enum: [xtrabackup volumeSnapshot]

Appears in:

FieldDescription
xtrabackupBackupMethodXtrabackup uses Percona XtraBackup to stream a physical backup
to the object store.
volumeSnapshotBackupMethodVolumeSnapshot uses CSI volume snapshots.

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]
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
(backup.xbstream + metadata.json) 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: {}

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]
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: {}
sha256 stringSHA256 is the checksum of the uploaded backup artifact.Optional: {}
beginGTID stringBeginGTID/EndGTID record the GTID range covered by the backup.Optional: {}
endGTID stringOptional: {}
beginBinlog stringBeginBinlog/EndBinlog record the binary log coordinates.Optional: {}
endBinlog stringOptional: {}
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. +kubebuilder:validation:Enum=primary;prefer-standby

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: {}

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: {}

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.0"). 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.
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.
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.
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.
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 is the main namespaced resource. It describes a Percona Server for MySQL topology, bootstrap method, storage, image, backup configuration, and operational policy.

Short names: mysql, mysqlcluster

Minimal example​

apiVersion: mysql.cnmsql.co/v1alpha1
kind: Cluster
metadata:
name: cluster-sample
spec:
instances: 3
imageName: ghcr.io/cnmsql/cnmsql-instance:8.4
storage:
size: 10Gi
mysql:
binlogFormat: ROW
bootstrap:
initdb:
database: app
owner: app

Image selection​

Use either imageName for a direct reference or imageCatalogRef to resolve via a catalog:

spec:
imageName: ghcr.io/cnmsql/cnmsql-instance:8.4
spec:
imageCatalogRef:
apiGroup: mysql.cnmsql.co
kind: ImageCatalog
name: percona-images
series: "8.4"

MySQL configuration​

spec:
mysql:
parameters:
require_secure_transport: "ON"
max_connections: "500"
binlogFormat: ROW
semiSync:
enabled: true
timeoutMillis: 1000
dataDurability: preferred
additionalConfigFiles:
custom.cnf: |
[mysqld]
sort_buffer_size=4M

Denied and deprecated parameters: spec.mysql.parameters is validated before provisioning. Keys are compared case-insensitively with dashes and underscores treated as equivalent (log-bin equals log_bin).

Denied keys set the cluster phase: Blocked with a reason naming the offending key. These are keys the operator manages directly (replication identity, topology, TLS material, binlog durability) or keys that would relocate on-disk paths or expose the administrative interface: server_id, gtid_mode, read_only, log_bin, ssl_cert, sync_binlog, datadir, socket, tmpdir, plugin_dir, secure_file_priv, log_error, admin_address, admin_ssl_cert, tls_ciphersuites, skip_replica_start, auto_generate_certs. require_secure_transport is not denied. Requiring TLS for client connections is the user's choice.

Deprecated keys are accepted but emit a DeprecatedParameter warning event pointing at the current spelling, e.g. slave_parallel_workers (use replica_parallel_workers), master_info_repository (removed on 8.0.23+).

Storage​

spec:
storage:
storageClass: fast
size: 100Gi
resizeInUseVolumes: true

storage and binlogStorage share the same shape: storageClass, size, resizeInUseVolumes, and pvcTemplate for a full PVC template override.

Bootstrap​

Fresh initialization:

spec:
bootstrap:
initdb:
database: app
owner: app
secret:
name: app-credentials
postInitSQL:
- CREATE TABLE app.ready (id int primary key)
characterSet: utf8mb4
collation: utf8mb4_0900_ai_ci

Recovery from a Backup:

spec:
bootstrap:
recovery:
backup:
name: backup-sample

Point-in-time recovery:

spec:
bootstrap:
recovery:
backup:
name: backup-sample
recoveryTarget:
targetGTID: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:1-500"

Raw object-store recovery (no Backup CR) points bootstrap.recovery.source at an externalClusters entry. The entry carries its own objectStore and its name is the S3 key prefix:

spec:
bootstrap:
recovery:
source: prod-cluster
backupID: "" # empty = latest completed
recoveryTarget:
targetGTID: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:1-500"
externalClusters:
- name: prod-cluster
objectStore:
bucket: cnmsql-backups
path: production
endpoint: http://minio.minio.svc:9000
credentials:
accessKeyId:
name: minio-creds
key: accessKey
secretAccessKey:
name: minio-creds
key: secretKey

recovery.backup and recovery.source are mutually exclusive. backupID is only meaningful with source. When empty, the operator selects the latest completed backup.

recoveryTarget accepts exactly one of targetTime (RFC3339 timestamp), targetGTID (inclusive GTID set), or targetImmediate (stop as soon as the base backup is consistent). An empty recoveryTarget: {} replays to the latest archived point. No recoveryTarget restores the base backup only.

Managed services​

spec:
managed:
services:
disabledDefaultServices:
- ro
template:
metadata:
labels:
app.kubernetes.io/part-of: my-app
spec:
type: LoadBalancer
additional:
- name: mysql-lb
selectorType: rw
serviceTemplate:
spec:
type: LoadBalancer

disabledDefaultServices accepts ro and r. The rw service cannot be disabled. template is merged onto each default rw/ro/r service. additional services are rendered as `<cluster>-<name>`.

Managed roles​

spec.managed.roles declares MySQL users the operator reconciles on the primary. When passwordSecret is omitted, the operator generates a password and stores it in a Secret named `<cluster>-<roleName>` (key password).

spec:
managed:
roles:
- name: app
host: "%"
ensure: present
passwordSecret:
name: app-credentials
key: password
requireTLS: x509
maxUserConnections: 50
privileges:
- privileges: [SELECT, INSERT, UPDATE, DELETE]
"on": app.*
- name: readonly
ensure: present
privileges:
- privileges: [SELECT]
"on": app.*
- name: legacy
ensure: absent

Quote the on key ("on": app.*). Unquoted, YAML parses on as boolean true and the API server rejects the manifest.

Users present in MySQL but not declared in spec.managed.roles are left untouched. To remove one, declare it with ensure: absent. Reconciliation runs after the cluster reaches Ready.

External clusters​

externalClusters defines named external sources for replica or raw object-store recovery flows:

spec:
externalClusters:
- name: source-cluster
connectionParameters:
host: mysql.example.com
port: "3306"
password:
name: source-creds
key: password
objectStore:
bucket: source-backups
path: production
credentials:
inheritFromIAMRole: true

Cluster​

Cluster is the Schema for the clusters API.

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 has the same spec.images shape as ImageCatalog, but is cluster-scoped and can be reused across namespaces. Short name: myclusterimagecatalog

Example:

apiVersion: mysql.cnmsql.co/v1alpha1
kind: ClusterImageCatalog
metadata:
name: global-percona-images
spec:
images:
- series: "8.4"
image: ghcr.io/cnmsql/cnmsql-instance:8.4
- series: "9.0"
image: ghcr.io/cnmsql/cnmsql-instance:9.x

Reference it from a Cluster with imageCatalogRef using kind: ClusterImageCatalog.

ClusterImageCatalog is the Schema for the clusterimagecatalogs API (cluster-scoped).

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: {}
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.
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.
Minimum: 0
Optional: {}
mysql MySQLConfigurationMySQL holds the engine configuration (my.cnf parameters, replication
options).
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: {}
enablePrimaryLease booleanEnablePrimaryLease, when true (default), makes the acting primary hold a
per-cluster Lease before accepting writes.
trueOptional: {}
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: {}
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
instances integerInstances is the total number of instances reported.Optional: {}
readyInstances integerReadyInstances is the number of ready instances.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 stringCurrentPrimaryTimestamp is when the current primary was elected.Optional: {}
targetPrimaryTimestamp stringTargetPrimaryTimestamp 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 stringPrimaryFailingSince 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: {}
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: {}
gtidExecutedByInstance object (keys:string, values:string)GTIDExecutedByInstance maps an instance name to its gtid_executed set.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: {}
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: {}
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, quorum, effective
communication protocol, and the last finalized protocol target. Nil for
async clusters.
Optional: {}

GroupReplicationStatus​

GroupReplicationStatus is the operator's cross-validated view of a Group Replication group.

Appears in:

FieldDescriptionDefaultValidation
groupName stringPinned group_replication_group_name.Optional: {}
bootstrapped booleanRecords that the group has been created at least once.Optional: {}
primaryMember stringPod name of the member elected PRIMARY.Optional: {}
members GroupMember arrayCross-validated per-member group view.Optional: {}
hasQuorum booleanWhether a majority of configured members is ONLINE and reachable.
observedViewMax integerLargest group view size observed, used for quorum calculations.Optional: {}
observedOnlineMax integerLargest number of ONLINE members observed.Optional: {}
viewId stringCurrent Group Replication view identifier.Optional: {}
communicationProtocol stringEffective minimum-compatible protocol reported by
group_replication_get_communication_protocol(). This can differ from the
server version passed to the setter; MySQL 8.4 reports 8.0.27.
Optional: {}
communicationProtocolTarget stringMySQL server version most recently passed successfully to
group_replication_set_communication_protocol(). Used as the idempotency
marker for post-upgrade finalization.
Optional: {}

GroupMember​

GroupMember is one member's state within the Group Replication group.

Appears in:

FieldDescriptionDefaultValidation
instance stringPod name of the member.Required: {}
state stringGroup state: ONLINE, RECOVERING, OFFLINE, ERROR, or UNREACHABLE.Required: {}
role stringGroup role: PRIMARY or SECONDARY.Required: {}
reachable booleanWhether the group currently considers the member reachable.Required: {}

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 the conservative backstop after which mysqld may
expire a binary log, applied under the active purge gate. Defaults to
604800 (7 days).
604800Minimum: 0
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: {}
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 stringLastArchivedTime 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 stringOptional: {}

Database​

Database is a namespaced CRD (short name mydatabase) that declares a MySQL schema and the accounts scoped to it. It references a Cluster in the same namespace, which makes it the unit you delegate to tenant teams. The controller diffs the spec against the live server and issues the minimal SQL to converge; nothing is dropped unless you ask for it.

Example:

apiVersion: mysql.cnmsql.co/v1alpha1
kind: Database
metadata:
name: tenant-a
namespace: shared # must match the Cluster's namespace
spec:
cluster:
name: shared
name: tenant_a # the MySQL schema; defaults to the resource name
ensure: present
characterSet: utf8mb4
collation: utf8mb4_0900_ai_ci
reclaimPolicy: retain
users:
- name: tenant_a_app
host: "%"
ensure: present
passwordSecret:
name: tenant-a-db
key: password
grants:
- privileges: [SELECT, INSERT, UPDATE, DELETE]
# `on` defaults to the managed schema (tenant_a.*)

Database is the Schema for the databases API.

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 is the Schema for the databaseusers API. It owns a single, installation-wide MySQL account (name@host) and its grants, not scoped to a single Database.

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

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: {}
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. +kubebuilder:validation:Enum=present;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: {}

ImageCatalog​

ImageCatalog is a namespaced mapping from MySQL series to instance image. Short name: myimagecatalog

Example:

apiVersion: mysql.cnmsql.co/v1alpha1
kind: ImageCatalog
metadata:
name: percona-images
spec:
images:
- series: "8.4"
image: ghcr.io/cnmsql/cnmsql-instance:8.4
- series: "9.0"
image: ghcr.io/cnmsql/cnmsql-instance:9.x

Each series value can appear at most once in the images list (minimum one, maximum eight).

ImageCatalog is the Schema for the imagecatalogs API (namespaced).

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.0").
Pattern: ^[0-9]+\.[0-9]+$
Required: {}

ImageCatalogSpec​

ImageCatalogSpec is the shared spec for ImageCatalog and ClusterImageCatalog.

Appears in:

FieldDescriptionDefaultValidation
images CatalogImage arrayImages is the list of MySQL series to container image mappings. Each
series must appear at most once.
MaxItems: 8
MinItems: 1

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: {}

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: {}

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: {}
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. +kubebuilder:validation:Enum=switchover;restart

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. +kubebuilder:validation:Enum=unsupervised;supervised

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: {}

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.
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 (e.g. "AES256" or "aws:kms").Optional: {}
storageClass stringStorageClass sets the object storage class (e.g. "STANDARD_IA").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. +kubebuilder:validation:Enum=s3v4;s3v2

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 is a namespaced cron scheduler that creates Backup objects. Short name: myscheduledbackup

Example:

apiVersion: mysql.cnmsql.co/v1alpha1
kind: ScheduledBackup
metadata:
name: cluster-sample-daily
spec:
schedule: "0 0 2 * * *"
cluster:
name: cluster-sample
immediate: true
backupOwnerReference: self
method: xtrabackup
target: prefer-standby
online: true
reclaimPolicy: Retain

schedule uses six-field cron format: second minute hour day-of-month month day-of-week.

Generated Backups are labelled with mysql.cnmsql.co/scheduled-backup=<name> and immediate Backups also carry mysql.cnmsql.co/immediate-backup=true.

Set reclaimPolicy: Delete to have generated Backups inherit that policy; the Backup controller then stamps the mysql.cnmsql.co/cleanup-backup-files finalizer so deleting a generated Backup also removes its archive from the object store. It defaults to Retain.

ScheduledBackup is the Schema for the scheduledbackups API.

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 (backup.xbstream +
metadata.json) 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]
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: {}
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.
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. +kubebuilder:validation:Enum=rw;ro;r

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. +kubebuilder:validation:Enum=patch;replace

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 booleanWhen true (the default), grows mounted PVCs in place and relies on the backend to expand the filesystem online. Set 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: {}

Shared Types​

S3ObjectStore​

S3ObjectStore appears in Cluster.spec.backup.objectStore, Backup.spec.objectStore, and Cluster.spec.externalClusters[].objectStore. All fields are documented in the generated table above under S3ObjectStore.

Common Conditions​

CNMSQL - CloudNative for MySQL resources use Kubernetes metav1.Condition entries. Common condition types:

ConditionMeaning
ReadyResource is fully functional.
ProgressingResource is being created, updated, backed up, restored, or changed.
DegradedResource failed to reach or maintain the desired state.