This example shows how to resize PowerVS persistence volume using volume resizing features.
-
Add
allowVolumeExpansion: true
in the StorageClass spec in example manifest to enable volume expansion. You can only expand a PVC if its storage class’s allowVolumeExpansion field is set to true -
Deploy the example:
kubectl apply -f specs/
- Verify the volume is created and Pod is running:
kubectl get pv
kubectl get po app
- Expand the volume size by increasing the capacity in PVC's
spec.resources.requests.storage
:
kubectl edit pvc powervs-claim
Save the result at the end of the edit.
- Verify that both the persistence volume and persistence volume claim are resized:
kubectl get pv
kubectl get pvc
You should see that both should have the new value relfected in the capacity fields.
- Verify that the application is continuously running without any interruption:
kubectl exec -it app cat /data/out.txt
- Cleanup resources:
kubectl delete -f specs/