GKE PVC Resize

TL; DR: No impact when PVC re-claim

1.Deploy pvc to standard class

$ k get pv,pvc
No resources found

2.Check storageclass (which is predefined)

k get storageclasses.storage.k8s.io
NAME                 PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
premium-rwo          pd.csi.storage.gke.io   Delete          WaitForFirstConsumer   true                   13d
standard (default)   kubernetes.io/gce-pd    Delete          Immediate              true                   13d
standard-rwo         pd.csi.storage.gke.io   Delete          WaitForFirstConsumer   true                   13d

3.Check dynamic-provisioner to storageclass

$ cat pvc-dynamic.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-dynamic
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
  storageClassName: standard

4. apply it!!!

5. Check pv,pvc

PVC's Capacity is lazy to update. so wait for seconds

6.Check deployment to use this pvc

7. Create bundle data in the deployment(pod)

8.Check bundle data in the container

9. Change storage capacity from 20Gi to 30Gi and apply it

10. Check again pv,pvc

11. re-deploy deployment by delete

12. Check data is sustained

DONE!!!! Successfully

Reference:

Last updated

Was this helpful?