You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for more information about designated primary instances).
24
30
25
-
!!! Warning
26
-
Cloud Native PostgreSQL does not currently manage the deletion of backup files
27
-
from the backup object store. The retention policy feature will be merged from
28
-
Barman to Barman Cloud in the future. For the time being, it is your responsibility
29
-
to configure retention policies directly on the object store.
30
-
31
31
## Cloud provider support
32
32
33
33
You can archive the backup files in any service that is supported
@@ -464,6 +464,7 @@ will use it unless you override it in the cluster configuration.
464
464
465
465
## Recovery
466
466
467
+
Cluster restores are not performed "in-place" on an existing cluster.
467
468
You can use the data uploaded to the object storage to bootstrap a
468
469
new cluster from a backup. The operator will orchestrate the recovery
469
470
process using the `barman-cloud-restore` tool.
@@ -540,4 +541,43 @@ manager running in the Pods.
540
541
You can optionally specify a `recoveryTarget` to perform a point in time
541
542
recovery. If left unspecified, the recovery will continue up to the latest
542
543
available WAL on the default target timeline (`current` for PostgreSQL up to
543
-
11, `latest` for version 12 and above).
544
+
11, `latest` for version 12 and above).
545
+
546
+
## Retention policies
547
+
548
+
Cloud Native PostgreSQL can manage the automated deletion of backup files from the backup object store, using **retention policies** based on recovery window.
549
+
550
+
Internally, the retention policy feature uses `barman-cloud-backup-delete`
551
+
with `--retention-policy “RECOVERY WINDOW OF {{ retention policy value }} {{ retention policy unit }}”`.
552
+
553
+
For example, you can define your backups with a retention policy of 30 days as
554
+
follows:
555
+
556
+
```yaml
557
+
apiVersion: postgresql.k8s.enterprisedb.io/v1
558
+
kind: Cluster
559
+
[...]
560
+
spec:
561
+
backup:
562
+
barmanObjectStore:
563
+
destinationPath: "<destination path here>"
564
+
s3Credentials:
565
+
accessKeyId:
566
+
name: aws-creds
567
+
key: ACCESS_KEY_ID
568
+
secretAccessKey:
569
+
name: aws-creds
570
+
key: ACCESS_SECRET_KEY
571
+
retentionPolicy: "30d"
572
+
```
573
+
574
+
!!! Note "There's more ..."
575
+
The **recovery window retention policy** is focused on the concept of
576
+
*Point of Recoverability* (`PoR`), a moving point in time determined by
577
+
`current time - recovery window`. The *first valid backup* is the first
578
+
available backup before `PoR` (in reverse chronological order).
579
+
Cloud Native PostgreSQL must ensure that we can recover the cluster at
580
+
any point in time between `PoR` and the latest successfully archived WAL
581
+
file, starting from the first valid backup. Base backups that are older
582
+
than the first valid backup will be marked as *obsolete* and permanently
0 commit comments