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.
- DR Backup Admin: performs disaster recovery backups. Ask your Organization IAM Admin to grant you the DR Backup Admin (
- Set up a valid
B4GDC BackupRepository
nameddbs-backup-repository
in the system cluster to use as the target for your backups. - Have an existing object storage access 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. You must also have an existing object storage access secret. For more information, see Obtain bucket access credentials.
To set up the DBS backup repository manually, follow these steps:
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
.Create a
BackupRepository
nameddbs-backup-repository
in the system cluster and supply the object storage key value from the previous step:apiVersion: backup.gdc.goog/v1 kind: BackupRepository metadata: name: dbs-backup-repository spec: secretReference: namespace: "dr-system" name: "object-storage-key-sysstd-sa-id" endpoint: "https://objectstorage.staging.us-west12-a.google.com" type: "S3" s3Options: bucket: "apj2ahz-staging-dbs-backup-repo-bucket" region: "us-west12-a" forcePathStyle: true importPolicy: "ReadWrite" force: true