I asked a cluster a simple question: if this database vanished in the next ten minutes, what would we restore from?
The cluster answered with two green conditions. ContinuousArchiving was True. LastBackupSucceeded was True. Everything looked handled.
It was not handled. Both of those conditions are last-reconcile snapshots. They record what the operator saw on its last pass, and they keep reporting True after the backup path is removed. This cluster had no spec.backup, no spec.plugins, no Backup object and no ScheduledBackup. Archive mode was still on. The archive command still pointed at the instance manager, which had nowhere left to ship the write-ahead log.
Nothing was broken. Nothing was lying. The dashboard was describing a memory of a backup that no longer had a destination.
A backup is a claim. A restore is evidence.
That distinction is the whole job. Most teams I look at can tell me the last backup succeeded. Very few can tell me what the database looked like at 14:05 last Tuesday, or when they last read a row back out of a restored copy.
If you cannot answer those two questions, you do not have a backup. You have a nightly job that reports success.
One note before the commands. Everything below uses placeholders, so substitute your own names. <ns> is your namespace, <cluster> is the Cluster object, <primary-pod> is the pod the operator picked, and <barmanObjectName> is whatever your ObjectStore is called. The table and column names in the restore drill come from a typical application schema, not from anything specific.
The three things that count as proof
A CloudNativePG cluster has two working backup APIs, and either one is legitimate. What matters is that you read the right evidence for the API the cluster actually uses.
On the plugin path, read the object store’s recovery window. This is the answer that outranks everything else:
kubectl -n <ns> get objectstore <barmanObjectName> \
-o jsonpath='{.status.serverRecoveryWindow}'; echo
It reports, per server, lastSuccessfulBackupTime, firstRecoverabilityPoint and lastFailedBackupTime. A recent lastSuccessfulBackupTime with a firstRecoverabilityPoint at or before it is coverage. A ScheduledBackup with a recent lastScheduleTime is not: that proves the timer fired, not that anything was written.
Read the archiver’s own counters. These catch a broken WAL path that the operator’s conditions will happily miss:
select archived_count, failed_count, last_archived_time, last_failed_time
from pg_stat_archiver;
A rising archived_count, failed_count at zero and a recent last_archived_time is a live archive.
On the barman path, require a completed Backup object, newest first, filtered by cluster:
kubectl -n <ns> get backups.postgresql.cnpg.io -o json | python3 -c "
import sys,json
for i in sorted(json.load(sys.stdin)['items'],
key=lambda x: str(x.get('status',{}).get('startedAt')) or '')[-5:]:
s=i.get('status',{})
print(i['metadata']['name'],'| phase=',s.get('phase'),
'| started=',s.get('startedAt'))"
A cluster with green conditions and neither of these is unbacked until you prove otherwise.
Four things that do not count
I have been fooled by all four, so I write them down.
- The presence of
spec.backup. A plugin-path cluster has nospec.backupkey at all and backs up perfectly. Reading that key as the coverage test reports healthy clusters as unbacked, and the natural fix, adding a barman block to a cluster that already archives, gives it two competing backup paths and two competing WAL archivers. - An empty
Backuplist on the plugin path. Scheduled plugin backups can run without leaving a per-runBackupobject behind. A cluster that backs up daily can show zero objects and still be covered. - A PVC named
*-backupssitting next to the cluster. A volume with nothing mounted into it holds nothing. The name is the only thing suggesting otherwise. - A failed
Backupobject from months ago. Mostfailedobjects in a long-lived estate are history, not incidents. Checkstatus.startedAtandstatus.stoppedAt: a failure that never started is not a failure that is blocking you.
One more, because it costs people hours: kubectl delete backup is ambiguous. On a host that also runs Longhorn, the short name resolves to backups.longhorn.io and the delete returns NotFound for an object you can see. Type the full resource: kubectl delete backups.postgresql.cnpg.io <name>. And deleting the object does not stop a run in flight, because the barman process lives in the plugin sidecar, not in the postgres container.
The drill that turns a claim into evidence
This is the part that takes an afternoon and buys years of sleep. Once a quarter, per cluster:
- Pick a target time. Not “the latest backup”. Pick a real timestamp, such as the last day of the previous month at 14:00, and write it down before you start.
- Restore into a scratch cluster in a throwaway namespace, from the same object store, using
externalClustersand a recovery target. Never restore over the live cluster to test it. - Read data back, not status. Connect, then run a row count and a checksum on a table that matters:
select count(*), sum(hashtext(id::text)) from items where created_at < '2026-10-31 14:00';
- Compare against the live number for the same predicate. A restore that connects and serves no rows is worse than no restore, because it looks finished.
- Write the result down with the date, the target time, the row count and who ran it. Then delete the scratch cluster.
A restore you have never run is a hypothesis. A restore you ran once is a data point. A restore you run quarterly is a control.
Two ways a real backup still fails you
Both of these pass review and fail at the worst moment.
Two clusters sharing one serverName. The archive is keyed by that name. Two clusters writing into it corrupt each other’s history, and neither restore behaves. Make the name unique per cluster, and check it after any clone or cutover.
A data block with no wal block. You get a nightly snapshot with a hole between the last base backup and the next one. Restore lands you at the snapshot, and everything after it is gone. The wal section is what makes the copy continuous. Without it you have a copy, not a recovery window.
What I keep now
One page per cluster. Three lines: the API it uses, the last successful backup time from the source of truth for that API, and the date of the last restore drill with its row count. If a line is empty, the answer to “what would we restore from” is nothing, and it is better to learn that from a page than from an outage.
The cluster will always tell you the backup is fine. It is describing a memory. Go read the row back.
It is the same lesson as the pgvector index that never gets used: the number you assume is not the number you measured.
If you are still deciding whether to run your own database on Kubernetes at all, that question comes first: Kubernetes for SaaS startups: do you actually need it?. And once the backup is real, the next thing to get wrong is deleting the cluster it protects: the delete command that takes your database with it.
Related Articles
The Delete Command That Takes Your Database With It
There is a command in Kubernetes that reads like housekeeping and behaves like rm -rf on your database. It is one word …
The Helm Value Change That Never Reached the Pod
You change an image digest in a HelmRelease. The release reconciles, reports UpgradeSucceeded, and the revision number …
The pgvector Index That Never Gets Used
Semantic search on a production table was taking five seconds. The HNSW index was there, 667 MB of it, correctly built …
Want a second read on your setup?
Paste one Dockerfile, Compose file, or CI pipeline. We read it and send back one page: the three biggest risks and the first fix. Written by an engineer, not a bot.
Get the free triage

