You are looking at the documentation of a prior release. To read the documentation of the latest release, please
visit here.
Stand-alone Volume Backup Overview
This guide will give you an overview of how stand-alone volume backup and restore process works in KubeStash.
How Backup Works
The following diagram shows how KubeStash takes backup of a stand-alone volume. Open the image in a new tab to see the enlarged version.
The backup process consists of the following steps:
At first, a user creates a
Secret. This secret holds the credentials to access the backend where the backed up data will be stored.Then, she creates a
BackupStoragecustom resource that specifies the backend information, along with theSecretcontaining the credentials needed to access the backend.KubeStash operator watches for
BackupStoragecustom resources. When it finds aBackupStorageobject, it initializes theBackupStorageby uploading themetadata.yamlfile to the target storage.Then, she creates a
BackupConfigurationcustom resource, targeting a standalone volume. TheBackupConfigurationobject specifies theRepositorypointing to aBackupStoragethat contains backend information, indicating where to upload backup data. It also defines theAddoninformation with a specified task and their configuration parameters to be used for backing up the volumes.KubeStash operator watches for
BackupConfigurationcustom resources.Once the KubeStash operator finds a
BackupConfigurationobject, it createsRepositorywith the information specified in the BackupConfiguration.KubeStash operator watches for
Repositorycustom resources. When it finds theRepositoryobject, it InitializesRepositoryby uploadingrepository.yamlfile to thespec.sessions[*].repositories[*].directorypath specified in theBackupConfiguration.Then, it creates a
CronJobfor each session with the schedule specified inBackupConfigurationto trigger backup periodically.On the next scheduled slot, the
CronJobtriggers a backup by creating aBackupSessioncustom resource.KubeStash operator watches for
BackupSessioncustom resources.When it finds a
BackupSessionobject, it creates aSnapshotcustom resource for eachRepositoryspecified in the respective session of theBackupConfiguration.Then, it resolves the respective
AddonandFunctionand prepares a backupJobdefinition.Then, it mounts the targeted stand-alone volume into the
Joband creates it.The
Jobtakes backup of the targeted stand-alone volume.After the backup process is completed, the backup
Job(s) updates thestatus.components[*]field of theSnapshotresources with backup information of the target volume.
How Restore Works
The following diagram shows how KubeStash restores backed up data into a stand-alone volume. Open the image in a new tab to see the enlarged version.
The restore process consists of the following steps:
At first, a user creates a stand-alone volume where the data will be restored or the user can use the same stand-alone volume.
Then, she creates a
RestoreSessioncustom resource, specifies the target stand-alone volume where the backed-up data will be restored, theRepositoryobject that points to aBackupStoragethat holds backend information, and the targetSnapshot, which will be restored. It also specifies theAddoninfo with task to use to restore the volume.KubeStash operator watches for
RestoreSessioncustom resources.Once it finds a
RestoreSessionobject, it resolves the respectiveAddonandFunctionand prepares a restore Job definition.Then, it mounts the targeted volume and creates a Restore
Job.The restore
Jobrestores the backed-up data into the targeted volume.Finally, when the restore process is completed, the restore
Jobupdates thestatus.components[*]field of theRestoreSessionwith restore information of the target volume.
Next Steps
- Learn how to take backup and restore a stand-alone PVC from here.






