Set up backup repository for database services

This page provides instructions for how to set up a B4GDC BackupRepository named dbs-backup-repository in the Management API server to use as the target for your backups.

You have the option to set up a backup repository through the B4GDC UI or manually.

Before you begin

Before using backup and restore services for gdcloud CLI Database Services (DBS), you must:

  • Be a Platform Administrator (PA).
  • Have the necessary identity and access role:
    • DR Backup Admin: performs disaster recovery backups. Ask your Organization IAM Admin to grant you the DR Backup Admin (dr-backup-admin) cluster role.
  • Have an existing object storage secret. For more information, see Obtain bucket access credentials.

Set up DBS backup repository manually

This section assumes that you already have an S3-compatible endpoint available and that you have created a bucket to use as the backup repository. See Create bucket on the backup site. You must also have an existing object storage secret. For more information, see Obtain bucket access credentials. Then follow these steps:

  1. Get the existing object storage key:

    kubectl get secret -n dr-system | grep object-storage-key
    

    If you followed the steps listed at Obtain bucket access credentials, this command returns a value of object-storage-key-sysstd-sa-id.

  2. Create a BackupRepository named dbs-backup-repository in the Management API server and supply the object storage key value from the previous step. Replace the placeholder values with your values:

apiVersion: backup.gdc.goog/v1
kind: BackupRepository
metadata:
  name: dbs-backup-repository
spec:
  secretReference:
    namespace: "dr-system"
    name: OBJECT_STORAGE_KEY_SECRET
  endpoint: ENDPOINT
  type: "S3"
  s3Options:
    bucket: BUCKET_NAME
    region: REGION
    forcePathStyle: true
  importPolicy: "ReadWrite"
  force: true

Replace the following:

  • OBJECT_STORAGE_KEY_SECRET: the secret name you obtained in the first step.
  • ENDPOINT: the endpoint of your object storage.
  • BUCKET_NAME: the name of your bucket.
  • REGION: the region of your bucket.