Cluster Backup Wizard
The Cluster Backup Wizard allows you to create and edit Kubernetes backup jobs. It consists of several steps, not all of which will appear in all cases. You can jump back and forth between steps by clicking on the step names on the left-hand side of the wizard.
Defining a Kubernetes backup job
In the Cluster step of the Kubernetes backup wizard you must select which cluster to back up from the list of active clusters. Note that depending on how you reached the wizard, the source cluster may already be selected for you. In that case, the wizard will open on the next step. After choosing a cluster, click Next.
In the Selections step, you choose exactly what will be backed up using the following options:
- Namespaces
Select either Full Cluster or Select Namespaces. Choosing Select Namespaces will prompt you to select the specific namespaces to include in the backup. Choosing Full Cluster (the default) will include all namespaces. Choosing Full Cluster and then Exclude namespaces will allow you to exclude specific namespaces.
- Select resource types (optional)
Allows you to back up only specific Kubernetes resources types. Leave this option off to back up all resources regardless of type. Enable it to select one or more resource types to back up. You can select common resource types from the drop-down list, or type in the names of custom resources. You can also toggle the “Exclude” option to back up all resource types except for the selected types. “Include” is the default.
- Select labels (optional)
Enter key-value pairs to specify the labels for the object that you want to protect in the cluster.
Tip
If you enter multiple label selectors separated by spaces in the Select Labels field, the relationship between them is assumed to be logical AND. So if you enter
a:b c:d
, it means thata
must equalb
ANDc
must equald
in order for the selector to match.CloudCasa will also allow you to enter a single key with multiple comma-separated values, and the relationship between these is assumed to be logical OR. So entering
a:b,c
means thata
must equalb
ORc
. These can be combined, so enteringa:b,c x:y
means thata
must equalb
ORc
ANDx
must equaly
. That’s equivalent to(a == b || a == c) && x == y
for you C lovers out there. Note that OR is not currently possible between different keys.- Include Persistent Volumes
Enable this option to back up Kubernetes Persistent Volumes in the selected namespaces. It is on by default.
- Protect PVs using
If Include Persistent Volumes is enabled, you will be given a choice of how to protect your PVs. You can select Snapshot only or Backup to object storage (formerly Snapshot and copy).
If you select Snapshot only, PVs will be protected using only local snapshots. Snapshots are fast to create and fast to restore, but they are often not sufficient protection against all types of failures. Also, not all volume types support snapshots.
If you select Backup to object storage your PV data will be copied off to external object storage. Other options are provided that control how this is done (see below). Backup to object storage is the default, since this is the recommended method in most cases.
No matter which method you select for protecting your PVs, resource data and cloud metadata is always sent to external storage.
- Snapshot PVs before backup where possible
Create snapshots of PVs that support them, and back up to object storage from the snapshots for consistency. This should generally be left enabled (the default) unless you experience problems with snapshot creation.
- Back up directly from all PVs not snapshotted
All PVs not snapshotted will be backed up directly. This should generally be left enabled (the default) unless you do not wish to back up volumes which do not support snapshots.
- Configure backup method by storage class (Advanced)
Allows you to manually select the backup method for each storage class defined in your cluster. The available methods are:
Read data from snapshot
Read data from PVC
Read data from underlying host volume
Skip
- Preserve snapshots after backup
This option, which is only available if “Backup to object storage” is selected and either “Snapshot PVs before backup where possible” or “Configure backup method by storage class” is chosen, allows you to keep the snapshots created during the backup process as an additional form or protection. It will result in the creation of an additional recovery point with type snapshot. The snapshots may have a different retention period than the backups.
Tip
In CloudCasa, there are two basic data protection methods for persistent volumes:
- Copy (Backup)
Copying PV data from a cluster to external storage, that is, either CloudCasa Storage or user-supplied storage such as your own Amazon S3 bucket. For more information about CloudCasa Storage, see Service Plans and Settings; or, for user-supplied storage, see Storage.
- Snapshot
Create a snapshot in local storage. This generally uses the CSI snapshot interface, but some legacy snapshot methods are supported as well.
- Advanced Options
Opening the Advanced options section will allow you to set the following advanced options:
- Destination storage for copy (for Backup to object storage only)
Select one of the following options:
- Inherit from cluster preferences
Use the default destination for the cluster that you specified in the Overview of Clusters page.
- CloudCasa Storage
Use CloudCasa Storage. Select the cloud provider and region.
- User-provided Storage
Select one of the user-defined object storage endpoints that you registered in the Storage page.
- Concurrent PVs (for Backup to object storage only)
Select the maximum number of PVs that will be backed up at once. The allowed range is between 1 and 16. The default is 2 PVs.
- Total concurrent files (for Backup to object storage only)
Sets the number of files that will be backed up or restored concurrently across ALL PVs.
- Max transfer rate per PV (for Backup to object storage only)
Specifies the maximum transfer rate for the data transfer between each PV and the destination storage during the backup job, in MB per second. Leave this field blank to set no limit. The default value is blank for “Unlimited”.
- Data mover pod timeout (for Backup to object storage only)
Time that the agent will wait for the data mover pod to start. If using snapshots, the timer will start once snapshot PVCs are bound. This should only need to be changed in special cases, for example when backing up Longhorn volumes using snapshots.
- Data mover memory limit (for Backup to object storage only)
Controls the maximum amount of memory that the data mover pod will be permitted to allocate during the backup process. This can be set between 512 MB and 8 GB. Higher values may be required if large settings for PV and/or file parallelism are used. By default it is set to 1024 MB.
- Exclude unattached PVCs (for Backup to object storage only)
By default, CloudCasa will include unattached PVCs in backups. Enabling this option will cause unattached PVCs to be excluded from the backup. Be aware that there is currently no option to restore unattached PVCs from Backup to object storage backups.
- Enable storage class mapping for PV snapshots mounted during backup (for Backup to object storage only)
This option allows you to use different storage classes when PV snapshots are mounted for copying the data off during Backup to object storage backup operations. This may be useful, for example, to indicate to your storage system that less replicas or different parameters should be used for these transient volumes than for normal production volumes. By default, the storage class of the original source volume will be used.
Note: You must specify a storage class that uses the same CSI driver as that used by the original storage class in order for mounting of snapshots to succeed. The new storage class should only differ in parameters such as number of replicas.
- CSI snapshot timeout
The amount of time the agent will wait for a PV snapshot to become ready when mounting. The default is 10 minutes, which should be adequate for most applications. PVs using certain storage systems such as Longhorn may require this to be increased.
In the App Hooks step you can choose to add pre-backup application hooks, post-backup application hooks, or both.
See also
For more information about App Hooks, see App Hooks.
In the Policy step, you can choose a policy for the backup. Policies define schedules and retention periods for your backups as well as retention options such as SafeLock. You can see your policies under Configuration/Policies. If you need to define a new policy you can click Add policy + at the top right. If you don’t select a policy, your backup won’t be scheduled automatically, but can be run manually on an ad-hoc basis. Click Next to proceed.
See also
For more information about policies, see Policies.
Review the Summary of the backup settings to verify that they are correct. In this step you can also enter the following:
- Backup name
You must assign a name for the backup job.
- Add Tags (optional)
Key-value pairs that you can use to help identify and manage the backup job in CloudCasa.
If you didn’t select a policy, you’ll be given the option to select Run now to immediately start an ad-hoc backup. Note that in this case you must separately specify a retention period for this ad-hoc run. When you’re done, click Create or Create & Run.
Your new backup job is defined! If you selected the “Run now” option, it will start to execute immediately. If not, you can run it manually from the Dashboard or the Cluster/Backups page. We recommend always doing a test run of newly defined backup jobs.
Defining a Kubernetes Velero backup job
Defining a Velero backup job using CloudCasa for Velero is nearly identical to the above procedure. The differences are the following:
In the selections step, Type Snapshot or Copy can be selected, but not Snapshot and Copy, as Velero does not support this. The additional option Follow pod annotations is provided. This allows the pod annotations to control copy operations. Also, not all options appear under Advanced options, since some do not apply.
The Policy step will not appear, since Velero does not support global policies. Instead, a Velero Settings step appears which allows entry of the following:
Include cluster scoped resources - Auto (default), Yes, or No
Backup Storage Location
Volume Snapshot Locations
Schedule (optional) - If not provided, backup will run immediately.
Retention days - The number of days that recovery points will be retained.
On the summary page, the Edit YAML button allows you to edit the YAML for the backup definition before saving it.