BlogKnowledge we want to share
How to backup OpenShift persistent volumes using vProtect
The latest vProtect release (3.7 update 2) has brought us the possibility of protecting the data used by Deployments/DeploymentConfigs on OpenShift clusters. In this article we will try to backup persistent volumes used by sample DeploymentConfig with MySQL.
Before we start, please make sure your OpenShift setup is prepared for vProtect – you can find the required steps [here] Let’s add our cluster to vProtect first.
Hypervisor Managers tab
Adding new OpenShift cluster
In the URL, please paste the current server’s REST API URL. You can obtain it by typing oc whoami – show-server in the terminal.In the username and password fields, please provide your SSH credentials to the master node (vProtect needs to read the [kubeconfig] to see your applications.) Click save, then index the hypervisor manager.
Indexed OpenShift hypervisor manager
Your worker nodes will now appear as Hypervisors in vProtect. Edit them and provide your SSH credentials. Now we can perform the backup.
Preparing MySQL backup
Successful MySQL backup
Now we can proceed to restoring the backup.
If the deployment already exists on the cluster, vProtect will create a new one with a generated name.
Restored MySQL backup
We have restored our data successfully. Now, what happens under the hood when we backup and restore our persistent volumes?
Before the backup starts, we pause the pods to maintain data consistency – this way we assure that nothing is modified during the backup. As a second step, vProtect creates a side pod, mounts the persistent volumes to it, then proceeds with copying the data, which is later moved to a backup destination of your choice.
During the restore process, vProtect just recreates your application from metadata files we backed up – then the data is copied back in. vProtect will require a precreated (or provisioned dynamically) available volume to do that.
Also, if you wish to rename your restored application, you can provide the name in the restored window (shown one screenshot above).
In summary, vProtect 3.7 update 2 brings you a flexible solution to protect your OpenShift data. Your backups can be stored in multiple backup destinations and restored on any OpenShift setup – with assured data consistency and in a simple and fast way to do it