Is it possible to create a VolumeSnapshot in kubernetes from an existing snapshot in digitalocean?
e-nikolov opened this issue · 5 comments
pod-single-existing-volume shows how to add an existing volume as a PersistentVolume by setting an annotation:
annotations:
# fake it by indicating this is provisioned dynamically, so the system
# works properly
pv.kubernetes.io/provisioned-by: dobs.csi.digitalocean.com
But I haven't found a way to do the same for an existing snapshot. Is it currently possible to do that?
Hey @e-nikolov 👋
I wasn't sure myself whether importing snapshots is possible. After reading through the snapshot-announcing blog post again and playing around with it though, I can say that it does work. 🎉
Instead of outlining the necessary steps in this issue, I decided to extend our examples right away. I'd appreciate if you could have a look at the PR referenced above and let me know if it works for you.
Thanks!
Hi, it's possible that I did something wrong, but after following this, the imported snapshot in k8s has its restoreSize set to ~800GB when in the DigitalOcean control panel it's only 300GB.
Have you seen such a difference when you did it? I also tried manually setting the restoreSize, but it got overridden.
@e-nikolov I suppose you set resources.requests.storage
on the PVC accordingly?
@timoreimann If you mean the PVC created from the snapshot, yes I did, but it told me the minimum was 800GB.
Sorry for the long delay -- turned out this issue came with a rat's tail of problems. Specifically, we did not return the minimum size of the snapshot correctly (#298) and had a bug in our implementation to fetch the right snapshot (#299). You were definitely affected by the former issue.
Master has these issues fixed, and the import guide is now working according to my tests.
We plan to make a CSI release soonish, so please keep an eye out on our releases page. Once you're running on what is now reflected in the master branch, you should be able to import snapshots properly.