Configure S3 for AWS

vmk8s

A Charmed PostgreSQL backup can be stored on any S3-compatible storage. S3 access and configurations are managed with the s3-integrator charm .

This guide will teach you how to deploy and configure the s3-integrator charm for AWS S3 , send the configurations to the Charmed PostgreSQL application, and update it.

See also: Configure S3 for RadosGW.

Set up s3-integrator

Deploy and configure the s3-integrator charm for AWS S3:

juju deploy s3-integrator --channel=1/stable
juju run s3-integrator/leader sync-s3-credentials access-key=<access-key-here> secret-key=<secret-key-here>

juju config s3-integrator \
    endpoint="https://s3.us-west-2.amazonaws.com" \
    bucket="postgresql-test-bucket-1" \
    path="/postgresql-test" \
    region="us-west-2"

There is an experimental configuration option that sets up a retention time (in days) for backups stored in S3: experimental-delete-older-than-days .

See: Manage backup retention.

Integrate with Charmed PostgreSQL

To pass these configurations to Charmed PostgreSQL, integrate the two applications:

juju integrate s3-integrator postgresql
juju integrate s3-integrator postgresql-k8s

You can create, list, and restore backups now:

juju run postgresql/leader list-backups
juju run postgresql/leader create-backup
juju run postgresql/leader list-backups
juju run postgresql/leader restore backup-id=<backup-id>
juju run postgresql-k8s/leader list-backups
juju run postgresql-k8s/leader create-backup
juju run postgresql-k8s/leader list-backups
juju run postgresql-k8s/leader restore backup-id=<backup-id>

You can also update your S3 configuration options after relating:

juju config s3-integrator <option>=<value>

See the s3-integrator charm on Charmhub for a list of all its configuration parameters.