ThinkParQ / beegfs-csi-driver

The BeeGFS Container Storage Interface (CSI) driver provides high performing and scalable storage for workloads running in Kubernetes. 📦 🐝
Apache License 2.0
65 stars 18 forks source link

Add support for expanding volumes #29

Closed soberlee97 closed 3 months ago

soberlee97 commented 4 months ago

I tried to use beegfs-csi to create a PVC, and then I expanded the capacity on the basis of this PVC. I found that it was not successful. Is expansion of PVC supported now?

ejweber commented 4 months ago

Hello @soberlee97.

The BeeGFS CSI driver does not implement ControllerExpandVolume or NodeExpandVolume, so expansion through the CSI flow is not currently possible.

https://github.com/ThinkParQ/beegfs-csi-driver/blob/8792f2a1c55c77e51054838638b052f975917498/pkg/beegfs/controllerserver.go#L380-L382 https://github.com/ThinkParQ/beegfs-csi-driver/blob/8792f2a1c55c77e51054838638b052f975917498/pkg/beegfs/nodeserver.go#L309-L311

It's been a while since I worked on the driver, so I'm a bit rusty on the details, but I'm wondering what your use case is here. IIRC, the "capacity" of a BeeGFS PVC doesn't have much real-world meaning. (https://github.com/ThinkParQ/beegfs-csi-driver/blob/master/docs/usage.md#capacity) It is quite possible for a workload to consume more space in a BeeGFS file system than its PVC requests.

soberlee97 commented 4 months ago

thank you for your answer,I create pvc for kubevirt to create virtual machine disk,I hope to expand my disk capacity when my disk capacity is not enough。Another problem is that I cannot clone pvc, this csi driver does not support it. For example, if I transfer the virtual machine image to a pvc, when I want to start the virtual machine, I may need to clone the image and reuse it in my newly created pvc.

soberlee97 commented 4 months ago

I tested it and found that the disk size of kubevirt's virtual machine is still determined by the request size of pvc. Although the size of pvc does not determine the actual capacity, the size of the disk in the virtual machine is still determined by the size of pvc.

iamjoemccormick commented 4 months ago

Hi @soberlee97,

As @ejweber stated the "capacity" of a BeeGFS PVC doesn't have any actual meaning (i.e, a user could request a 100GiB PVC and that space is neither guaranteed to them, nor or they limited to 100GiB).

If there are applications like kubevirt where expanding a volume would be helpful we could consider adding support for PVC expansion. From the driver and BeeGFS perspective this would be a "no-op", but this would allow the size of the PV/PVC objects in the K8s API to increase.

This wasn't terribly hard to implement so I submitted a PR with the proposed functionality. The only real drawback is that we need to start deploying the external-resizer sidecar along with the driver.

I tested it out on my system and it seems to work well, I'd appreciate any feedback/testing before I take additional steps to get it in a state it can be merged.

soberlee97 commented 4 months ago

thank u sir