Installation

The following directions will walk through the process of deploying VolSync.

Note

Volume snapshot and clone capabilities are required for some VolSync functionality. It is recommended that you use a CSI driver and StorageClass capable of snapshotting and cloning volumes.

There are several methods for installing VolSync. Choose the option that relates to your situation.

Warning

VolSync requires the Kubernetes snapshot controller to be installed within a cluster. If the controller is not deployed review the snapshot controller documentation https://github.com/kubernetes-csi/external-snapshotter.

Kubernetes & OpenShift

The recommended method for deploying VolSync is via its Helm chart.

# Add the Backube Helm repo
$ helm repo add backube https://backube.github.io/helm-charts/

# Deploy the chart in your cluster
$ helm install --create-namespace -n volsync-system volsync backube/volsync

Verify VolSync is running by checking the output of kubectl get deploy:

$ kubectl -n volsync-system get deploy/volsync
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
volsync   1/1     1            1           60s

Configuring CSI storage

To make the most of VolSync’s capabilities, it’s important that the volumes being replicated are using CSI-based storage drivers and that volume snapshotting is properly configured.

The currently configured StorageClasses can be viewed via:

$ kubectl get storageclasses

And the VolumeSnapshotClasses can be viewed via:

$ kubectl get volumesnapshotclasses

StorageClasses that carry the storageclass.kubernetes.io/is-default-class: "true" and VolumeSnapshotClasses that carry the snapshot.storage.kubernetes.io/is-default-class: "true" annotations are marked as the defaults on the cluster, meaning that if the class is not specified, these defaults will be used. However, it is not necessary to set or modify the default on your cluster since the classes can be specified directly in the ReplicationSource and ReplicationDestination objects used by VolSync.

Below are examples of configured CSI storage on a few different platforms. Your configuration may be different.

The EBS CSI driver on AWS-based clusters is usually named gp2-csi or gp3-csi.

# List StorageClasses
$ kubectl get storageclasses
NAME            PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
gp2 (default)   kubernetes.io/aws-ebs   Delete          WaitForFirstConsumer   true                   25m
gp2-csi         ebs.csi.aws.com         Delete          WaitForFirstConsumer   true                   25m
gp3-csi         ebs.csi.aws.com         Delete          WaitForFirstConsumer   true                   25m


# View details of the gp2-csi SC
$ kubectl get storageclass/gp2-csi -oyaml
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
   creationTimestamp: "2022-02-08T14:03:20Z"
   name: gp2-csi
   resourceVersion: "5288"
   uid: 24d2cee6-1346-4c3e-8742-39dec08e3e50
parameters:
   encrypted: "true"
   type: gp2
provisioner: ebs.csi.aws.com
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

You should also verify the presence of a corresponding VolumeSnapshotClass. Note that the name of the SC and VSC do not need to be the same, but the provisioner/driver should be.

# List VolumeSnapshotClasses
$ kubectl get volumesnapshotclasses
NAME          DRIVER            DELETIONPOLICY   AGE
csi-aws-vsc   ebs.csi.aws.com   Delete           23m


# View details of the csi-aws-vsc VSC
$ kubectl get volumesnapshotclass/csi-aws-vsc -oyaml
apiVersion: snapshot.storage.k8s.io/v1
deletionPolicy: Delete
driver: ebs.csi.aws.com
kind: VolumeSnapshotClass
metadata:
   annotations:
      snapshot.storage.kubernetes.io/is-default-class: "true"
   creationTimestamp: "2022-02-08T14:03:20Z"
   generation: 1
   name: csi-aws-vsc
   resourceVersion: "5301"
   uid: d990af7b-d2ae-4a49-8cfe-fd5ae93902df

Important

The AWS EBS CSI driver does not support volume cloning. When configuring replication with VolSync, be sure to choose a copyMethod of Snapshot for the source volume. Choosing Clone will not work.

Next, consider granting users access to VolSync’s custom resources so that they can manage their own data replication.

Continue to the usage docs.