Skip to content

Make on-demand backup

  1. 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. The backup.storages subsection should contain at least one configured storage.

    You can apply changes in the deploy/cr.yaml file with the usual kubectl apply -f deploy/cr.yaml command.

  2. 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 bakup),

    • 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
    
  3. Run the actual backup command using this file:

    $ kubectl apply -f deploy/backup/backup.yaml
    

Get expert help

If you need assistance, visit the community forum for comprehensive and free database knowledge, or contact our Percona Database Experts for professional support and services. Join K8S Squad to benefit from early access to features and “ask me anything” sessions with the Experts.


Last update: 2024-10-16