Backup and Restore
Palette allows you to create backups at the workspace-level. A workspace backup may include any or all namespaces included in the workspace, across every cluster in the workspace. The backup feature for workspaces uses the same Velero-based approach as regular cluster backups and are subject to the same limitations. For more information, refer to Cluster Backup and Restore.
The backup files will be stored in a backup location you configure. Each cluster will have its own backup files. When you delete a workspace, the backup files will not be deleted.
Create a Workspace Backup
Backing up a workspace creates a backup file for every cluster in your workspace. Each cluster backup file will contain all Kubernetes objects as well as volumes in the namespaces selected.
Prerequisites
-
You have configured at least one backup location for cluster backups. Refer to Add Backup Location using Static Credentials.
-
You are logged in as a Palette user that has the permission to back up workspaces. For more information, refer to Permissions.
-
The clusters in the workspace you want to backup are healthy and available. Unhealthy clusters will not be backed up.
-
If you want to include volume snapshots in the backup, ensure that your CSI driver supports volume snapshots. For more information about volume support, review the CSI pack README for your CSI driver in use. Refer to the Volume Snapshots section for more information.
warningEnsure that
manifests.volume-snapshot-class.deletionPolicy
is set to theRetain
value if you have configured Volume Snapshot Controller as a layer in your cluster profile. This setting allows volume snapshot content to be retained when volume snapshots are deleted, facilitating backup and restore functionality.volume-snapshot-class:
create: true
name: "spectro-volume-snapshot-class"
driver: ""
deletionPolicy: "Retain"Additionally, you must add the following snippet under the
manifests.volume-snapshot-class
field if you are using Portworx as your CSI layer on a cluster deployed to a MAAS environment. These labels ensure that the Volume Snapshot Controller pack installs correctly.extraLabels:
pod-security.kubernetes.io/enforce: privileged
pod-security.kubernetes.io/audit: privileged
pod-security.kubernetes.io/warn: privileged
Procedure
-
Log in to Palette.
-
In the drop-down Menu at the top of the page, choose the project that has your workspace.
-
On the left Main Menu, click Workspaces.
-
Click on the workspace you want to back up.
-
Click Settings in the upper-right corner.
-
Click Schedule backups.
-
Fill in the following basic information about your scheduled backups.
Parameter Description Backup prefix The prefix to your backup file names. Select backup location Select a location to store your backup files. Backup schedule Configure a schedule for your backups. Select expiry The period for which your backup files are kept. Backup files past the expiry date are deleted automatically. Include all disks Select this checkbox if you want to include all the disks in the backup. Include cluster-wide resources Cluster wide resources are resources that are not namespaced but are scoped to the whole cluster, such as cluster roles. Auto option includes persistent volumes that are linked to claims within the selected namespaces, but exclude other cluster-wide resources. -
Enter the namespaces you want to back up.
-
Select the clusters you want to back up.
-
Click Save Changes.
The backup process will take some time ranging from 15 minutes to hours depending on the scope of the backup.
Validate
-
Log in to Palette.
-
In the drop-down Menu at the top of the page, choose the project that has your workspace.
-
On the left Main Menu, click Workspaces.
-
Click on the workspace you backed up.
-
Click on the Backups tab.
-
Confirm that your backup is in progress or completed.
Restore a Workspace Backup
Restoring a workspace will restore the selected namespaces in every cluster that is currently in the workspace to the same state from which the backup was created. The clusters being restored must be healthy and reachable, because the restore process relies on access to the Kubernetes API. If you have deleted a cluster from the workspace, the deleted cluster will not be restored.
Prerequisites
-
You have created a backup file for the workspace.
-
You are logged in as a Palette user that has the permission to restore workspaces. For more information, refer to Permissions.
-
The clusters you want to restore are healthy and available.
Procedure
-
Log in to Palette.
-
In the drop-down Menu at the top of the page, choose the project that has your workspace.
-
On the left Main Menu, click Workspaces.
-
Click on the workspace you want to restore.
-
Click on Backups to switch to the backup tab.
-
Click on a backup file you want to restore from.
-
You have the following options for restoring the backup.
Option Description Include Cluster Resources Check the box to restore all the cluster scoped resources. Preserve Node Ports Check the box to preserve ports for the node port service in the cluster. Restore PVs Check the box to restore the persistent volumes. -
Click Restore Backup.
Validate
-
Log in to Palette.
-
In the drop-down Menu at the top of the page, choose the project that has your workspace.
-
On the left Main Menu, click Workspaces.
-
Click on the workspace you restored.
-
Ensure that the result of the restore was successful.