Configure S3 for RadosGW

Charmed MySQL backups 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 MySQL application, and update it.

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=2/stable
juju add-secret s3-credentials access-key=<access-key-here> secret-key=<secret-key-here>
juju grant-secret s3-credentials s3-integrator

Lastly, use juju config to add your configuration parameters. For example:

juju config s3-integrator \
    credentials=<secret-uri-from-previous-step> \
    endpoint="https://radosgw.mycompany.fqdn" \
    bucket="backups-bucket" \
    path="/mysql" \
    region="" \
    s3-api-version="" \
    s3-uri-style="path"
juju config s3-integrator \
    credentials=<secret-uri-from-previous-step> \
    endpoint="https://radosgw.mycompany.fqdn" \
    bucket="backups-bucket" \
    path="/mysql-k8s" \
    region="" \
    s3-api-version="" \
    s3-uri-style="path"

Integrate with Charmed MySQL

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

juju integrate s3-integrator mysql

You can create, list, and restore backups now:

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

You can also update your S3 configuration options after relating:

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

The S3-integrator charm accepts many configuration parameters for your S3 storage.