gluster / gluster-csi-driver

DEPRECATED: Gluster Container Storage Interface (CSI) driver
GNU Lesser General Public License v3.0
57 stars 30 forks source link

Add efficient volume cloning support #100

Open nixpanic opened 6 years ago

nixpanic commented 6 years ago

Describe the feature you'd like to have. Support for the new CLONE_VOLUME operation, which can take a VolumeSource (not snapshot) as origin to clone. This will be used by kubevirt/cdi.

What is the value to the end user? (why is it a priority?) Efficient cloning is an important feature for KuneVirt, and we would like Gluster to be one of the commonly used storage backends.

How will we know we have a good solution? (acceptance criteria) Standard CSI CLONE_VOLUME requests should be handled correctly.

humblec commented 6 years ago

/assign @humblec

Madhu-1 commented 6 years ago

@nixpanic the data source is added for the spec, I don't see a code changes in the external-provisioner

This is the template i used for testing, am i missing anything here?

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: glusterfs-pv-restore
spec:
  storageClassName: glusterfs-csi
  dataSource:
    name: gcs-example-volume
    kind: VolumeSource
    apiGroup: snapshot.storage.k8s.io 
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 5Gi

[root@master ~]# kubectl create -f vol-csi.yaml The PersistentVolumeClaim "glusterfs-pv-restore" is invalid: spec.dataSource: Unsupported value: "VolumeContentSource.snapshot.storage.k8s.io": supported values: "VolumeSnapshot.snapshot.storage.k8s.io" [root@master ~]# vi vol-csi.yaml [root@master ~]# kubectl create -f vol-csi.yaml The PersistentVolumeClaim "glusterfs-pv-restore" is invalid: spec.dataSource: Unsupported value: "VolumeSource.snapshot.storage.k8s.io": supported values: "VolumeSnapshot.snapshot.storage.k8s.io"

[root@master ~]# kubectl explain pvc.spec.dataSource
KIND:     PersistentVolumeClaim
VERSION:  v1

RESOURCE: dataSource <Object>

DESCRIPTION:
     This field requires the VolumeSnapshotDataSource alpha feature gate to be
     enabled and currently VolumeSnapshot is the only supported data source. If
     the provisioner can support VolumeSnapshot data source, it will create a
     new volume and data will be restored to the volume at the same time. If the
     provisioner does not support VolumeSnapshot data source, volume will not be
     created and the failure will be reported as an event. In the future, we
     plan to support more data source types and the behavior of the provisioner
     may change.

     TypedLocalObjectReference contains enough information to let you locate the
     typed referenced object inside the same namespace.

FIELDS:
   apiGroup <string>
     APIGroup is the group for the resource being referenced. If APIGroup is not
     specified, the specified Kind must be in the core API group. For any other
     third-party types, APIGroup is required.

   kind <string> -required-
     Kind is the type of resource being referenced

   name <string> -required-
     Name is the name of resource being referenced

kubernetes used for testing [root@master ~]# kubectl version Client Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.0-beta.2", GitCommit:"a4ff09c41589c48547e04f85391aa5610ebe0e17", GitTreeState:"clean", BuildDate:"2018-11-23T00:55:34Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.0-beta.2", GitCommit:"a4ff09c41589c48547e04f85391aa5610ebe0e17", GitTreeState:"clean", BuildDate:"2018-11-23T00:47:47Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}

humblec commented 6 years ago

Thanks @Madhu-1 , I have opened an issue in external attacher repo https://github.com/kubernetes-csi/external-provisioner/issues/172

Madhu-1 commented 5 years ago

moved out of GCS/0.4 as this cannot be completed as we need smart cloning support in sidecar containers.