openebs-archive / dynamic-nfs-provisioner

Operator for dynamically provisioning an NFS server on any Kubernetes Persistent Volume. Also creates an NFS volume on the dynamically provisioned server for enabling Kubernetes RWX volumes.
Apache License 2.0
169 stars 58 forks source link

Add support for backend cloned PVC #134

Open silverhandy opened 2 years ago

silverhandy commented 2 years ago

Describe the problem/challenge you have There is a requirement that want to provision nfs PV by clone an original backend PVC (the backend PVC CSI should support snapshot/clone, for example, LocalPV lvm or cStor).

Describe the solution you'd like In the StorageClass yaml file, add dataSource annotation, then provisioner create backend PVC by clone original PVC by dataSource.

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: openebs-rwx
  annotations:
    openebs.io/cas-type: nfsrwx
    cas.openebs.io/config: |
      - name: NFSServerType
        value: "kernel"
      - name: BackendStorageClass
        value: "openebs-hostpath"
      - name: dataSource
        value: "backend-origin-pvc"

Anything else you would like to add: If we can directly add the snapshot/clone support for nfs PVC, that is fine also.

Environment:

Vote on this issue!

This is an invitation to the OpenEBS community to vote on issues.
Use the "reaction smiley face" up to the right of this comment to vote.

oz123 commented 7 months ago

This would be extremely useful. Right now, if I want to upgrade a node running the NFS node or reboot it, I need to do the following steps:

Create a new NFS PVC. Find where the PVC is running. Copy the data over from the active node to the new physical volume.

This can be automated OFC. However, I think this would better be done in this operator directly. If someone is intersted in sponsoring the development of this feature together with me, please leave a comment.