Skip to main content
PGO integrates pgBackRest as its backup and WAL archiving engine. pgBackRest handles full, incremental, and differential backup types; continuous WAL archiving for point-in-time recovery; and restore operations including bootstrapping new clusters from existing backups. Up to four repositories (repo1–repo4) can be configured simultaneously, letting you combine storage backends for redundancy.

Backup types

pgBackRest supports three backup types. All three are available through the schedules field of each repository.

Backup to a local PVC volume

Local volume repositories are the simplest option. The operator deploys a dedicated repository host pod that manages the backup storage.
Size the backup PVC generously. A good starting point is 2× the data volume for a cluster that runs weekly full backups and daily incrementals.

Backup to object storage

Create a Kubernetes Secret with your AWS credentials, then reference the S3 bucket, endpoint, and region in the repo spec.
For S3-compatible endpoints (MinIO, Ceph, Backblaze B2), set endpoint to your compatible storage URL and add repo1-s3-uri-style: path in global if path-style URLs are required.

Multiple repositories

Configuring multiple repos provides redundancy and lets you combine storage backends. For example, keep a fast local volume for quick restores and an S3 repo for off-site retention.
At minimum, keep one off-site repository. A local-only backup cannot protect against storage volume loss or cluster-wide disasters.

Scheduled backups

Set a cron schedule on each repo to automate full, differential, and incremental backups. Schedules follow standard Kubernetes cron syntax.
The operator creates a Kubernetes CronJob for each schedule. Inspect them with:

Trigger a manual backup

Annotate the PostgresCluster with postgres-operator.crunchydata.com/pgbackrest-backup and specify the target repo in spec.backups.pgbackrest.manual.
1

Add the manual backup spec

2

Annotate to trigger the backup

The annotation value must be unique each time you want to trigger a new backup. Use a timestamp or a meaningful label.
3

Monitor backup progress

Global pgBackRest configuration

spec.backups.pgbackrest.global maps directly to pgBackRest’s [global] configuration section. Use it to set retention policies, compression, and process counts.

Resource limits for backup jobs

Set CPU and memory limits on backup job pods through spec.backups.pgbackrest.jobs.resources. This prevents backup jobs from starving the primary during heavy backup windows.

Check backup status

Disaster recovery

Restore from a pgBackRest backup and perform point-in-time recovery.

High availability

Configure Patroni-managed failover alongside your backup strategy.

Create a cluster

Build the base PostgresCluster spec with instances and storage.

Custom Resource Reference

Full field reference for spec.backups.pgbackrest.