container-storage-interface / spec

Container Storage Interface (CSI) Specification.
Apache License 2.0
1.36k stars 373 forks source link

Add Resize Support in the CSI Spec #231

Closed orainxiong closed 6 years ago

orainxiong commented 6 years ago

To now, resizing is available with those in-tree storage provisioners:

In order to enable this feature, we should set feature gate ExpandPersistentVolumes true and turn on PersistentVolumeClaimResize admission plugin.Once PersistentVolumeClaimResize has been enable, resizing will be allowed by Storage Class whose allowVolumeExpansion field is set to true.

Unfortunately, it is unavailable for CSI. This document proposes new functions to support volume resizing in Kubernetes with CSI and presents a detailed design for implementation.

jdef commented 6 years ago

Related proposal #222

jdef commented 6 years ago

Was this intended to provide context for the existing PR that's already under discussion?

On Fri, May 11, 2018 at 7:40 AM, orain notifications@github.com wrote:

To now, resizing is available with those in-tree storage provisioners:

  • gcePersistentDisk
  • awsElasticBlockStore
  • OpenStack Cinder
  • glusterfs
  • rbd

In order to enable this feature, we should set feature gate ExpandPersistentVolumes true and turn on PersistentVolumeClaimResize admission plugin.Once PersistentVolumeClaimResize has been enable, resizing will be allowed by Storage Class whose allowVolumeExpansion field is set to true.

Unfortunately, it is unavailable for CSI. This document https://docs.google.com/document/d/1kVrNwA2f4ite8_9QvCy-JQA_00hxGGMdER3I84dUDqQ/edit?usp=sharing proposes new functions to support volume resizing in Kubernetes with CSI and presents a detailed design for implementation.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/container-storage-interface/spec/issues/231, or mute the thread https://github.com/notifications/unsubscribe-auth/ACPVLLgfrIQW3mA56eEWr7CRcyAMTvE4ks5txXjHgaJpZM4T7VBP .

orainxiong commented 6 years ago

Thx for your reminding. Actually, The reason for this issue is I wanna extend CSI to making FCSan provisioner to support resizing. To implement this feature, It proposes to add 2 new controller service RPCs, including ControllerResizeVolume and RequiresFSResize, and a new node service RPC NodeResizeVolume. I have just finished reading #222 . It is very similar but not the same. I think it would be an efficient way to put both(this issue and #222 ) together.

gnufied commented 6 years ago

@orainxiong yeah I think both our proposals are pretty similar, except perhaps:

  1. I am explicitly calling everything ExpandVolume to avoid confusion that, this is about shrinking volumes.
  2. I did not implement RequiresFSResize because there is really no need. As author of volume expansion feature in Kubernetes and I would like to go back and drop this function from volume plugin interface. Instead, I have chosen to return this as a return value from controller expand volume. It is possible that I have missed some use case that will require RequiresFSResize, so please do correct me if I am wrong.
orainxiong commented 6 years ago

@gnufied

Thank you for your prompt reply.

I agree with you. Actually, it is clearer that ResizeVolume is broken up into ExpandVolume and ShrinkVolume. Although, It will introduce one more RPC call to support ShrinkVolume.

With regard to RequiresFSResize, I can't find a concrete use case immediately, but I think whether RequiresFSResize is needed depends on the implementation of storage providers in some cases.

Currently, resizing file system logic, default supporting ext3,ext4 and xfs, is implemented by ResizeFs within core kubernetes itself.

As far as I am concerned, there might be in some cases where storage providers wanna implement resizing file system logic themselves in the future. So that, It might be a more extensible way to introduce CSI Volume Plugin a another new RPC call to implement resizing file system.

In addition, it is also decoupled with resizing file system logic and core kubernetes.

More details, to fully support PV and PVC resizing feature, new controller service RPCs might include ExpandVolume, ShrinkVolume, RequiresFSResize and ResizeFs.

As mentioned above, the disadvantage of my proposal causes CSI spec more complicated but not too much.

Looking forward to your reply : - ).