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 529 29 Nov 2024
Ubuntu 22.04
14/candidate 528 29 Nov 2024
Ubuntu 22.04
14/beta 529 28 Nov 2024
Ubuntu 22.04
14/beta 528 28 Nov 2024
Ubuntu 22.04
14/edge 535 13 Dec 2024
Ubuntu 22.04
14/edge 534 13 Dec 2024
Ubuntu 22.04
16/edge 527 27 Nov 2024
Ubuntu 24.04
16/edge 526 27 Nov 2024
Ubuntu 24.04
juju deploy postgresql --channel 14/stable
Show information

Platform:

Ubuntu
24.04 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 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.

For AWS, see the guide How to configure S3 for AWS

The Charmed PostgreSQL backup tool (pgBackRest) can currently only interact with S3-compatible storages 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
juju run s3-integrator/leader sync-s3-credentials access-key=<access-key> secret-key=<secret-key> 

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

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 integrating using

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

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