Error: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize
Quote from moshe on 29/09/2022, 12:02 pmProblem
User tries to resize a pvc and gets the following error
error: persistentvolumeclaims "data-reportportal-db-postgresql-0" could not be patched: persistentvolumeclaims "data-reportportal-db-postgresql-0" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize
Solution
Change the storage Class to support resizing
kubectl get sc
edit your storage class
kubectel edit sc <STORAGECLASS NAME>
Add the following settings
allowVolumeExpansion: true
Example:
reclaimPolicy: Delete
allowVolumeExpansion: true
Problem
User tries to resize a pvc and gets the following error
error: persistentvolumeclaims "data-reportportal-db-postgresql-0" could not be patched: persistentvolumeclaims "data-reportportal-db-postgresql-0" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize
Solution
Change the storage Class to support resizing
kubectl get sc
edit your storage class
kubectel edit sc <STORAGECLASS NAME>
Add the following settings
allowVolumeExpansion: true
Example:
reclaimPolicy: Delete
allowVolumeExpansion: true