Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions tools/mariadb-enterprise-operator/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ _Appears in:_
| `maxRetention` _[Duration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#duration-v1-meta)_ | MaxRetention defines the retention policy for backups. Old backups will be cleaned up by the Backup Job.<br />It defaults to 30 days. | | |
| `databases` _string array_ | Databases defines the logical databases to be backed up. If not provided, all databases are backed up. | | |
| `ignoreGlobalPriv` _boolean_ | IgnoreGlobalPriv indicates to ignore the mysql.global_priv in backups.<br />If not provided, it will default to true when the referred MariaDB instance has Galera enabled and otherwise to false. | | |
| `logLevel` _string_ | LogLevel to be used n the Backup Job. It defaults to 'info'. | info | |
| `logLevel` _string_ | LogLevel to be used in the Backup Job. It defaults to 'info'. | info | Enum: [debug info warn error dpanic panic fatal] <br /> |
| `backoffLimit` _integer_ | BackoffLimit defines the maximum number of attempts to successfully take a Backup. | | |
| `restartPolicy` _[RestartPolicy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#restartpolicy-v1-core)_ | RestartPolicy to be added to the Backup Pod. | OnFailure | Enum: [Always OnFailure Never] <br /> |
| `inheritMetadata` _[Metadata](#metadata)_ | InheritMetadata defines the metadata to be inherited by children resources. | | |
Expand Down Expand Up @@ -1316,8 +1316,8 @@ _Appears in:_
| `database` _string_ | Database is the name of the initial Database. | | |
| `username` _string_ | Username is the initial username to be created by the operator once MariaDB is ready.<br />The initial User will have ALL PRIVILEGES in the initial Database. | | |
| `passwordSecretKeyRef` _[GeneratedSecretKeyRef](#generatedsecretkeyref)_ | PasswordSecretKeyRef is a reference to a Secret that contains the password to be used by the initial User.<br />If the referred Secret is labeled with "enterprise.mariadb.com/watch", updates may be performed to the Secret in order to update the password. | | |
| `passwordHashSecretKeyRef` _[SecretKeySelector](#secretkeyselector)_ | PasswordHashSecretKeyRef is a reference to the password hash to be used by the initial User.<br />If the referred Secret is labeled with "enterprise.mariadb.com/watch", updates may be performed to the Secret in order to update the password hash.<br />It requires the 'skip-strict-password-validation' option to be set. See: https://mariadb.com/docs/server/ref/mdb/cli/mariadbd/strict-password-validation/. | | |
| `passwordPlugin` _[PasswordPlugin](#passwordplugin)_ | PasswordPlugin is a reference to the password plugin and arguments to be used by the initial User.<br />It requires the 'skip-strict-password-validation' option to be set. See: https://mariadb.com/docs/server/ref/mdb/cli/mariadbd/strict-password-validation/. | | |
| `passwordHashSecretKeyRef` _[SecretKeySelector](#secretkeyselector)_ | PasswordHashSecretKeyRef is a reference to the password hash to be used by the initial User.<br />If the referred Secret is labeled with "enterprise.mariadb.com/watch", updates may be performed to the Secret in order to update the password hash.<br />It requires the 'strict-password-validation=false' option to be set. See: https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#strict_password_validation. | | |
| `passwordPlugin` _[PasswordPlugin](#passwordplugin)_ | PasswordPlugin is a reference to the password plugin and arguments to be used by the initial User.<br />It requires the 'strict-password-validation=false' option to be set. See: https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#strict_password_validation. | | |
| `myCnf` _string_ | MyCnf allows to specify the my.cnf file mounted by Mariadb.<br />Updating this field will trigger an update to the Mariadb resource. | | |
| `myCnfConfigMapKeyRef` _[ConfigMapKeySelector](#configmapkeyselector)_ | MyCnfConfigMapKeyRef is a reference to the my.cnf config file provided via a ConfigMap.<br />If not provided, it will be defaulted with a reference to a ConfigMap containing the MyCnf field.<br />If the referred ConfigMap is labeled with "enterprise.mariadb.com/watch", an update to the Mariadb resource will be triggered when the ConfigMap is updated. | | |
| `timeZone` _string_ | TimeZone sets the default timezone. If not provided, it defaults to SYSTEM and the timezone data is not loaded. | | |
Expand Down Expand Up @@ -2001,6 +2001,7 @@ _Appears in:_
| `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#toleration-v1-core) array_ | Tolerations to be used in the Pod. | | |
| `priorityClassName` _string_ | PriorityClassName to be used in the Pod. | | |
| `mariaDbRef` _[MariaDBRef](#mariadbref)_ | MariaDBRef is a reference to a MariaDB object. | | Required: \{\} <br /> |
| `target` _[PhysicalBackupTarget](#physicalbackuptarget)_ | Target defines in which Pod the physical backups will be taken. It defaults to "Replica", meaning that the physical backups will only be taken in ready replicas. | | Enum: [Replica PreferReplica] <br /> |
| `compression` _[CompressAlgorithm](#compressalgorithm)_ | Compression algorithm to be used in the Backup. | | Enum: [none bzip2 gzip] <br /> |
| `stagingStorage` _[BackupStagingStorage](#backupstagingstorage)_ | StagingStorage defines the temporary storage used to keep external backups (i.e. S3) while they are being processed.<br />It defaults to an emptyDir volume, meaning that the backups will be temporarily stored in the node where the PhysicalBackup Job is scheduled.<br />The staging area gets cleaned up after each backup is completed, consider this for sizing it appropriately. | | |
| `storage` _[PhysicalBackupStorage](#physicalbackupstorage)_ | Storage defines the final storage for backups. | | Required: \{\} <br /> |
Expand All @@ -2012,6 +2013,7 @@ _Appears in:_
| `restartPolicy` _[RestartPolicy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#restartpolicy-v1-core)_ | RestartPolicy to be added to the PhysicalBackup Pod. | OnFailure | Enum: [Always OnFailure Never] <br /> |
| `inheritMetadata` _[Metadata](#metadata)_ | InheritMetadata defines the metadata to be inherited by children resources. | | |
| `successfulJobsHistoryLimit` _integer_ | SuccessfulJobsHistoryLimit defines the maximum number of successful Jobs to be displayed. It defaults to 5. | | Minimum: 0 <br /> |
| `logLevel` _string_ | LogLevel to be used in the PhysicalBackup Job. It defaults to 'info'. | info | Enum: [debug info warn error dpanic panic fatal] <br /> |


#### PhysicalBackupStorage
Expand All @@ -2033,6 +2035,23 @@ _Appears in:_
| `volumeSnapshot` _[PhysicalBackupVolumeSnapshot](#physicalbackupvolumesnapshot)_ | VolumeSnapshot is a Kubernetes VolumeSnapshot specification. | | |


#### PhysicalBackupTarget

_Underlying type:_ _string_

PhysicalBackupTarget defines in which Pod the physical backups will be taken.



_Appears in:_
- [PhysicalBackupSpec](#physicalbackupspec)

| Field | Description |
| --- | --- |
| `Replica` | PhysicalBackupTargetReplica indicates that the physical backup will be taken in a ready replica.<br /> |
| `PreferReplica` | PhysicalBackupTargetReplica indicates that the physical backup will preferably be taken in a ready replica.<br />If no ready replicas are available, physical backups will be taken in the primary.<br /> |


#### PhysicalBackupVolumeSnapshot


Expand Down Expand Up @@ -2473,7 +2492,7 @@ _Appears in:_
| `stagingStorage` _[BackupStagingStorage](#backupstagingstorage)_ | StagingStorage defines the temporary storage used to keep external backups (i.e. S3) while they are being processed.<br />It defaults to an emptyDir volume, meaning that the backups will be temporarily stored in the node where the Restore Job is scheduled. | | |
| `mariaDbRef` _[MariaDBRef](#mariadbref)_ | MariaDBRef is a reference to a MariaDB object. | | Required: \{\} <br /> |
| `database` _string_ | Database defines the logical database to be restored. If not provided, all databases available in the backup are restored.<br />IMPORTANT: The database must previously exist. | | |
| `logLevel` _string_ | LogLevel to be used n the Backup Job. It defaults to 'info'. | info | |
| `logLevel` _string_ | LogLevel to be used n the Backup Job. It defaults to 'info'. | info | Enum: [debug info warn error dpanic panic fatal] <br /> |
| `backoffLimit` _integer_ | BackoffLimit defines the maximum number of attempts to successfully perform a Backup. | 5 | |
| `restartPolicy` _[RestartPolicy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#restartpolicy-v1-core)_ | RestartPolicy to be added to the Backup Job. | OnFailure | Enum: [Always OnFailure Never] <br /> |
| `inheritMetadata` _[Metadata](#metadata)_ | InheritMetadata defines the metadata to be inherited by children resources. | | |
Expand Down Expand Up @@ -3092,8 +3111,8 @@ _Appears in:_
| `cleanupPolicy` _[CleanupPolicy](#cleanuppolicy)_ | CleanupPolicy defines the behavior for cleaning up a SQL resource. | | Enum: [Skip Delete] <br /> |
| `mariaDbRef` _[MariaDBRef](#mariadbref)_ | MariaDBRef is a reference to a MariaDB object. | | Required: \{\} <br /> |
| `passwordSecretKeyRef` _[SecretKeySelector](#secretkeyselector)_ | PasswordSecretKeyRef is a reference to the password to be used by the User.<br />If not provided, the account will be locked and the password will expire.<br />If the referred Secret is labeled with "enterprise.mariadb.com/watch", updates may be performed to the Secret in order to update the password. | | |
| `passwordHashSecretKeyRef` _[SecretKeySelector](#secretkeyselector)_ | PasswordHashSecretKeyRef is a reference to the password hash to be used by the User.<br />If the referred Secret is labeled with "enterprise.mariadb.com/watch", updates may be performed to the Secret in order to update the password hash.<br />It requires the 'skip-strict-password-validation' option to be set. See: https://mariadb.com/docs/server/ref/mdb/cli/mariadbd/strict-password-validation/. | | |
| `passwordPlugin` _[PasswordPlugin](#passwordplugin)_ | PasswordPlugin is a reference to the password plugin and arguments to be used by the User.<br />It requires the 'skip-strict-password-validation' option to be set. See: https://mariadb.com/docs/server/ref/mdb/cli/mariadbd/strict-password-validation/. | | |
| `passwordHashSecretKeyRef` _[SecretKeySelector](#secretkeyselector)_ | PasswordHashSecretKeyRef is a reference to the password hash to be used by the User.<br />If the referred Secret is labeled with "enterprise.mariadb.com/watch", updates may be performed to the Secret in order to update the password hash.<br />It requires the 'strict-password-validation=false' option to be set. See: https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#strict_password_validation. | | |
| `passwordPlugin` _[PasswordPlugin](#passwordplugin)_ | PasswordPlugin is a reference to the password plugin and arguments to be used by the User.<br />It requires the 'strict-password-validation=false' option to be set. See: https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#strict_password_validation. | | |
| `require` _[TLSRequirements](#tlsrequirements)_ | Require specifies TLS requirements for the user to connect. See: https://mariadb.com/kb/en/securing-connections-for-client-and-server/#requiring-tls. | | |
| `maxUserConnections` _integer_ | MaxUserConnections defines the maximum number of simultaneous connections that the User can establish. | 10 | |
| `name` _string_ | Name overrides the default name provided by metadata.name. | | MaxLength: 80 <br /> |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,19 @@ metadata:
spec:
mariaDbRef:
name: mariadb
waitForIt: true
schedule:
cron: "*/1 * * * *"
suspend: false
immediate: true
```

If you want to immediatly trigger a backup after creating the `PhysicalBackup` resource, you can set the `immediate` field to `true`. This will create a backup immediately, regardless of the schedule.
If you want to immediately trigger a backup after creating the `PhysicalBackup` resource, you can set the `immediate` field to `true`. This will create a backup immediately, regardless of the schedule.

If you want to suspend the schedule, you can set the `suspend` field to `true`. This will prevent any new backups from being created until the `PhysicalBackup` is resumed.

It is very important to note that, by default, backups will only be scheduled if the referred `MariaDB` resource is in ready state. You can override this behavior by setting `mariaDbRef.waitForIt=false` which will allow backups to be scheduled even if the `MariaDB` resource is not ready.

## Compression

When using physical backups based on `mariadb-backup`, you are able to choose the compression algorithm used to compress the backup files. The available options are:
Expand Down Expand Up @@ -122,9 +125,30 @@ spec:
maxRetention: 720h # 30 days
```

When using physical backups based on `mariadb-backup`, the operator will automatically delete backups files in the specified storage older than the retention period.
When using physical backups based on `mariadb-backup`, the operator will automatically delete backups files in the specified storage older than the retention period. The cleanup process will be performed after each successful backup.

When using `VolumeSnapshots`, the operator will automatically delete the `VolumeSnapshot` resources older than the retention period using the Kubernetes API. The cleanup process will be performed after a `VolumeSnapshot` is successfully created.

## Target policy

You can define a target policy both for backups based on `mariadb-backup` and for `VolumeSnapshots`. The target policy allows you to specify in which `Pod` the backup should be taken. This can be defined via the `target` field in the `PhysicalBackup` resource:

```yaml
apiVersion: enterprise.mariadb.com/v1alpha1
kind: PhysicalBackup
metadata:
name: physicalbackup
spec:
mariaDbRef:
name: mariadb
target: Replica
```

When using `VolumeSnapshots`, the operator will automatically delete the `VolumeSnapshot` resources older than the retention period using the Kubernetes API.
The following target policies are available:
- `Replica`: The backup will be taken in a ready replica. If no ready replicas are available, the backup will not be scheduled.
- `PreferReplica`: The backup will be taken in a ready replica if available, otherwise it will be taken in the primary `Pod`.

When using the `PreferReplica` target policy, you may be willing to schedule the backups even if the `MariaDB` resource is not ready. In this case, you can set `mariaDbRef.waitForIt=false` to allow scheduling the backup even if no replicas are available.

## Restoration

Expand Down Expand Up @@ -217,7 +241,22 @@ spec:
timeout: 2h
```

When timed out, the operator will delete the `Jobs` or `VolumeSnapshots` resources associated wit the `PhysicalBackup` resource. The operator will create new `Jobs` or `VolumeSnapshots` to retry the backup operation if the `PhysicalBackup` resource is still scheduled.
When timed out, the operator will delete the `Jobs` or `VolumeSnapshots` resources associated with the `PhysicalBackup` resource. The operator will create new `Jobs` or `VolumeSnapshots` to retry the backup operation if the `PhysicalBackup` resource is still scheduled.

## Log level

When taking backups based on `mariadb-backup`, you can specify the log level to be used by the `mariadb-operator` container using the `logLevel` field in the `PhysicalBackup` resource:

```yaml
apiVersion: enterprise.mariadb.com/v1alpha1
kind: PhysicalBackup
metadata:
name: physicalbackup
spec:
mariaDbRef:
name: mariadb
logLevel: debug
```

## Extra options

Expand Down
4 changes: 2 additions & 2 deletions tools/mariadb-enterprise-operator/docker-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ All the Docker images used by this operator are based on [Red Hat UBI](https://c
MariaDB Enterprise Kubernetes Operator is compatible with the following Docker images:
| Component | Image | Supported Tags | CPU Architecture |
|-----------|-------|----------------|------------------|
| MariaDB Enterprise Kubernetes Operator (ppc64le support) | docker.mariadb.com/mariadb-enterprise-operator | 25.10.2 <br> 25.10.1 <br> 25.10.0 <br> 25.8.0 <br> | amd64 <br> arm64 <br> ppc64le <br> |
| MariaDB Enterprise Kubernetes Operator (ppc64le support) | docker.mariadb.com/mariadb-enterprise-operator | 25.10.3 <br> 25.10.2 <br> 25.10.1 <br> 25.10.0 <br> 25.8.0 <br> | amd64 <br> arm64 <br> ppc64le <br> |
| MariaDB Enterprise Kubernetes Operator | docker.mariadb.com/mariadb-enterprise-operator | 1.0.0 <br> | amd64 <br> arm64 <br> |
| MariaDB Enterprise Server (ppc64le support) | docker.mariadb.com/enterprise-server | 11.8.3-1 <br> 11.4.8-5 <br> 11.4.7-4.3 <br> 11.4.7-4.2 <br> 11.4.7-4.1 <br> 11.4 <br> 10.6.23-19 <br> 10.6.22-18.1 <br> 10.6 <br> | amd64 <br> arm64 <br> ppc64le <br> |
| MariaDB Enterprise Server (ppc64le support) | docker.mariadb.com/enterprise-server | 11.8.5-2 <br> 11.8.3-1 <br> 11.4.8-5 <br> 11.4.7-4.3 <br> 11.4.7-4.2 <br> 11.4.7-4.1 <br> 11.4 <br> 10.6.23-19 <br> 10.6.22-18.1 <br> 10.6 <br> | amd64 <br> arm64 <br> ppc64le <br> |
| MariaDB Enterprise Server | docker.mariadb.com/enterprise-server | 11.4.5-3 <br> 11.4.4-2 <br> 10.6.21-17 <br> 10.6.20-16.1 <br> 10.6.19-15.1 <br> 10.6.18-14.2 <br> 10.6.17-13.2 <br> | amd64 <br> arm64 <br> |
| MaxScale Enterprise (ppc64le support) | docker.mariadb.com/maxscale | 25.10.0 <br> 25.01.4 <br> 25.01.3-1 <br> 25.01 <br> | amd64 <br> arm64 <br> ppc64le <br> |
| MaxScale Enterprise | docker.mariadb.com/maxscale-enterprise | 25.01.2 <br> 25.01.1 <br> | amd64 <br> arm64 <br> |
Expand Down
6 changes: 3 additions & 3 deletions tools/mariadb-enterprise-operator/installation/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Configure your [customer credentials as described in the documentation](../custo

## Charts

MariaDB Enterprise Kubernetes Operator is splitted into two different helm charts for better convenience:
MariaDB Enterprise Kubernetes Operator is split into two different helm charts for better convenience:

* `mariadb-enterprise-operator-crds`: Bundles the [CustomResourceDefinitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) required by the operator.
* `mariadb-enterprise-operator`: Contains all the template manifests required to install the operator. Refer to the [operator helm values](helm.md#operator-helm-values) section for detailed information about the supported values.
Expand Down Expand Up @@ -246,7 +246,7 @@ helm uninstall mariadb-enterprise-operator-crds
| config.exporterMaxscaleImage | string | `"mariadb/maxscale-prometheus-exporter-ubi:1.1.0"` | Default MaxScale exporter image |
| config.galeraLibPath | string | `"/usr/lib64/galera/libgalera_enterprise_smm.so"` | Galera Enterprise library path to be used with Galera |
| config.mariadbDefaultVersion | string | `"11.8"` | Default MariaDB Enterprise version to be used when unable to infer it via image tag |
| config.mariadbImage | string | `"docker.mariadb.com/enterprise-server:11.8.3-1"` | Default MariaDB Enterprise image |
| config.mariadbImage | string | `"docker.mariadb.com/enterprise-server:11.8.5-2"` | Default MariaDB Enterprise image |
| config.mariadbImageName | string | `"docker.mariadb.com/enterprise-server"` | Default MariaDB Enterprise image name |
| config.maxscaleImage | string | `"docker.mariadb.com/maxscale:25.10.0"` | Default MaxScale Enterprise image |
| crds | object | `{"enabled":false}` | CRDs |
Expand Down Expand Up @@ -281,7 +281,7 @@ helm uninstall mariadb-enterprise-operator-crds
| pprof.enabled | bool | `false` | Enable the pprof HTTP server. |
| pprof.port | int | `6060` | The port where the pprof HTTP server listens. |
| priorityClassName | string | `""` | priorityClassName to add to controller Pod |
| rbac.aggregation.enabled | bool | `true` | Specifies whether the cluster roles aggrate to view and edit predefinied roles |
| rbac.aggregation.enabled | bool | `true` | Specifies whether the cluster roles aggregate to view and edit predefinied roles |
| rbac.enabled | bool | `true` | Specifies whether RBAC resources should be created |
| resources | object | `{}` | Resources to add to controller container |
| securityContext | object | `{}` | Security context to add to controller container |
Expand Down
Loading