metal-stack / csi-driver-lvm

MIT License
121 stars 26 forks source link

consider support of csi snapshots #27

Closed majst01 closed 3 years ago

majst01 commented 3 years ago

Since k8s v1.17.x csi snapshots are available and they will become GA in 1.20.x. https://kubernetes.io/blog/2019/12/09/kubernetes-1-17-feature-cis-volume-snapshot-beta/

Our LVM based approach enables us to support this by leveraging the lvm snapshot functionality.

mwennrich commented 3 years ago

The use case for snapshots is, to create a pvc from an existing snapshot via dataSource. Example:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: restore-pvc
spec:
  storageClassName: csi-hostpath-sc
  dataSource:
    name: new-snapshot-test
    kind: VolumeSnapshot
    apiGroup: snapshot.storage.k8s.io

But for local volumes we have to use volumeBindingMode: WaitForFirstConsumer, so this doesn't work if the scheduler schedules the first consumer pod to another worker node, since on this worker node that snapshot isn't available. There are no "local snapshots" in k8s ...

majst01 commented 3 years ago

OK, i thought the use case would be for backups in the first place. Thanks for clarification, closing.