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

Resize PVC is not working even if the storage class allows volume expansion #4

Closed
Madhan-SWE opened this issue Oct 19, 2021 · 3 comments · Fixed by #12
Closed

Resize PVC is not working even if the storage class allows volume expansion #4

Madhan-SWE opened this issue Oct 19, 2021 · 3 comments · Fixed by #12
Assignees

Comments

@Madhan-SWE
Copy link

Created a storage class with volume expansion support with below yaml.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: powervs-sc
provisioner: powervs.csi.ibm.com
volumeBindingMode: WaitForFirstConsumer
parameters:
  type: tier3
  csi.storage.k8s.io/fstype: xfs
allowVolumeExpansion: true

Created a pvc using the above storage class

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: powervs-claim
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: powervs-sc
  resources:
    requests:
      storage: 1Gi

PVC details

[root@madhan-multinode-kube-master powervs-csi-driver]# kubectl get pvc
NAME            STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
powervs-claim   Bound    pvc-a91b920f-fac0-43ba-adeb-ce85a7530c8a   1Gi        RWO            powervs-sc     11d

Edited the PVC as below:

[root@madhan-multinode-kube-master powervs-csi-driver]# kubectl edit pvc powervs-claim

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"name":"powervs-claim","namespace":"kube-system"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"1Gi"}},"storageClassName":"powervs-sc"}}
    pv.kubernetes.io/bind-completed: "yes"
    pv.kubernetes.io/bound-by-controller: "yes"
    volume.beta.kubernetes.io/storage-provisioner: powervs.csi.ibm.com
    volume.kubernetes.io/selected-node: madhan-multinode-kube-worker-1
  creationTimestamp: "2021-10-07T09:17:27Z"
  finalizers:
  - kubernetes.io/pvc-protection
  name: powervs-claim
  namespace: kube-system
  resourceVersion: "2904572"
  selfLink: /api/v1/namespaces/kube-system/persistentvolumeclaims/powervs-claim
  uid: a91b920f-fac0-43ba-adeb-ce85a7530c8a
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi
  storageClassName: powervs-sc
  volumeMode: Filesystem
  volumeName: pvc-a91b920f-fac0-43ba-adeb-ce85a7530c8a
status:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  phase: Bound

Changed spec.resources.requests.storage to "2Gi".

[root@madhan-multinode-kube-master powervs-csi-driver]# kubectl edit pvc powervs-claim
persistentvolumeclaim/powervs-claim edited
[root@madhan-multinode-kube-master powervs-csi-driver]# kubectl get pvc powervs-claim
NAME            STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
powervs-claim   Bound    pvc-a91b920f-fac0-43ba-adeb-ce85a7530c8a   1Gi        RWO            powervs-sc     11d

But, the size is not changed.
ControllerExpandVolume method is not called from power vs CSI Driver.

@Madhan-SWE
Copy link
Author

/assign

@Madhan-SWE
Copy link
Author

Since the resizer container was missing in the controller pod, the controllerExpandVolume method was not called at all.

  • Added resizer container as part of controller service
  • Added cluster role and cluster role binding for the resizer

After these changes, controllerExpandVolume method was called successfully whenever there is an edit pvc action.
But, the expansion was failing as the size of the PVC was passed in bytes to the IBM cloud rest APIs.

Since the IBM cloud API is expecting the size value in GigaBytes, the conversion is added.
Volume expansion is successful after the conversion fixes.

@mkumatag
Copy link
Member

Since the IBM cloud API is expecting the size value in GigaBytes, the conversion is added.
Volume expansion is successful after the conversion fixes.

good to hear that..

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

Successfully merging a pull request may close this issue.

2 participants