-
Notifications
You must be signed in to change notification settings - Fork 142
Description
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:
-
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 -
kubectl create -f https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/examples/csi-storageclass.yaml
-
kubectl apply -f https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/examples/csi-pvc.yaml
-
https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/examples/csi-app.yaml
-
Modified csi-pvc.yaml to increase the PVC size to 2Gi.
external-resizer worked properly and expanded online PVC/PV size to 2Gi. -
Deleted the pod created using csi-app.yaml. PVC is now offline.
-
Modified csi-pvc.yaml to change the PVC size to 3Gi.
-
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