You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/mariadb-enterprise-operator/api-reference.md
+25-6Lines changed: 25 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,7 +173,7 @@ _Appears in:_
173
173
|`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. |||
174
174
|`databases`_string array_| Databases defines the logical databases to be backed up. If not provided, all databases are backed up. |||
175
175
|`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. |||
176
-
|`logLevel`_string_| LogLevel to be used n the Backup Job. It defaults to 'info'. | info ||
176
+
|`logLevel`_string_| LogLevel to be used in the Backup Job. It defaults to 'info'. | info |Enum: [debug info warn error dpanic panic fatal] <br />|
177
177
|`backoffLimit`_integer_| BackoffLimit defines the maximum number of attempts to successfully take a Backup. |||
178
178
|`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 /> |
179
179
|`inheritMetadata`_[Metadata](#metadata)_| InheritMetadata defines the metadata to be inherited by children resources. |||
@@ -1316,8 +1316,8 @@ _Appears in:_
1316
1316
|`database`_string_| Database is the name of the initial Database. |||
1317
1317
|`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. |||
1318
1318
|`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. |||
1319
-
|`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/.|||
1320
-
|`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/.|||
1319
+
|`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.|||
1320
+
|`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.|||
1321
1321
|`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. |||
1322
1322
|`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. |||
1323
1323
|`timeZone`_string_| TimeZone sets the default timezone. If not provided, it defaults to SYSTEM and the timezone data is not loaded. |||
@@ -2001,6 +2001,7 @@ _Appears in:_
2001
2001
|`tolerations`_[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#toleration-v1-core) array_| Tolerations to be used in the Pod. |||
2002
2002
|`priorityClassName`_string_| PriorityClassName to be used in the Pod. |||
2003
2003
|`mariaDbRef`_[MariaDBRef](#mariadbref)_| MariaDBRef is a reference to a MariaDB object. || Required: \{\} <br /> |
2004
+
|`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 /> |
2004
2005
|`compression`_[CompressAlgorithm](#compressalgorithm)_| Compression algorithm to be used in the Backup. || Enum: [none bzip2 gzip] <br /> |
2005
2006
|`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. |||
2006
2007
|`storage`_[PhysicalBackupStorage](#physicalbackupstorage)_| Storage defines the final storage for backups. || Required: \{\} <br /> |
@@ -2012,6 +2013,7 @@ _Appears in:_
2012
2013
|`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 /> |
2013
2014
|`inheritMetadata`_[Metadata](#metadata)_| InheritMetadata defines the metadata to be inherited by children resources. |||
2014
2015
|`successfulJobsHistoryLimit`_integer_| SuccessfulJobsHistoryLimit defines the maximum number of successful Jobs to be displayed. It defaults to 5. || Minimum: 0 <br /> |
2016
+
|`logLevel`_string_| LogLevel to be used in the PhysicalBackup Job. It defaults to 'info'. | info | Enum: [debug info warn error dpanic panic fatal] <br /> |
2015
2017
2016
2018
2017
2019
#### PhysicalBackupStorage
@@ -2033,6 +2035,23 @@ _Appears in:_
2033
2035
|`volumeSnapshot`_[PhysicalBackupVolumeSnapshot](#physicalbackupvolumesnapshot)_| VolumeSnapshot is a Kubernetes VolumeSnapshot specification. |||
2034
2036
2035
2037
2038
+
#### PhysicalBackupTarget
2039
+
2040
+
_Underlying type:__string_
2041
+
2042
+
PhysicalBackupTarget defines in which Pod the physical backups will be taken.
2043
+
2044
+
2045
+
2046
+
_Appears in:_
2047
+
-[PhysicalBackupSpec](#physicalbackupspec)
2048
+
2049
+
| Field | Description |
2050
+
| --- | --- |
2051
+
|`Replica`| PhysicalBackupTargetReplica indicates that the physical backup will be taken in a ready replica.<br /> |
2052
+
|`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 /> |
2053
+
2054
+
2036
2055
#### PhysicalBackupVolumeSnapshot
2037
2056
2038
2057
@@ -2473,7 +2492,7 @@ _Appears in:_
2473
2492
|`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. |||
2474
2493
|`mariaDbRef`_[MariaDBRef](#mariadbref)_| MariaDBRef is a reference to a MariaDB object. || Required: \{\} <br /> |
2475
2494
|`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. |||
2476
-
|`logLevel`_string_| LogLevel to be used n the Backup Job. It defaults to 'info'. | info ||
2495
+
|`logLevel`_string_| LogLevel to be used n the Backup Job. It defaults to 'info'. | info |Enum: [debug info warn error dpanic panic fatal] <br />|
2477
2496
|`backoffLimit`_integer_| BackoffLimit defines the maximum number of attempts to successfully perform a Backup. | 5 ||
2478
2497
|`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 /> |
2479
2498
|`inheritMetadata`_[Metadata](#metadata)_| InheritMetadata defines the metadata to be inherited by children resources. |||
@@ -3092,8 +3111,8 @@ _Appears in:_
3092
3111
|`cleanupPolicy`_[CleanupPolicy](#cleanuppolicy)_| CleanupPolicy defines the behavior for cleaning up a SQL resource. || Enum: [Skip Delete] <br /> |
3093
3112
|`mariaDbRef`_[MariaDBRef](#mariadbref)_| MariaDBRef is a reference to a MariaDB object. || Required: \{\} <br /> |
3094
3113
|`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. |||
3095
-
|`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/.|||
3096
-
|`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/.|||
3114
+
|`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.|||
3115
+
|`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.|||
3097
3116
|`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.|||
3098
3117
|`maxUserConnections`_integer_| MaxUserConnections defines the maximum number of simultaneous connections that the User can establish. | 10 ||
3099
3118
|`name`_string_| Name overrides the default name provided by metadata.name. || MaxLength: 80 <br /> |
Copy file name to clipboardExpand all lines: tools/mariadb-enterprise-operator/backup-and-restore/physical_backup.md
+43-4Lines changed: 43 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,16 +75,19 @@ metadata:
75
75
spec:
76
76
mariaDbRef:
77
77
name: mariadb
78
+
waitForIt: true
78
79
schedule:
79
80
cron: "*/1 * * * *"
80
81
suspend: false
81
82
immediate: true
82
83
```
83
84
84
-
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.
85
+
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.
85
86
86
87
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.
87
88
89
+
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.
90
+
88
91
## Compression
89
92
90
93
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:
@@ -122,9 +125,30 @@ spec:
122
125
maxRetention: 720h # 30 days
123
126
```
124
127
125
-
When using physical backups based on `mariadb-backup`, the operator will automatically delete backups files in the specified storage older than the retention period.
128
+
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.
129
+
130
+
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.
131
+
132
+
## Target policy
133
+
134
+
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:
135
+
136
+
```yaml
137
+
apiVersion: enterprise.mariadb.com/v1alpha1
138
+
kind: PhysicalBackup
139
+
metadata:
140
+
name: physicalbackup
141
+
spec:
142
+
mariaDbRef:
143
+
name: mariadb
144
+
target: Replica
145
+
```
126
146
127
-
When using `VolumeSnapshots`, the operator will automatically delete the `VolumeSnapshot` resources older than the retention period using the Kubernetes API.
147
+
The following target policies are available:
148
+
- `Replica`: The backup will be taken in a ready replica. If no ready replicas are available, the backup will not be scheduled.
149
+
- `PreferReplica`: The backup will be taken in a ready replica if available, otherwise it will be taken in the primary `Pod`.
150
+
151
+
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.
128
152
129
153
## Restoration
130
154
@@ -217,7 +241,22 @@ spec:
217
241
timeout: 2h
218
242
```
219
243
220
-
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.
244
+
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.
245
+
246
+
## Log level
247
+
248
+
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:
Copy file name to clipboardExpand all lines: tools/mariadb-enterprise-operator/installation/helm.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Configure your [customer credentials as described in the documentation](../custo
8
8
9
9
## Charts
10
10
11
-
MariaDB Enterprise Kubernetes Operator is splitted into two different helm charts for better convenience:
11
+
MariaDB Enterprise Kubernetes Operator is split into two different helm charts for better convenience:
12
12
13
13
*`mariadb-enterprise-operator-crds`: Bundles the [CustomResourceDefinitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) required by the operator.
14
14
*`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.
0 commit comments