Making on-demand backups¶
To make an on-demand backup manually, you need a backup configuration file. You can use the example of the backup configuration file deploy/backup.yaml :
apiVersion: pgv2.percona.com/v2
kind: PerconaPGBackup
metadata:
name: backup1
spec:
pgCluster: cluster1
repoName: repo1
# options:
# - --type=full
Here’s a sequence of steps to follow:
- Before you start, make sure you have configured a backup storage.
- In the
deploy/backup.yamlconfiguration file, specify the cluster name and the repository name to be used for backups. The repository name must be the same as the one you defined in the backup storage configuration. It must also match the repository name specified in thebackups.pgbackrest.manualsubsection of thedeploy/cr.yamlfile. -
If needed, you can add any pgBackRest command line options .
-
Make a backup with the following command (modify the
-n postgres-operatorparameter if your database cluster resides in a different namespace):kubectl apply -f deploy/backup.yaml -n postgres-operatorExpected output
perconapgbackup.pgv2.percona.com/backup1 created -
Making a backup takes time. Use the
kubectl get pg-backupcommand to track the backup progress. When finished, backup should obtain theSucceededstatus:kubectl get pg-backup backup1 -n postgres-operatorExpected output
NAME CLUSTER REPO DESTINATION STATUS TYPE COMPLETED AGE backup1 cluster1 repo1 Succeeded incr 3m38s 3m53s
Tip
To list available backups, run:
kubectl get pg-backup -n postgres-operator
Next steps¶
Useful links¶
Last update:
February 19, 2026
Created: July 4, 2023
Created: July 4, 2023