Back up your workloads

This page details how to create manual backups, view existing backups, and delete existing backups.

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.

Application operators can only perform manual backups from an existing backup plan.

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.

You must have the User Cluster Backup Admin or Backup Creator role to create manual backups.

Console

  1. Sign in to the GDC console.
  2. In the navigation menu, click Backup for Clusters.
  3. Click the Backup Plans tab.
  4. Click the plan that you want to use for the backup.
  5. Click Start a backup.
  6. Enter a backup name and an optional description.
  7. Set the number of days to retain the backup. Once this number of days is reached, the backup is automatically deleted.
  8. Set the number of days during which backups cannot be deleted.
  9. 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 ManualBackupRequest.

Here's an example of a ManualBackupRequest:

apiVersion: backup.gdc.goog/v1
kind: ManualBackupRequest
metadata:
  name: manualbackuprequest-test
  namespace: default
spec:
  backupName: "backup-test"
  backupPlanName: "backupplan-test"
  deleteLockDays: 5
  retainDays: 6

This example includes the following values:

Value Description
backupName The name of the backup to create.
backupPlanName The name of the BackupPlan to use for the configuration of the backup. The backup plan must exist in the same namespace as the ManualBackupRequest.
deleteLockDays Blocks any deletion of the backup for the number of days specified after backup creation. This overrides the retentionPolicy in the BackupPlan.
retainDays Deletes backups once the specified number of days is reached following backup creation. This value overrides the retentionPolicy in the BackupPlan. Retention policies do not override the retention policies of the storage location, nor can they exceed 90 days.

View a backup

You must have the User Cluster Backup Admin or Backup Creator role to view backups. User Cluster Backup Admins can see all backups in the organization. Backup Creators can see all backups in a project.

Console

  1. Sign in to the GDC console.
  2. In the navigation menu, click Backup for Clusters.
  3. 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.
  4. Click the Backups tab.
  5. Click a backup in the list to view its details.

kubectl

View a list of your backups:

kubectl get backups

An example of the output:

NAME            STATE
backup-test   Succeeded

Delete a backup

You must have the User Cluster Backup Admin or Backup Creator role to delete backups.

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 DeleteBackupRequest.

Console

Delete the backup from the Backups tab:

  1. Sign in to the GDC console.
  2. In the navigation menu, click Backup for Clusters.
  3. 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.
  4. Click the Backups tab.
  5. Click the three-dot menu icon for the backup you want to delete.
  6. Type the name of the backup into the text box.
  7. 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:

  1. Sign in to the GDC console.
  2. In the navigation menu, click Backup for Clusters.
  3. 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.
  4. Click the Backup Plans tab.
  5. Click the name of the backup plan containing the backup you want to delete.
  6. Click the Backups tab.
  7. Click the name of the backup you want to delete.
  8. Click the Delete Backup button.
  9. Enter the name of the backup into the text field.
  10. Click the Delete button to complete the deletion of this backup.

kubectl

Send a DeleteBackupRequest request:

apiVersion: backup.gdc.goog/v1
kind: DeleteBackupRequest
metadata:
  name: deletebackuprequest-test
  namespace: default
spec:
  backupName: "backup-test"

This example includes the following values:

  • backupName: the name of the backup being deleted. This backup must exist in the same namespace as the DeleteBackupRequest.
  • DeleteBackupRequests both 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.