0

I have a pvc on my cluster.

I can expand it on my provider (digital ocean)

but then on the cluster do I need to somehow let it know that it expanded?

here is my file that I deployed to enable the creation of the pvc

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: test-pvc
  namespace: test
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 4Gi
  storageClassName: do-block-storage
Henry
  • 91
  • 1
  • 1
  • 7

1 Answers1

1

Resizing volumes other than through the PVC object (e.g., the DigitalOcean cloud control panel) is not recommended as this can potentially cause conflicts. Additionally, size updates will not be reflected in the PVC object status section immediately, and the section will eventually show the actual volume capacity

The recommendation is to update the capacity through the PVC object using kubectl edit and the CSI Driver will update the volume by calling digital ocean API. From the docs

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: csi-pvc
  namespace: default
spec:
  [...]
  resources:
    requests:
      # The field below can be increased.
      storage: 10Gi
      [...]

After successful expansion, the status section of the PVC object will reflect the actual volume capacity.

Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107
  • So would I just deploy the same file via: kubectl apply -f storage.yml? I was under the impression if I used the same name it would say this pvc already exists. So if the size is larger it would know to increase the size? thanks – Henry Dec 25 '20 at 07:37
  • Use `kubectl edit` to edit the existing pvc object..it should automatically increase the volume size in digital ocean – Arghya Sadhu Dec 25 '20 at 07:47