PostgreSQL backups on Kubernetes start with knowing which backup path your cluster uses
Before you tune schedules or retention, confirm which backup path your CloudNativePG cluster uses. If the cluster still relies on the in-operator Barman Cloud support, that path is deprecated and you should plan a move to the Barman Cloud Plugin. The path you pick decides how backups are declared, where WAL and base backups are written, and how a restore into a new cluster is configured, so it shapes whether you can meet your recovery point and recovery time targets.
CloudNativePG backup combines two things: continuous WAL archiving, which records every change after a base backup, and base backups, which give a starting point for point-in-time recovery. Your recovery point objective depends mostly on how continuously WAL reaches the object store, and your recovery time objective depends on how quickly a base backup can be fetched and replayed. Check in the cluster manifest whether the backup configuration sits under the cluster spec's in-operator backup section or under a plugin reference, and record the object store, credentials and archive settings for each cluster you run.
Confirm the exact field names, supported plugin versions and migration steps against the current CloudNativePG documentation before you change anything, since the deprecation timeline and configuration keys can change between releases. Also confirm whether volume snapshot backups are available for your storage class, because they follow a different restore path. Write down which path each cluster uses today, which one it will use after migration, and who owns the change, so that the restore runbook matches what the cluster actually does.
Which CloudNativePG backup method fits which recovery target
The four options differ in how far back they can restore, how fast a restore runs, and what they need from storage. Most teams combine them: continuous archiving for point-in-time recovery, snapshots for fast instance rebuilds, a schedule that runs them reliably, and logical dumps as an independent copy.
WAL archiving with base backups
This pairs periodic base backups with a continuous stream of archived WAL files sent to an object store through the Barman Cloud Plugin. It is the option that can restore to a chosen moment, such as just before a bad delete, because the archived WAL covers the gap between base backups. Confirm the object store location, credentials, and how long archives are kept. Also confirm how quickly WAL reaches the store, since that sets your recovery point.
Continuous archiving docsVolume snapshot backups
A volume snapshot copies the storage volume that holds the database, so it protects against losing a node, a volume, or a failed upgrade, and it usually restores faster than replaying a base backup. It does not give point-in-time recovery, so changes made after the snapshot are lost unless WAL is also archived. Confirm that your storage class supports consistent snapshots, which system holds the snapshots, and whether they stay in the same storage system as the data.
Scheduled backups
A schedule runs either method on a timetable, so backups do not depend on someone remembering to start them. A schedule protects against gaps in coverage, but it does not prove that any backup can be restored. Confirm the timetable against your recovery point target, how failed runs raise alerts, who owns the schedule during staff changes, and whether retention is enforced automatically or cleaned up by hand.
Logical dumps alongside physical backups
Logical dumps with pg_dump or pg_dumpall store the data as SQL or archive output, which gives you a copy that does not depend on the physical files or the operator. They help with restoring one database, moving data between PostgreSQL major versions, and recovering roles and tablespaces. They do not provide point-in-time recovery, and restores of large databases can be slow. Confirm where the dumps are stored, run them outside the cluster, and time a restore before you rely on them.
Backup options and when each fits
This table compares the configuration choices a team makes for CloudNativePG backups, from target and schedule to retention, encryption and restore path. Read each row for when the option fits, what drives effort, and what to confirm in the operator and Barman Cloud Plugin documentation for the version you run. The main takeaway is that the restore target and retention settings shape recovery time and storage cost more than the backup tool itself.
| Decision | When it fits | What drives cost and effort | What to confirm |
|---|---|---|---|
| Object storage backup target | Teams that want base backups and WAL in a bucket that is independent of the Kubernetes cluster, and that can be placed in another site or account | Bucket region and replication, storage class, egress during restores, and the credential setup that lets the operator write to the bucket | Supported object storage providers and the credential mechanism for the plugin version in use |
| Volume snapshot backup target | Clusters on storage classes that support CSI snapshots, where fast point-in-time copies of volumes are preferred and the snapshot tooling is already governed | Snapshot class behavior, snapshot count and retention on the storage backend, and whether snapshots remain consistent with WAL archiving | Whether snapshot backups are supported for your operator version, and how they are combined with WAL archiving for point-in-time recovery |
| Backup schedule | Daily base backups with continuous WAL archiving are a common starting point when the recovery point objective allows minutes of loss | Base backup duration grows with database size, and frequent base backups add I/O and storage churn on the primary | The schedule syntax and how scheduled backups are defined for the operator version, and whether on-demand backups are needed before changes |
| Retention policy | Teams with audit or legal holding periods that require a defined number of recoverable days and a documented expiry rule | Retained base backups and WAL multiply storage use, and retention that is too short can break point-in-time recovery to older times | How retention is expressed, whether expired backups and WAL are deleted automatically, and what happens to backups in progress |
| WAL archiving and base backup cadence | Environments where the recovery point objective is tight enough that WAL must ship continuously and base backups must be recent enough to keep restores short | WAL volume follows write rate, and long gaps between base backups lengthen replay time at restore | How WAL archiving is configured and monitored, and how the operator reports archive failures |
| Encryption and credential handling | Regulated environments that require encryption of backup data at rest and tightly scoped, rotated credentials for the backup bucket | Key management service integration, credential rotation procedures, and the access reviews needed to prove who can read backups | Supported encryption options for the bucket and plugin, where credentials are stored, and how they are rotated without downtime |
| Restore into a new cluster | Recovery drills, migration to a new cluster, or recovery after a failed cluster where the original resources should stay untouched | Restore time depends on backup size, WAL replay distance and storage performance, and the new cluster needs capacity before the restore starts | The bootstrap or recovery configuration for the version in use, and the target time syntax for point-in-time recovery |
| Restore into the same cluster | Recovery from logical damage on a cluster that is still healthy, when a short rollback is preferred and the existing volumes are safe to replace | Replacing live data carries higher risk, and the old cluster must be stopped or isolated to avoid writes during recovery | Whether in-place recovery is supported, what the operator deletes or preserves, and the runbook steps for stopping application writes |
Moving from the deprecated in-operator Barman Cloud support to the plugin
This sequence moves CloudNativePG clusters from the deprecated in-operator Barman Cloud configuration to the Barman Cloud Plugin without losing WAL archiving or the ability to restore. Each step ends with a check, so the switch is proven before old configuration is removed.
Inventory clusters and their backup configuration
List every CloudNativePG cluster, its operator version, PostgreSQL major version, object storage destination, backup schedule, retention policy and credentials source. Record which clusters use the in-operator Barman Cloud settings and which use volume snapshots or other methods. Your platform team owns this inventory, with the database owners confirming recovery targets for each cluster. Done when you have one table covering every cluster and a named owner for each, with no cluster missing from the list.
Confirm plugin version and operator compatibility
Check the Barman Cloud Plugin release notes and the CloudNativePG documentation for the plugin version that matches your operator release. Confirm the required Kubernetes version, the object storage permissions and the plugin's supported PostgreSQL major versions for each cluster in your inventory. Ask your vendor or the project maintainers to confirm any gaps rather than assuming support. Done when a written compatibility note names the plugin version, the operator version and every PostgreSQL major version in use.
Deploy the plugin in a non-production cluster
Install the Barman Cloud Plugin in a staging or test Kubernetes cluster and configure a test CloudNativePG cluster to archive WAL and take base backups through the plugin, using a separate bucket or path from production. Keep the old configuration out of this test so the new path is proven alone. Done when the plugin reports healthy status, the cluster reaches ready state and the first backup object appears in the test storage location.
Take a fresh base backup and confirm WAL archiving
On the test cluster, trigger an on-demand base backup, then generate write activity and confirm new WAL segments arrive in the storage location. Check the backup status until it shows completed, and compare the archived WAL file names against the cluster's current WAL position. Done when a completed base backup and continuous archived WAL are both visible in the new location, with no archive failure events in the operator logs.
Switch production clusters in a planned window
Schedule each production switch with the database owner and change approval, since archiving changes carry risk. Take a fresh base backup with the existing method first, then update each cluster to use the plugin, keeping the old backup path intact so earlier backups remain available. Confirm that the first plugin-based base backup completes and that WAL archiving continues to the new location without gaps. Done when every production cluster shows completed backups and archived WAL through the plugin.
Test restores from pre-switch backups separately
Backups taken before the switch use the old configuration and must be restored and tested on their own path, since they may depend on the old storage settings. Restore one of these backups into a new, isolated cluster and confirm the cluster starts and replays WAL to a chosen point in time. Repeat for a backup taken after the switch. Done when both a pre-switch and a post-switch restore have succeeded in isolation and the results are recorded.
Retire the old configuration after verified restores
Once restores from both backup generations are verified and the retention policy covers the period you need, remove the in-operator Barman Cloud settings from each cluster manifest. Keep the old storage location read-only until its retention window has passed, so older backups stay recoverable. Done when the cluster manifests no longer reference the deprecated settings, the old location is protected from deletion and the change is documented in your runbook.
How WAL, base backups and recovery move between the cluster, object storage and a new cluster
The diagram starts at the primary and standby pods inside the Kubernetes cluster. The main path sends WAL archives and base backups through the Barman Cloud Plugin to an object store that runs under separate credentials. An optional volume snapshot path sits alongside it. Recovery creates a new cluster from the stored backup and replays WAL up to a chosen target time. Check that the operator-managed secrets reach only the components that need them, and that the object store credentials are not the cluster's own.
Backup and recovery flow between the cluster, object storage and a new cluster.
How recovery into a new cluster works and what it changes
Recovery into a new CloudNativePG cluster rebuilds a database from a base backup plus the archived WAL files that follow it, replaying changes up to a chosen target time. This is the PostgreSQL point-in-time recovery model described in the continuous archiving documentation. In practice, you create a new Cluster resource that uses a bootstrap section with a recovery source, pointing at the object store that holds the backups and WAL, and set the target time in the recovery configuration. The team must confirm which recovery fields and target options its installed operator version supports, because the names and behavior of the recovery bootstrap have changed across releases and the Barman Cloud Plugin path may differ from the older in-operator path.
Pointing the new cluster at the right backup is the step most often done wrong. Check the server name used when the backups were written, the bucket path, the credentials for read access, and the target time in UTC. A target time that falls before the earliest usable base backup, or after WAL archiving stopped, will fail or silently stop at the wrong point. Use an illustrative check: list the available backups for the server, confirm the one you need completed, and confirm WAL covers the target time before you start recovery. Record which backup and which target you used, because that record is part of your restore evidence.
The recovered cluster is a new cluster. It has its own pods, its own service endpoints such as the read-write service name, and secrets that the operator generates or that you supply. Applications still point at the old endpoints and credentials, so each connection string, user secret and monitoring target must be moved or repointed deliberately, and the old cluster should be kept or retired on a planned schedule. Restoring in place is faster to reason about for an outage, but it overwrites the live cluster. Restoring to a new cluster is the safer choice for testing, for forensic comparison and for drills, and it is the path the team should use for regular restore tests. Confirm with the operator documentation for your version whether in-place recovery is supported and how it handles the existing cluster identity.
Securing backup credentials, object storage and restore access
A CloudNativePG backup setup touches four places where a leak or misuse could expose production data: the Kubernetes Secrets that hold backup credentials, the object storage bucket that receives backups, the permissions that allow restores, and the pods that run backup work. Each needs its own controls, and reviewing them together shows whether a stolen database credential could also reach the backups.
Backup credentials in Kubernetes Secrets
The object storage keys used by the backup component are usually stored as Kubernetes Secrets. Kubernetes stores Secrets unencrypted in etcd by default, so confirm that encryption at rest is enabled for the API server's Secret resources before the backup Secret is created. Then restrict who can list or watch Secrets in the cluster namespace, since list and watch access can expose values even without a direct read. If your security policy requires centrally managed keys, decide whether an external store through the Secrets Store CSI Driver will supply the credentials instead.
Secrets good practicesSeparate object storage credentials
Create a dedicated storage identity for backups that is separate from the database's own credentials and from any application account. The backup identity should be able to write and read only the backup path for that cluster, and should not be able to administer the bucket. Confirm with your storage provider how write-once or object lock settings and deletion rights are assigned, so that a compromised cluster cannot delete the copies it created. Record who holds the storage administrator role and review it on a fixed schedule.
Restore permissions and data copies
Restoring a cluster creates a second copy of production data, often in a cluster with weaker controls. Limit the ability to create recovery clusters or to read backup paths to a named group, and require a ticket or approval for each restore. Decide where recovered clusters may run, which namespaces, network policies and storage classes they may use, and when they must be deleted. Record each restore so the audit trail shows who copied data, from which backup and to where.
Pod security for backup workloads
Backup and restore pods handle database files and storage credentials, so they should meet the policy your cluster enforces for sensitive workloads. Check the namespace's Pod Security admission level against the Pod Security Standards, and confirm the backup and restore pods run as non-root, drop unneeded capabilities and do not mount host paths. Verify these settings on the pods that the operator actually creates, because a restore job can differ from the cluster's steady-state pods.
Pod Security StandardsSetting up scheduled backups and a first restore test
This sequence takes a CloudNativePG cluster from an unprotected state to one with scheduled base backups, continuous WAL archiving, a retention policy and a verified restore into a separate namespace. Each step closes with a check you can record as evidence.
Confirm cluster, operator and storage versions
The platform engineer records the CloudNativePG operator version, the PostgreSQL major and minor version of the cluster, the Kubernetes version and the storage class the cluster uses. Confirm in the current CloudNativePG documentation which operator release supports the Barman Cloud Plugin and which plugin version matches it, because the in-operator Barman Cloud support is deprecated and the plugin path is the one to build on. Done means a written inventory of versions and a confirmed plugin compatibility note that the team can attach to the change ticket.
Create the bucket and scoped credentials
The cloud or storage administrator creates a dedicated object storage bucket for this cluster's backups and WAL files, with a credential that can only write to and read from that bucket prefix. Keep the backup credential separate from the application credential and from any administrator account. Store the credential as a Kubernetes Secret and restrict who can read it using RBAC, since Secrets are unencrypted in etcd unless encryption at rest is configured. Done means a test upload and download succeed with that credential and the same credential is denied access to a neighboring bucket.
Configure the Barman Cloud Plugin backup target
The platform engineer adds the plugin configuration to the cluster resource and points it at the bucket, endpoint and Secret created in the previous step. Use the configuration keys from the current CloudNativePG plugin documentation, not from older examples or blog posts, because key names change between releases. Apply the change in a non-production namespace first. Done means the cluster reports the backup configuration as ready and the operator logs show no authentication or endpoint errors.
Enable WAL archiving and confirm archive success
With the plugin in place, the platform engineer confirms that the cluster is archiving WAL segments to the bucket. Write a row or make a trivial change in a test database to force WAL activity, then list the archived WAL objects in the bucket and check the cluster status for the last archived WAL position. Watch the PostgreSQL logs for archive_command or plugin errors. Done means new WAL files appear in the bucket within the interval you observe and the status shows no failed archive attempts.
Schedule base backups and set retention
The platform engineer defines a scheduled backup resource that runs base backups at the frequency your recovery point objective requires, and sets a retention policy that matches your recovery window and legal hold needs. Confirm the schedule syntax and retention key names in the CloudNativePG documentation for your release. Ask the backup owner to state the recovery window in writing so the retention value is a decision, not a default. Done means the scheduled backup object exists, the next run time is shown, and the retention policy is recorded in the runbook.
Run a manual backup and verify completion
Before relying on the schedule, the platform engineer triggers an on-demand backup and watches it until it reports completion. Check the backup object's status, its start and stop LSNs or equivalent markers, and the matching objects in the bucket. Confirm the WAL segments needed to make the backup consistent are present in the bucket. Done means the backup status is completed and the backup can be listed with its recorded consistency markers.
Restore into a new cluster in a test namespace
The platform engineer creates a separate test namespace and defines a new cluster that bootstraps from the backup in the bucket, using the recovery configuration described in the CloudNativePG documentation for the plugin. Do not point the restore at the production cluster's name or storage. Start a timer when the restore is triggered and stop it when the new cluster accepts connections. Done means the restored cluster reports healthy, a row count or checksum query on a known table matches the source, and the elapsed time is recorded against your recovery time objective.
Record evidence and remove the test restore
The team writes down the versions, configuration revision, backup ID, archive range, restore start and finish times and the verification query results, then attaches them to the change record. Delete the test namespace and its resources once the evidence is stored, so that stray restored clusters do not hold credentials or data. Done means the evidence package is filed, the test namespace is gone, and the restore time is compared with the target the business owner set.
Limits to confirm in your environment before you rely on these backups
Five parts of this backup design depend on your operator version, storage platform, object store and Kubernetes upgrade schedule. No single source settles them for every environment, so each one needs a check in a test cluster before a backup policy goes into production. The operator status comes first because it sets which backup path you can run, and the other four decide what you can restore and how you keep the setup current.
In-operator Barman Cloud support status
The in-operator Barman Cloud support is deprecated, and the Barman Cloud Plugin is the path to move to. Check the operator version your cluster runs, whether that version still includes the in-operator backup path, and the deprecation and removal timeline in the CloudNativePG release notes for that version. Then confirm that scheduled backups, retention and WAL archiving all work through the plugin in a test cluster before you cut over.
Whether snapshots meet your PITR target
A volume snapshot captures the data files at one moment. Point-in-time recovery also needs archived WAL to replay the changes made after that moment. Confirm whether your design pairs snapshots with continuous WAL archiving, and what the earliest and latest recoverable times are in a restore drill. If a snapshot is your only backup, check whether your recovery point objective is achievable at all.
Continuous archiving docsSnapshot consistency under your CSI driver
Snapshot behavior depends on the storage class, the CSI driver and the storage system behind them. Ask your storage vendor and the driver documentation whether snapshots of the data and WAL volumes are taken together and whether the result is crash-consistent or needs PostgreSQL to be quiesced first. Test a restore from a snapshot taken under write load, because a consistent-looking snapshot can still fail to start.
Object store lifecycle and immutability
Backups in an object store are only protected from deletion if the bucket enforces it. Check whether your provider supports object versioning, a retention lock or object lock, and lifecycle rules that expire old objects without removing backups still needed for your retention policy. Confirm that the credentials used by the backup job cannot delete or overwrite locked objects. Your provider's documentation and your own retention policy are the sources to check.
Kubernetes skew and upgrade windows
The operator and plugin must run on Kubernetes versions your cluster supports. The version skew policy requires the kube-apiserver to be upgraded one minor version at a time, ahead of the control plane components and kubelets, which may be up to three minor versions older. Check the supported releases page against your planned upgrade schedule, then test a backup and a restore after each step so an upgrade does not leave the backup path broken.
Version skew policyQuestions teams ask before running CloudNativePG backups
What drives the cost of moving off in-operator Barman Cloud backups?
The main cost driver is how many clusters rely on the in-operator backup configuration, and how many object storage repositories, schedules and credentials each one uses. Each cluster needs its backup resources rewritten for the Barman Cloud Plugin, tested with a restore, and cut over without breaking the existing backup chain. The migration itself is one-time work, while retention, monitoring and restore testing recur after go-live. Costs rise when clusters have custom backup settings, when retention rules differ between environments, or when no restore test exists to compare against. Ask any quote to list each cluster, its storage target, its recovery targets and whether cutover happens in place or into a new cluster. Confirm the deprecation status and migration steps in the CloudNativePG documentation for the version you run before you scope the work.
Can our own team migrate CloudNativePG backups without outside help?
A team with Kubernetes and PostgreSQL experience can do the migration itself, provided it has time to test restores in a non-production copy and someone owns the cutover. For a single cluster the steps are manageable, but the risk sits in the details: keeping the existing backup chain readable, confirming where the new plugin writes, and proving a restore works before the old configuration is removed. Teams without a recent restore drill often find gaps during the cutover itself. An outside team can take on the planning, the cutover runbook and the restore evidence, while your staff keep the operational knowledge. Decide based on how many clusters you run, who will be on call for them, and what a failed cutover would cost your services.
What does the work need from our team to start?
The work needs four things: access to the cluster manifests and a read-only view of the running clusters, accounts with write access to the object storage buckets used for backups, a defined restore window, and a test environment where restores can run without touching production. Access should be scoped to the namespaces involved, and Kubernetes RBAC decides what the team can view and change, so confirm roles early. Object storage credentials should be separate from production credentials where your policy requires it. The restore window matters because a restore test can run for hours depending on database size. Name an owner who can approve cutover, and involve your platform team, since Secrets holding backup credentials are stored unencrypted in etcd by default unless encryption at rest is configured. Review the Kubernetes Secrets good practices guidance before handing over credentials.
How long does a CloudNativePG backup migration take, and what changes that?
Duration depends on how many clusters you migrate, how large each database is, and how quickly your recovery targets must be met. Each cluster is a separate change with its own backup chain, so counting clusters is the first step. Database size drives base backup and restore time, because a restore into a test cluster has to copy data and replay changes. Storage throughput, the network path to object storage, and whether you migrate in place or create a new cluster also shift the schedule. Long retention periods increase the number of backups to validate. This page cannot give a fixed duration. Ask for a timeline built from your cluster inventory, measured restore times from a test environment, and the cutover windows your services can accept.
Do volume snapshots replace WAL archiving for point-in-time recovery?
No. Volume snapshots give a fast copy of the storage at one moment, but they do not replace WAL archiving if you need point-in-time recovery. PostgreSQL must replay write-ahead log records after the base copy to reach a chosen time, so the archived WAL is required. Point-in-time recovery depends on a base backup plus archived WAL, as described in the PostgreSQL continuous archiving documentation. Snapshots can shorten restore time to a known point and often sit alongside continuous archiving. Before relying on them, confirm with your storage vendor that the CSI driver and snapshot class produce consistent snapshots for PostgreSQL data, and test a recovery into a new cluster from both the snapshot and the archived WAL.
How do we keep backup retention and restore tests as audit evidence?
Keep evidence generated by routine jobs: backup completion records, retention settings committed to version control, and dated restore test reports. Retention belongs in the backup configuration, and storing that configuration in Git gives each change an author and a review. Each restore test should record the cluster, the backup used, the recovery target time, the start and end times, the checks run against the restored data, and the person who signed off. Keep these records in a system your auditor can read, with access controls and retention that match your policy. Auditors often look for controls operating across a period, so a schedule with results is stronger than one test. DeployOpen prepares systems, controls and evidence for compliance assessments, but independent auditors issue the reports. Ask your auditor which formats they accept.
What should engineers verify after moving to the Barman Cloud Plugin?
Engineers should check that backups and WAL archiving work end to end before removing the old configuration. Verify the following:
- The object store path, endpoint and credentials used by the plugin match the intended repository, and the old and new paths are clearly separated.
- WAL archiving reports successfully and the archive keeps advancing after a write load.
- A manual backup completes, appears in the object store, and is listed in the cluster status.
- A scheduled backup runs on its planned cron schedule and failures raise an alert your on-call team receives.
- A restore into a new cluster reaches the chosen target time, and application checks pass against the restored database.
Record the results of each check so the cutover has a clear, reviewable trail.
How DeployOpen works on this
DeployOpen plans, implements, documents and supports self-hosted PostgreSQL backups for CloudNativePG clusters inside your own Kubernetes environment and cloud accounts. The work starts with a written scope that ties backup design to your recovery point and recovery time targets, then proves the design with restores before anything is handed over.
How we scope
- We confirm your clusters, CloudNativePG version, storage classes and object storage targets before any design work starts.
- The written scope names which backup method you need, whether Barman Cloud Plugin, volume snapshots or both, and the retention rules to apply.
- We agree in writing how restore tests will be run, what evidence you receive, and who in your team signs off the recovery targets.
How we build
- We move existing in-operator Barman Cloud configuration to the Barman Cloud Plugin, with a documented cutover and rollback path for each cluster.
- We configure scheduled backups, WAL archiving, retention policies and off-site object storage credentials kept separate from cluster secrets.
- We run test restores into a new cluster and record timings and point-in-time results against the targets you agreed.
How we hand over
- You receive the configuration as code, runbooks for backup failure, point-in-time recovery and recovery into a new cluster.
- The handover pack includes restore test records, the retention and encryption settings applied, and the open items your team must confirm.
- We walk your platform and database operators through a live restore so they can run the procedure without us.
How we support
- Engagements are fixed-scope, so changes to clusters, storage or retention go through a new written scope and quote.
- Ongoing support, upgrades of the backup plugin and CloudNativePG, and scheduled restore drills are available as a retainer.
- Before any CloudNativePG or Kubernetes upgrade, we can review backup compatibility and repeat restore tests against the new versions.

