How to extend VMware persistent volume (PV/PVC) with Kubernetes's VMwware in-tree driver ?
(using Rancher 2.5 with VMware/vSphere cloud provider, and Kubernetes 1.18)
I created a storageclass with the following UI options: Provider: VMWare vSphere Volume and Allow Volume Expansion : Enabled. (I had to re-edit the SC and click "Allow Volume Expansion : Enabled" again)
I created a PVC, started my pod, stopped the pod. Then I used the "resized" UI to increase the volume size (in Rancher > Cluster x > Project y > Resource > Workload > Volumes > menu button > Resize)
The volume now has: spec.resources.requests.storage: 20Gi
and status.capacity.storage: 10Gi
(see yaml below)
But I get the error in Events:
ExternalExpanding Ignoring the PVC: didn't find a plugin capable of expanding the volume; waiting for an external controller to process this PVC.
The Volume expansion seems to require an external-resizer Kubernetes CSI Sidecar Containers.
The stotageClass is :
#kubectl get storageclass -o yaml testsc
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: testsc
parameters:
datastore: TESTDS
diskformat: thin
provisioner: kubernetes.io/vsphere-volume
reclaimPolicy: Delete
PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
pv.kubernetes.io/bind-completed: "yes"
pv.kubernetes.io/bound-by-controller: "yes"
volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/vsphere-volume
volume.kubernetes.io/selected-node: testnode1
finalizers:
- kubernetes.io/pvc-protection
name: testpvc
namespace: test
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
storageClassName: testsc
volumeMode: Filesystem
volumeName: pvc-31d5f008-724a-4da3-b7ab-9bd2c067753e
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi
phase: Bound