Volume clone
The CSI Volume Cloning feature adds support for specifying existing PVCs in the dataSource
field to indicate a user would like to clone a Volume.
A Clone is defined as a duplicate of an existing Kubernetes Volume that can be consumed as any standard Volume would be. The only difference is that upon provisioning, rather than creating a "new" empty Volume, the back end device creates an exact duplicate of the specified Volume.
Refer to clone-doc for more info.
RBD Volume Cloning¶
In pvc-clone, dataSource
should be the name of the PVC
which is already created by RBD CSI driver. The dataSource
kind should be the PersistentVolumeClaim
. The storageClassName
can be any RBD storageclass (not necessarily same as Parent PVC)
Please note: * provisioner
must be the same for both the Parent PVC and the Clone PVC. * The non-encrypted PVC cannot be cloned to an encrypted one and vice-versa. * encrypted -> encrypted (possible) * non-encrypted -> non-encrypted (possible) * encrypted -> non-encrypted (not possible) * non-encrypted -> encrypted (not possible)
Create a new PVC Clone from the PVC
Verify RBD volume Clone PVC Creation¶
RBD clone resource Cleanup¶
To clean your cluster of the resources created by this example, run the following:
CephFS Volume Cloning¶
Volume Clone Prerequisites¶
- Requires Kubernetes v1.16+ which supports volume clone.
- Ceph-csi diver v3.1.0+ which supports volume clone.
In pvc-clone, dataSource
should be the name of the PVC
which is already created by CephFS CSI driver. The dataSource
kind should be the PersistentVolumeClaim
and also storageclass should be same as the source PVC
.
Create a new PVC Clone from the PVC
Verify CephFS volume Clone PVC Creation¶
CephFS clone resource Cleanup¶
To clean your cluster of the resources created by this example, run the following: