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
K8SPXC-1431 Fixed example configuration and finalizer description in the on-demand backup doc (#274)
K8SPXC-1431 Fixed example configuration and finalizer description in the on-demand backup doc
Added PXC Backup and Restore Custom Resource options reference doc to align this doc set with the rest of the Operators
A Backup resource is a Kubernetes object that tells the Operator how
4
+
to backup your database. The [deploy/backup/backup.yaml :octicons-link-external-16:](https://github.com/percona/percona-xtradb-cluster-operator/blob/main/deploy/backup/backup.yaml) file is a template for creating backup resources.
5
+
6
+
It defines the `PerconaXtraDBClusterBackup` resource.
7
+
8
+
This document describes all available options that you can use to customize a backup.
9
+
10
+
## `apiVersion`
11
+
12
+
Specifies the API version of the Custom Resource.
13
+
`pxc.percona.com` indicates the group, and `v1` is the version of the API.
14
+
15
+
## `kind`
16
+
17
+
Defines the type of resource being created: `PerconaXtraDBClusterBackup`.
18
+
19
+
## `metadata`
20
+
21
+
The metadata part contains the following keys:
22
+
23
+
* <aname="backup-metadata-name"></a> `name` sets the name of your backup resource;
24
+
*`finalizers` subsection:
25
+
26
+
*`percona.com/delete-backup` if present, enables deletion of backup files from a backup storage when the backup object is removed (manually or by schedule). When used with the Persistent Volume as the backup storage, the finalizer deletes the PVC.
27
+
28
+
## `spec` section
29
+
30
+
The toplevel spec elements of the [deploy/backup/backup.yaml :octicons-link-external-16:](https://github.com/percona/percona-xtradb-cluster-operator/blob/main/deploy/backup/backup.yaml) are the following ones:
31
+
32
+
### `pxcCluster`
33
+
34
+
The name of the Percona XtraDB Cluster to back up.
35
+
36
+
| Value type | Example |
37
+
| ----------- | ---------- |
38
+
| :material-code-string: string |`cluster1`|
39
+
40
+
### `storageName`
41
+
42
+
The name of the storage configuration defined in your `deploy/cr.yaml` file in the `spec.backup.storages` subsection.
43
+
44
+
| Value type | Example |
45
+
| ----------- | ---------- |
46
+
| :material-code-string: string |`fs-pvc`|
47
+
48
+
### `activeDeadlineSeconds`
49
+
50
+
The timeout value in seconds, after which backup job will automatically fail.
51
+
52
+
| Value type | Example |
53
+
| ----------- | ---------- |
54
+
| :material-numeric-1-box: int |`3600`|
55
+
56
+
### `startingDeadlineSeconds`
57
+
58
+
The maximum time in seconds for a backup to reach the Starting state. The Operator compares the timestamp of the backup object against the current time. If the backup is not started within the set time, the Operator automatically marks it as "failed".
59
+
60
+
| Value type | Example |
61
+
| ----------- | ---------- |
62
+
| :material-numeric-1-box: int |`300`|
63
+
64
+
### `suspendedDeadlineSeconds`
65
+
66
+
The maximum time in seconds for a backup to remain in a suspended state. The Operator compares the timestamp when the backup job was suspended against the current time. After the defined suspension time expires, the backup is automatically marked as "failed".
67
+
68
+
| Value type | Example |
69
+
| ----------- | ---------- |
70
+
| :material-numeric-1-box: int |`1200`|
71
+
72
+
### `runningDeadlineSeconds`
73
+
74
+
The maximum time in seconds for a backup job to reach the Running state. The Operator compares the timestamp when the backup job started running against the current time. After the defined running time expires, the backup is automatically marked as "failed".
75
+
76
+
| Value type | Example |
77
+
| ----------- | ---------- |
78
+
| :material-numeric-1-box: int |`300`|
79
+
80
+
### `containerOptions.env`
81
+
82
+
The [environment variables set as key-value pairs :octicons-link-external-16:](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/) for the backup container.
Custom [command line options :octicons-link-external-16:](https://docs.percona.com/percona-xtrabackup/8.0/xbcloud-options.html) for the `xbcloud` Percona XtraBackup tool.
Custom [command line options :octicons-link-external-16:](https://docs.percona.com/percona-xtrabackup/8.0/xbstream-options.html) for the `xbstream` Percona XtraBackup tool.
1. To make an on-demand backup, you should first check your Custom Resource for
4
-
the necessary options and make changes, if needed, using the
5
-
`deploy/cr.yaml` configuration file. The `backup.storages` subsection should
6
-
contain at least one [configured storage](backups-storage.md).
3
+
## Before you begin
7
4
8
-
You can apply changes in the `deploy/cr.yaml` file with the usual
9
-
`kubectl apply -f deploy/cr.yaml` command.
5
+
1. Export the namespace as an environment variable. Replace the `<namespace>` placeholder with your value:
10
6
11
-
2. Now use *a special backup configuration YAML file* with the following
12
-
keys:
7
+
```bash
8
+
export NAMESPACE=<namespace>
9
+
```
10
+
11
+
2. Check the configuration of the `PerconaXtraDBCluster` Custom Resource. Verify that you have [configured backup storage](backups-storage.md) and specified its configuration in the `backup.storages` subsection of the Custom Resource.
13
12
14
-
*`metadata.name` key should be set to the **backup name**
15
-
(this name will be needed later to [restore the backup](backups-restore.md)),
13
+
## Backup steps
16
14
17
-
*`spec.pxcCluster` key should be set to the name of your cluster,
15
+
To make an on-demand backup, use
16
+
*a special backup configuration YAML file*. The example of such file is
*`spec.storageName` key should be set to the name of your [already configured storage](backups-storage.md).
19
+
1. Specify the following keys
20
20
21
-
*optionally you can set the `metadata.finalizers.delete-s3-backup` key (it
22
-
triggers the actual deletion of backup files from the S3 bucket or azure
23
-
container when there is a manual or scheduled removal of the
24
-
corresponding backup object).
21
+
*Set the `metadata.name` key to assign a name to the backup. You will use it to make a [restore](backups-restore.md)
22
+
* Set the `spec.pxcCluster` key to the name of your cluster
23
+
* Set the `spec.storageName` key to a storage configuration defined in your `deploy/cr.yaml` file.
24
+
* Optionally, add the `percona.com/delete-backup` entry under `metadata.finalizers` to enable deletion of backup files from a backup storage when the backup object is removed (manually or by schedule).
3. Track the backup process by checking the status of the Backup object:
42
47
43
48
``` {.bash data-prompt="$" }
44
-
$ kubectl apply -f deploy/backup/backup.yaml
49
+
$ kubectl get pxc-backup -n $NAMESPACE -w
45
50
```
46
51
47
-
4. Track the backup process by checking the status of the Backup object:
52
+
The `-w` flag instructs the Operator to provide real-time updates about the backup progress. The `Succeeded` status indicates that a backup is completed.
48
53
54
+
??? example "Expected output"
55
+
56
+
```{.text .no-copy}
57
+
NAME CLUSTER STORAGE DESTINATION STATUS COMPLETED AGE
4. View detailed information about the backup using the `kubectl describe` command:
62
+
49
63
``` {.bash data-prompt="$" }
50
-
$ kubectl get pxc-backup -w
64
+
$ kubectl describe pxc-backup -n $NAMESPACE
51
65
```
52
66
53
-
The `-w` flag instructs the Operator to provide real-time updates about the backup progress. The Succeeded status indicates that a backup is completed.
67
+
The `Status` section of the output provides useful details about the backup state, the error message in case of issues with the backup, and the storage details.
Set the [Kubernetes Storage Class :octicons-link-external-16:](https://kubernetes.io/docs/concepts/storage/storage-classes/) to use with the Percona XtraDB Cluster backups [PersistentVolumeClaims :octicons-link-external-16:](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims) for the `filesystem` storage type.
2688
2688
@@ -3021,77 +3021,5 @@ Specify the min password length for user passwords
[Percona XtraDB Cluster Restore](backups-restore.md) options are managed by the Operator via the
3027
-
`PerconaXtraDBClusterRestore`[Custom Resource :octicons-link-external-16:](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) and can be configured via the
| requests.memory | string | The [Kubernetes memory requests :octicons-link-external-16:](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the restore job (the specified value is used if memory limits are not set) | false |
3045
-
| requests.cpu | string |[Kubernetes CPU requests :octicons-link-external-16:](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the restore job (the specified value is used if CPU limits are not set) | false |
3046
-
| limits.memory | string | The [Kubernetes memory limits :octicons-link-external-16:](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the restore job (if set, the value will be used for memory requests as well) | false |
3047
-
| limits.cpu | string |[Kubernetes CPU limits :octicons-link-external-16:](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the restore job (if set, the value will be used for CPU requests as well) | false |
| destination | string | Path to the backup | false |
3054
-
| storageName | string | The storage name from CR `spec.backup.storages`| false |
3055
-
| verifyTLS | boolean | Enable or disable verification of the storage server TLS certificate. Disabling it may be useful e.g. to skip TLS verification for private S3-compatible storage with a self-issued certificate | true |
0 commit comments