This page provides instructions for how to create backup plans for Harbor instances in Google Distributed Cloud (GDC) air-gapped.
The backup plan references the Harbor instance that is backed up. Backup plans define key components for backups such as the backup schedule and the retention policy. GDC creates backups automatically depending on the configuration you provide in the backup plan. You can also create a manual backup on demand, which inherits some values from the backup plan.
Before you begin
To create a backup plan, you must have access to the following:
The necessary identity and access roles:
- Harbor Instance Admin: has full access to manage Harbor instances in a project. Ask your Organization IAM Admin to grant you the Harbor Instance Admin (
harbor-instance-admin
) role. - Secret Admin: required for operating in the GDC console. Ask your Organization IAM Admin to grant you the Secret Admin (
secret-admin
) role.
- Harbor Instance Admin: has full access to manage Harbor instances in a project. Ask your Organization IAM Admin to grant you the Harbor Instance Admin (
A Harbor backup repository. For more information, see Create a backup repository.
Create a backup plan
Create a repository in the GDC console or the API.
Console
- Sign in to the GDC console.
- In the navigation menu, click Backup for harbor instance.
- Click Backup plans.
- Click Create backup plan.
- In the Zone menu, select the zone.
- In the Harbor instance source menu, select the harbor instance this backup plan creates backups for.
- In the Backup plan name field, enter a name for the backup plan.
- Optional: In the Backup plan description field, enter a description to distinguish this backup plan from others
- In the Backup repository menu, select a backup repository from the available options. If there are no options available, you must Create a backup repository.
- Click Next.
- In the Cron string field, define a schedule for this backup plan.
Enter an expression using standard cron syntax. For example, the
expression
10 3 * * *
creates a backup at0310
every day. All times are interpreted as UTC. The minimum interval between scheduled backups is 10 minutes. Optional: In the Retention policy section, decide whether to automatically delete backups after a certain number of days:
- Select the Enable automatic backup deletion checkbox.
- In the Delete backups after field, set the number of days for which to retain the backup. Once the number of days is reached, the backup is automatically deleted.
Click Next.
Review the backup plan details. To finalize the creation of this backup plan, click Create Plan.
API
apiVersion: artifactregistry.gdc.goog/v1
kind: HarborInstanceBackupPlan
metadata:
name: BACKUP_PLAN_NAME
namespace: INSTANCE_NAMESPACE
spec:
backupSchedule:
cronSchedule: CRON_STRING
paused: false
backupConfig:
backupRepository: BACKUP_REPO_NAME
backupScope:
harborInstance: INSTANCE_NAME
retentionPolicy:
backupRetainDays: BACKUP_RETAIN_DAYS
description: PLAN_DESCRIPTION
Replace the following:
BACKUP_PLAN_NAME
: the name of the backup plan.INSTANCE_NAMESPACE
: the namespace containing the Harbor instance. The backup plan must be in the same namespace as the Harbor instance.CRON_STRING
: the cron value that defines the backup schedule. For example the value0 3 * * *
defines a schedule that performs daily backups at 3 AM. Use thepaused
field to pause the schedule. If true, periodic scheduled backups are stopped. A paused backup plan is still able to create a manual backup.BACKUP_REPO_NAME
: the name of the backup repository. For more information, see Create a backup repository.INSTANCE_NAME
: the name of the Harbor instance. For more information, see Create Harbor registry instances.BACKUP_RETAIN_DAYS
: the number of days after which the backup is deleted. This value is overridden by manual backups that use this plan.PLAN_DESCRIPTION
: a text description of the backup plan.