DigitalOcean

DigitalOcean Setup

This section shows to set up backups using DigitalOcean Spaces. You will need to have s3Cmd installed. You need to configure s3cmd following the instructions in the official docs.

Go to the API page and create a spaces key.

Let’s create the bucket with the following characteristics (that you may change):

  • Bucket name: my-stackgres-bucket
s3cmd mb s3://my-stackgres-bucket

Secret and SGObjectStorage

Create a Kubernetes secret with the following contents:

ACCESS_KEY="**********" ## fix me
SECRET_KEY="**********" ## fix me
kubectl create secret generic \
  do-backup-secret \
  --from-literal=accessKeyId=${ACCESS_KEY} \
  --from-literal=secretAccessKey=${SECRET_KEY}

Having the credentials secret created, we now need to create the object storage configuration and set the backup configuration. The object storage configuration it is governed by the SGObjectStorage CRD. This CRD allows to specify the object storage technology, required parameters, as well as a reference to the credentials secret.

apiVersion: stackgres.io/v1beta1
kind: SGObjectStorage
metadata:
  name: objectstorage
spec:
  type: s3Compatible
  s3Compatible:
    bucket: my-stackgres-bucket
    endpoint: https://nyc3.digitaloceanspaces.com
    awsCredentials:
      secretKeySelectors:
        accessKeyId: {name: 'do-backup-secret', key: 'accessKeyId'}
        secretAccessKey: {name: 'do-backup-secret', key: 'secretAccessKey'}