Manage backup retention¶
Charmed PostgreSQL K8s backups can be managed via a retention policy. This retention can be set by the user in the form of a configuration parameter in the charm s3-integrator
via the config option experimental-delete-older-than-days
.
This guide will teach you how to set this configuration and how it works in managing existing backups.
Caution
This is an experimental parameter - use it with caution.
Configure S3-integrator charm¶
Deploy and run the s3-integrator
charm:
juju deploy s3-integrator
juju run s3-integrator/leader sync-s3-credentials access-key=<access-key-here> secret-key=<secret-key-here>
Then, use juju config
to add the desired retention time in days:
juju config s3-integrator experimental-delete-older-than-days=<number-of-days>
To pass these configurations to a Charmed PostgreSQL K8s application, integrate the two applications:
juju integrate s3-integrator postgresql-k8s
If at any moment it is desired to remove this option, the user can erase this configuration from the charm:
juju config s3-integrator --reset experimental-delete-older-than-days
This configuration will be enforced in every Charmed PostgreSQL application related to the configured S3-integrator charm
Caution
The retention is not enforced automatically once a backup is older than the set amount of days. Backups older than the set retention time will only get expired only once a newer backup is created.
This behavior avoids complete backup deletion if no newer backups have been created in the charm.
The s3-integrator charm accepts many configurations - enter whichever are necessary for your S3 storage.