Skip to content

Hostpath PV is resized but PVC is not when resizing offline #56

@xing-yang

Description

@xing-yang

When trying to expand a volume which is offline using the CSI hostpath driver, PV is expanded but PVC is not. There is probably a bug with CSI hostpath driver implementation, but external-resizer should do the check and prevent this from happening.

How to reproduce:

  1. I deployed csi-driver-host-path for k8s 1.14 using the script in the following location.
    https://github.com/kubernetes-csi/csi-driver-host-path/tree/master/deploy/kubernetes-1.14

  2. kubectl create -f https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/examples/csi-storageclass.yaml

  3. kubectl apply -f https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/examples/csi-pvc.yaml

  4. https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/examples/csi-app.yaml

  5. Modified csi-pvc.yaml to increase the PVC size to 2Gi.
    external-resizer worked properly and expanded online PVC/PV size to 2Gi.

  6. Deleted the pod created using csi-app.yaml. PVC is now offline.

  7. Modified csi-pvc.yaml to change the PVC size to 3Gi.

  8. PV was increased to 3Gi, but PVC remained at 2Gi.

root@k8s_ubuntu1:~/go/src/github.com/kubernetes-csi/csi-driver-host-path/examples# kubectl get pvc
NAME      STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS      AGE
csi-pvc   Bound    pvc-67c942df-df41-11e9-a872-000c296bb855   2Gi        RWO            csi-hostpath-sc   15h
root@k8s_ubuntu1:~/go/src/github.com/kubernetes-csi/csi-driver-host-path/examples# kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM             STORAGECLASS      REASON   AGE
pvc-67c942df-df41-11e9-a872-000c296bb855   3Gi        RWO            Delete           Bound    default/csi-pvc   csi-hostpath-sc            15h

Metadata

Metadata

Assignees

Labels

lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions