Skip to content
Velero plugin for backup/restore of cStor volumes
Branch: master
Clone or download
mynktl and vishnuitta chore(readme): updating support matrix with openebs 1.0.0 release (#19)
Signed-off-by: mayank <mayank.patel@mayadata.io>
Latest commit cdcdb31 Jun 25, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example feat(volumesnapshotlocation): support for MinIO object store (#16) May 22, 2019
pkg fix(restore): restore issue for multiple volumes (#18) May 29, 2019
velero-blockstore-cstor feat(volumesnapshotlocation): support for MinIO object store (#16) May 22, 2019
vendor feat(volumesnapshotlocation): support for MinIO object store (#16) May 22, 2019
.gitignore
.travis.yml feat(ci): Adding recipients for travis build (#5) May 8, 2019
Dockerfile feat(velero-plugin) : Adding support for velero:v0.11.0 May 15, 2019
Gopkg.lock feat(volumesnapshotlocation): support for MinIO object store (#16) May 22, 2019
Gopkg.toml feat(volumesnapshotlocation): support for MinIO object store (#16) May 22, 2019
LICENSE Initial commit Dec 17, 2018
Makefile feat(velero-plugin) : Adding support for velero:v0.11.0 May 15, 2019
README.md chore(readme): updating support matrix with openebs 1.0.0 release (#19) Jun 25, 2019
metalinter.config feat(ci): adding travis build support (#4) May 7, 2019
push feat(ci): Adding recipients for travis build (#5) May 8, 2019

README.md

Overview

Build Status Go Report

Velero is a utility to back up and restore your Kubernetes resource and persistent volumes.

To do backup/restore of OpenEBS CStor volumes through Velero utility, you need to install and configure OpenEBS velero-plugin.

Prerequisite for velero-plugin

Specific version of Velero needs to be installed as per the compatibility matrix with OpenEBS versions.

For installation steps of Velero, visit https://velero.io.

For installation steps of OpenEBS, visit https://github.com/openebs/openebs/releases.

Installation of velero-plugin

Run the following command to install OpenEBS velero-plugin

velero plugin add openebs/velero-plugin:ci

This command will add an init container to Velero deployment to install the OpenEBS velero-plugin.

Taking backup of CStor volume data through the Velero

To take a backup of CStor volume through Velero, configure VolumeSnapshotLocation with provider openebs.io/cstor-blockstore. Sample yaml file for volumesnapshotlocation can be found at example/06-volumesnapshotlocation.yaml.

spec:
  provider: openebs.io/cstor-blockstore
  config:
    bucket: <YOUR_BUCKET>
    prefix: <PREFIX_FOR_BACKUP_NAME>
    provider: <GCP_OR_AWS>
    region: <AWS_REGION>

You can configure a backup storage location(BackupStorageLocation) in similar way. Currently supported volumesnapshotlocations for velero-plugin are AWS, GCP and MinIO.

Managing Backups

Once the volumesnapshot location is configured, you can create the backup/restore of your CStor persistent storage volume.

Creating a backup

To back up data of all your applications in the default namespace, run the following command:

velero backup create defaultbackup --include-namespaces=default --snapshot-volumes --volume-snapshot-locations=<SNAPSHOT_LOCATION>

SNAPSHOT_LOCATION should be the same as you configured by using example/06-volumesnapshotlocation.yaml.

You can check the status of backup using the following command:

velero backup get

Above command will list out the all backups you created. Sample output of the above command is mentioned below :

NAME                STATUS      CREATED                         EXPIRES   STORAGE LOCATION   SELECTOR
defaultbackup       Completed   2019-05-09 17:08:41 +0530 IST   26d       gcp                <none>

Once the backup is completed you should see the backup marked as Completed.

Creating a restore from backup

To restore data from backup, run the following command:

velero restore create --from-backup backup_name --restore-volumes=true

With above command, plugin will create a CStor volume and the data from backup will be restored on this newly created volume.

Note: You need to mention --restore-volumes=true while doing a restore.

You can check the status of restore using the following command:

velero restore get

Above command will list out the all restores you created. Sample output of the above command is mentioned below :

NAME                           BACKUP          STATUS      WARNINGS   ERRORS    CREATED                         SELECTOR
defaultbackup-20190513113453   defaultbackup   Completed   0          0         2019-05-13 11:34:55 +0530 IST   <none>

Once the restore is completed you should see the restore marked as Completed.

Note: After restore is completed, you need to set targetip for the volume in pool pod. Steps to update targetip is as follow:

1. kubectl exec -it <POOL_POD> -c cstor-pool -n openebs -- bash
2. zfs set io.openebs:targetip=<PVC SERVICE IP> <POOL_NAME/VOLUME_NAME>

Creating a scheduled backup (or incremental backup for CStor volume)

OpenEBS velero-plugin provides incremental backup support for CStor persistent volumes. To create an incremental backup(or scheduled backup), run the following command:

velero create schedule newschedule --schedule="*/5 * * * *" --snapshot-volumes --include-namespaces=default --volume-snapshot-locations=<SNAPSHOT_LOCATION>

SNAPSHOT_LOCATION should be the same as you configured by using example/06-volumesnapshotlocation.yaml.

You can check the status of scheduled using the following command:

velero schedule get

It will list all the schedule you created. Sample output of the above command is as below:

NAME            STATUS    CREATED                         SCHEDULE      BACKUP TTL   LAST BACKUP   SELECTOR
newschedule     Enabled   2019-05-13 15:15:39 +0530 IST   */5 * * * *   720h0m0s     2m ago        <none>

During the first backup iteration of a schedule, full data of the volume will be backed up. For later backup iterations of a schedule, only modified or new data from the previous iteration will be backed up.

To restore from a schedule

Since backups taken are incremental for a schedule, order of restoring data is important. You need to restore data in the order of the backups created.

For example, below are the available backups for a schedule:

NAME                   STATUS      CREATED                         EXPIRES   STORAGE LOCATION   SELECTOR
sched-20190513104034   Completed   2019-05-13 16:10:34 +0530 IST   29d       gcp                <none>
sched-20190513103534   Completed   2019-05-13 16:05:34 +0530 IST   29d       gcp                <none>
sched-20190513103034   Completed   2019-05-13 16:00:34 +0530 IST   29d       gcp                <none>

Restore of data need to be done in following way:

velero restore create --from-backup sched-20190513103034 --restore-volumes=true
velero restore create --from-backup sched-20190513103534 --restore-volumes=true
velero restore create --from-backup sched-20190513104034 --restore-volumes=true

Compatibility matrix

Image Codebase Velero v0.10.0 Velero v0.11.0 Velero v1.0.0 OpenEBS/Maya release
velero-plugin:0.9.0-RC2 v0.9.x 0.9.0-RC2
velero-plugin:0.9.0 v0.9.x 0.9
velero-plugin:1.0.0-velero_1.0.0 1.0.0-velero_1.0.0 1.0.0
velero-plugin:ci master >0.9

Plugin images are available at quay.io and hub.docker.com.

You can’t perform that action at this time.