Hi,I was going through the CSI snapshot spec, the design docs, examples, etc and few questions popped up in my mind.(1)
I'm wondering why did we have to use 2 controllers - snapshot controller and external snapshotter side car. Could we not have built the CSI snapshot functionality entirely in the external snapshotter sidecar? This would simplify debugging issues in one container. I may be missing something, so curios to know the answer.
(2)The same above link also says this - "For dynamic provisioning, the creation of a new VolumeSnapshot object referencing a VolumeSnapshotClass CRD object corresponding to this driver causes the snapshot controller to trigger the creation of a Kubernetes VolumeSnapshotContent object to represent the to-be-created new snapshot."
So, for volume provisioning, the PV is created only after the CSI driver creates the volume on the storage. So, if VolumeSnapshot/VolumeSnapshotContent is equivalent to PVC/PV, why is the same design not followed for VolumeSnapshot/VolumeSnapshotContent as well. I mean any reason why VolumeSnapshotContent is not created after the CSI driver creates the snapshot?
--
You received this message because you are subscribed to the Google Groups "container-storage-interface-community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to container-storage-interf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/container-storage-interface-community/6df57f90-f0ce-4d35-91be-9a885b7502f2n%40googlegroups.com.
Hi Sandeep,
(4) We want to clearly specify whether the snapshot is dynamically provisioned or pre-provisioned by looking at the VolumeSnapshot Spec Source field. Source must contain one of VolumeHandle or SnapshotHandle. For dynamic provisioning, we need to know the VolumeHandle to take the snapshot. For a pre-provisioned snapshot, a SnapshotHandle already exists. SnapshotHandle is also in VolumeSnapshot Status for both dynamically provisioned snapshot and pre-provisioned snapshot.
(1) Sidecars are supposed to be light-weight. We put most controller logic in the common snapshot controller. The CSI snapshotter sidecar is very small. Some users may want to deploy multiple CSI drivers. In this case, we only need to deploy one snapshot controller as that is shared among all CSI drivers. I agree that it is easier to debug if they are in the same controller. There are pros and cons with both options.
(2) The external-provisioner had the following fix to handle potential leak of volumes due to CSI driver timeouts.
https://github.com/kubernetes-csi/external-provisioner/pull/312
In the snapshot case, since VolumeSnapshotContent is created before the snapshot is created, we just re-queue any failed snapshot creation including timeouts and do retries. The logic is much simpler.
(3) Regarding quota for snapshot capacity, I looked at it a while ago. The PVC capacity quota is handled by in-tree logic. We can’t use similar logic for custom resources. I think we’ll need to add this support for CR first. I have not investigated it further. You are welcome to propose ideas.
Thanks,
To view this discussion on the web visit https://groups.google.com/d/msgid/container-storage-interface-community/629c9bc2-f285-45ed-9e3e-6d37789a2143n%40googlegroups.com.