Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] provide VolumeContext in DeleteVolume, ControllerExpandVolume request #507

Closed
andyzhangx opened this issue Apr 18, 2022 · 6 comments

Comments

@andyzhangx
Copy link
Contributor

andyzhangx commented Apr 18, 2022

VolumeContext should also be in DeleteVolumeRequest, currently we have to encoding all info as a volumeID, now the volumeID is longer and longer, that's really ugly design. if there is VolumeContext in DeleteVolumeRequest, we could inject volume.Spec.ClaimRef.Namespace in external-provisioner by providing flag --extra-delete-metadata , similar to --extra-create-metadata: https://github.com/kubernetes-csi/external-provisioner#recommended-optional-arguments.

@andyzhangx andyzhangx changed the title [feature request] provide VolumeContext in DeleteVolume request [feature request] provide VolumeContext in DeleteVolume, ControllerExpandVolume request Apr 19, 2022
@jdef
Copy link
Member

jdef commented Apr 19, 2022

please no. we've discussed this all before, and it should be possible to delete a volume if CO loses its mind and vol metadata is lost. if vol ID is getting "longer and longer" then this suggests arch/design issues elsewhere (because non-identifying information is being stuffed into the ID field for convenience).

@andyzhangx
Copy link
Contributor Author

please no. we've discussed this all before, and it should be possible to delete a volume if CO loses its mind and vol metadata is lost. if vol ID is getting "longer and longer" then this suggests arch/design issues elsewhere (because non-identifying information is being stuffed into the ID field for convenience).

@jdef we need secretNamespace in DeleteVolume, so what's your suggestion in this case, append secretNamespace into volumeID?

@jdef
Copy link
Member

jdef commented Apr 19, 2022

@andyzhangx maybe i misunderstand the use case. if you need secrets to delete a volume, doesn't DeleteVolumeRequest already offer that API? CSI doesn't know about k8s namespaces, nor should it. that said, if namespace is a reasonable (read: essential) coordinate for locating a volume in some storage backend, then it probably belongs in vol ID.

@andyzhangx
Copy link
Contributor Author

@andyzhangx maybe i misunderstand the use case. if you need secrets to delete a volume, doesn't DeleteVolumeRequest already offer that API? CSI doesn't know about k8s namespaces, nor should it. that said, if namespace is a reasonable (read: essential) coordinate for locating a volume in some storage backend, then it probably belongs in vol ID.

@jdef actually external-provisioner would inject pvcNamespace now on CreateVolume by using --extra-create-metadata: https://github.com/kubernetes-csi/external-provisioner#recommended-optional-arguments, I would like to get same functionality for DeleteVolume, current workaround is append pvcNamespace to volumeID, now our volumeID already has resoucegroup#accountname#sharename#uuid, this would make volumeID longer and longer, and also we need to consider volumeID format comparability issue. To make life easier, why not providing a VolumeContext in DeleteVolume, so CSI driver would write any data to VolumeContext, that won't change the volumeID format, it would make the design clearer. Next time if we would like to inject other metadata from external-provisioner, we could just write data to VolumeContext, I think that would benefit a lot CSI drivers.

@bswartz
Copy link
Contributor

bswartz commented Apr 19, 2022

DeleteVolume is expected to succeed without a volume context because it might be called as part of an emergency cleanup operation, when the CO has lost other relevant information and has only the volume ID. The alternative is that DeleteVolume might not get called at all, and resources could leak, in a scenario where the CO has lost data. The spec writers decided it was preferable to put the responsibility on the SP for retaining enough relevant knowledge so that it can delete a volume given nothing but the volume ID and delete secrets.

@andyzhangx
Copy link
Contributor Author

@bswartz thanks for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants