Make on-demand backup¶
-
To make an on-demand backup, you should first check your Custom Resource for the necessary options and make changes, if needed, using the
deploy/cr.yaml
configuration file. Thebackup.storages
subsection should contain at least one configured storage.You can apply changes in the
deploy/cr.yaml
file with the usualkubectl apply -f deploy/cr.yaml
command. -
Now use a special backup configuration YAML file with the following keys:
-
metadata.name
key should be set to the backup name (this name will be needed later to restore the backup), -
spec.pxcCluster
key should be set to the name of your cluster, -
spec.storageName
key should be set to the name of your already configured storage. -
optionally you can set the
metadata.finalizers.delete-s3-backup
key (it triggers the actual deletion of backup files from the S3 bucket or azure container when there is a manual or scheduled removal of the corresponding backup object).
You can find the example of such file in deploy/backup/backup.yaml :
apiVersion: pxc.percona.com/v1 kind: PerconaXtraDBClusterBackup metadata: finalizers: - delete-s3-backup name: backup1 spec: pxcCluster: cluster1 storageName: fs-pvc
-
-
Run the actual backup command using this file:
$ kubectl apply -f deploy/backup/backup.yaml
-
Track the backup process by checking the status of the Backup object:
$ kubectl get pxc-backup -w
The
-w
flag instructs the Operator to provide real-time updates about the backup progress. The Succeeded status indicates that a backup is completed.