Charmed PostgreSQL VM

Channel Revision Published Runs on
latest/stable 345 09 Nov 2023
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
latest/stable 239 09 Feb 2022
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
latest/stable 226 01 Apr 2021
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
14/stable 468 11 Sep 2024
Ubuntu 22.04
14/stable 467 11 Sep 2024
Ubuntu 22.04
14/candidate 468 02 Sep 2024
Ubuntu 22.04
14/candidate 467 02 Sep 2024
Ubuntu 22.04
14/beta 502 23 Oct 2024
Ubuntu 22.04
14/beta 503 23 Oct 2024
Ubuntu 22.04
14/edge 516 12 Nov 2024
Ubuntu 22.04
14/edge 515 12 Nov 2024
Ubuntu 22.04
juju deploy postgresql --channel 14/stable
Show information

Platform:

Ubuntu
22.04 20.04 18.04 16.04 14.04

Note: All commands are written for juju >= v.3.0

If you are using an earlier version, check the Juju 3.0 Release Notes.

Configure S3 for AWS

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. (To configure S3 for RadosGW, see this guide)

Configure s3-integrator

First, deploy and run the 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 your configuration parameters. For example:

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 now an experimental configuration option that sets up a retention time (in days) for backups stored in S3: experimental-delete-older-than-days. More info on this guide

The amazon S3 endpoint must be specified as s3.<region>.amazonaws.com within the first 24 hours of creating the bucket. For older buckets, the endpoint s3.amazonaws.com can be used.

See this post for more information.

Integrate with Charmed PostgreSQL

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

juju integrate s3-integrator postgresql

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-here>

You can also update your S3 configuration options after relating using:

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

The s3-integrator charm accepts many configurations - enter whichever are necessary for your S3 storage.