Configure S3 for RadosGW¶
A 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 on Ceph via RadosGW , send the configuration to a Charmed PostgreSQL application, and update it.
See also: Configure S3 for AWS
pgBackRest limitations
The backup tool pgBackRest can only interact with S3-compatible storage if they work with SSL/TLS .
Backup via the plain HTTP is currently not supported.
Configure s3-integrator¶
First, install the MinIO client and create a bucket:
mc config host add dest https://radosgw.mycompany.fqdn <access-key> <secret-key> --api S3v4 --lookup path
mc mb dest/backups-bucket
Then, deploy and run the charm:
juju deploy s3-integrator --channel=1/stable
juju run s3-integrator/leader sync-s3-credentials access-key=<access-key> secret-key=<secret-key>
We recommend using the 1/stable channel of the S3 integrator charm.
The latest version of the S3 integrator charm is in 2/stable, and adds support for Juju secrets.
The PostgreSQL charm is not yet using the latest version of the S3 integrator library, so we recommend using 1/stable for guaranteed compatibility.
Lastly, use juju config to add your configuration parameters. For example:
juju config s3-integrator \
endpoint="https://radosgw.mycompany.fqdn" \
bucket="backups-bucket" \
path="/postgresql" \
region="" \
s3-api-version="" \
s3-uri-style="path" \
tls-ca-chain="$(base64 -w0 /path-to-your-server-ca-file)"
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.