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 the- Secretcontaining the credentials needed to access the backend.
- KubeStash operator watches for - BackupStoragecustom resources. When it finds a- BackupStorageobject, it initializes the- BackupStorageby uploading the- metadata.yamlfile to the target storage.
- Then, she creates a - BackupConfigurationcustom resource, targeting a standalone volume. The- BackupConfigurationobject specifies the- Repositorypointing to a- BackupStoragethat contains backend information, indicating where to upload backup data. It also defines the- Addoninformation 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 creates- Repositorywith the information specified in the BackupConfiguration.
- KubeStash operator watches for - Repositorycustom resources. When it finds the- Repositoryobject, it Initializes- Repositoryby uploading- repository.yamlfile to the- spec.sessions[*].repositories[*].directorypath specified in the- BackupConfiguration.
- Then, it creates a - CronJobfor each session with the schedule specified in- BackupConfigurationto trigger backup periodically.
- On the next scheduled slot, the - CronJobtriggers a backup by creating a- BackupSessioncustom resource.
- KubeStash operator watches for - BackupSessioncustom resources.
- When it finds a - BackupSessionobject, it creates a- Snapshotcustom resource for each- Repositoryspecified in the respective session of the- BackupConfiguration.
- Then, it resolves the respective - Addonand- Functionand prepares a backup- Jobdefinition.
- 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 the- status.components[*]field of the- Snapshotresources 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, the- Repositoryobject that points to a- BackupStoragethat holds backend information, and the target- Snapshot, which will be restored. It also specifies the- Addoninfo with task to use to restore the volume.
- KubeStash operator watches for - RestoreSessioncustom resources.
- Once it finds a - RestoreSessionobject, it resolves the respective- Addonand- Functionand 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 the- status.components[*]field of the- RestoreSessionwith restore information of the target volume.
Next Steps
- Learn how to take backup and restore a stand-alone PVC from here.







