The stack:

The problem.

Working on my SaaS, and my disk fills up. Ok no big deal lets resize it.

I’m lazy so I don’t commit to my repo and deploy, I just decide to edit manually to get it back online.

k edit pvc data

I change the size. When I exit vim….

➜  blog git:(master) ✗ k get pvc
NAME                                            STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
data                                            Bound    pvc-9512bd26-7d9c-4cb8-8b71-77a0bbfe157c   250Gi      RWX            rook-cephfs    77d

No change.

I’m pulling my hair out, I check that I have volumeExpansion enabled on my StorageClass, I dig into ceph logs….

I was seconds away from posting in Rook ceph slack, and stackoverflow, then it dawns on me. I was trying to modify the status field, not the requests field.

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"name":"data","namespace":"streamtracker"},"spec":{"accessModes":["ReadWriteMany"],"resources":{"requests":{"storage":"250Gi"}},"storageClassName":"rook-cephfs"}}
    pv.kubernetes.io/bind-completed: "yes"
    pv.kubernetes.io/bound-by-controller: "yes"
    volume.beta.kubernetes.io/storage-provisioner: rook-ceph.cephfs.csi.ceph.com
  creationTimestamp: "2021-10-23T16:47:18Z"
  finalizers:
  - kubernetes.io/pvc-protection
  name: data
  namespace: foo
  resourceVersion: "59326596"
  uid: 9512bd26-7d9c-4cb8-8b71-77a0bbfe157c
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 250Gi #Change this 
  storageClassName: rook-cephfs
  volumeMode: Filesystem
  volumeName: pvc-9512bd26-7d9c-4cb8-8b71-77a0bbfe157c
status:
  accessModes:
  - ReadWriteMany
  capacity:
    storage: 450Gi # Don't modify this dummy.
  phase: Bound

I changed the correct field. Everything resized normally and worked as it should.

Oof.

This would’ve worked too.

k patch pvc data -p '{"spec": {"resources":{"requests":{"storage":"450Gi"}}}}'