This page details how to create manual backups, view existing backups, and delete existing backups for cluster workloads in Google Distributed Cloud (GDC) air-gapped.
Before you begin
To create, view, and delete backups, you must have the following:
The necessary identity and access role:
- For Platform Administrator (PA) users:
- User Cluster Backup Admin: manages backup resources such as backup and restore plans in user clusters. Ask your Organization IAM Admin to grant you the User Cluster Backup Admin (
user-cluster-backup-admin
) role.
- User Cluster Backup Admin: manages backup resources such as backup and restore plans in user clusters. Ask your Organization IAM Admin to grant you the User Cluster Backup Admin (
- For Application Operator (AO) users:
- Backup Creator: creates manual backups and restores. Ask your Project IAM Admin to grant you the Backup Creator (
backup-creator
) role.
- Backup Creator: creates manual backups and restores. Ask your Project IAM Admin to grant you the Backup Creator (
- For more information, see Role definitions.
- For Platform Administrator (PA) users:
AO users can only perform manual backups from an existing backup plan.
Create a manual backup
If your backup plan defines a schedule for the backup, the backups are automatically created according to that schedule. You can also manually create a backup outside the scope of your backup plan schedule. For example, you might want to back up your workloads before you upgrade your applications. A backup does not include cluster configuration information, such as node configurations, node pools, initial cluster size, or what features are enabled.
Two forms of data are captured in a backup:
- Config backup: A set of Kubernetes resource descriptions extracted from the API server of the cluster undergoing backup.
- Volume backup: A backup of
PersistentVolumeClaims
.
Console
- Sign in to the GDC console.
- In the navigation menu, click Backup for Clusters.
- Click the Backup Plans tab.
- Click the plan that you want to use for the backup.
- Click Start a backup.
- Enter a backup name and an optional description.
- Set the number of days to retain the backup. Once this number of days is reached, the backup is automatically deleted.
- Set the number of days during which backups cannot be deleted.
- Click Start.
API
The manual backup must reference an existing backup plan for the backup
configuration and the backup must be created by issuing a
ManualClusterBackupRequest
.
Here's an example of a ManualClusterBackupRequest
:
apiVersion: backup.gdc.goog/v1
kind: ManualClusterBackupRequest
metadata:
name: manualbackuprequest-test
namespace: PROJECT_NAME
spec:
clusterBackupName: "backup-test"
clusterBackupPlanRef: "backupplan-test"
deleteLockDays: 5
retainDays: 6
Replace PROJECT_NAME
with the name of your GDC project.
This example includes the following values:
Value | Description |
---|---|
clusterBackupName |
The name of the backup to create. |
clusterBackupPlanRef |
The name of the ClusterBackupPlan to use for the configuration of the
backup. The backup plan must exist in the same namespace as the
ManualClusterBackupRequest . |
deleteLockDays |
Blocks any deletion of the backup for the number of days specified after backup creation. This overrides the retentionPolicy in the
ClusterBackupPlan .
|
retainDays |
Deletes backups once the specified number of days is reached following
backup creation. This value overrides the retentionPolicy in the ClusterBackupPlan .
Retention policies do not override the retention policies of the storage
location, nor can they exceed 90 days.
|
View a backup
Users with the User Cluster Backup Admin (user-cluster-backup-admin
) role can see all backups in the organization.
Users with the Backup Creator (backup-creator
) role can see all of the backups in a project.
Console
- Sign in to the GDC console.
- In the navigation menu, click Backup for Clusters.
- Click Select project to select an organization or project depending
on your role:
- User Cluster Backup Admin: Select an organization to see all backups in an organization or select a project to see all backups in a project.
- Backup Creator: Select a project to see all backups in a project.
- Click the Backups tab.
- Click a backup in the list to view its details.
kubectl
View a list of your backups:
kubectl get clusterBackups
An example of the output:
NAME STATE
backup-test Succeeded
Delete a backup
Backups can't be deleted by a regular interaction with the Kubernetes API
server. To delete a backup, use the GDC console or issue a DeleteClusterBackupRequest
.
Console
Delete the backup from the Backups tab:
- Sign in to the GDC console.
- In the navigation menu, click Backup for Clusters.
- Click Select project to select an organization or project depending
on your role:
- User Cluster Backup Admin: Select an organization to see all backups in an organization, or select a project to see all backups in a project.
- Backup Creator: Select a project to see all backups in a project.
- Click the Backups tab.
- Click the three-dot menu icon for the backup you want to delete.
- Type the name of the backup into the text box.
Click the Delete Backup button to complete the deletion of this backup.
Alternatively, delete the backup by clicking on the backup name when viewing a backup plan:
- Sign in to the GDC console.
- In the navigation menu, click Backup for Clusters.
- Click Select project, and select an organization or project depending on
your role:
- User Cluster Backup Admin: Select an organization to see all of the backup plans in an organization, or select a project to see all of the backup plans in a project.
- Backup Creator: Select a project to see all of the backup plans in a project.
- Click the Backup Plans tab.
- Click the name of the backup plan containing the backup you want to delete.
- Click the Backups tab.
- Click the name of the backup you want to delete.
- Click the Delete Backup button.
- Enter the name of the backup into the text field.
Click the Delete button to complete the deletion of this backup.
kubectl
Send a DeleteClusterBackupRequest
request:
apiVersion: backup.gdc.goog/v1
kind: DeleteClusterBackupRequest
metadata:
name: deletebackuprequest-test
namespace: PROJECT_NAME
spec:
clusterBackupRef: "backup-test"
Replace PROJECT_NAME
with the name of your GDC project.
This example includes the following values:
backupName
: the name of the backup being deleted. This backup must exist in the same namespace as theDeleteClusterBackupRequest
.DeleteClusterBackupRequest
: the resource that deletes the backup custom resource from the cluster and removes all artifacts associated with that backup from the storage location of the backup, including volume data.