Skip to content

Disk size does not update in kubectl get pvc after resizing #51

@WizardBit

Description

@WizardBit

After deploying Canonical k8s with ceph-csi I tried to resize a disk since it was getting full and noticed that the resize does occur, but the output from kubectl it is not reflecting this change.

Command used to resize storage disk

sudo k8s kubectl patch pvc prometheus-database-3fe23980-prometheus-0 \
    -n cos --type='merge' -p '{"spec": {"resources": {"requests": {"storage": "700Gi"}}}}'

persistentvolumeclaim/prometheus-database-3fe23980-prometheus-0 patched

Output of pvc does not reflect disk resize

sudo k8s kubectl get pvc -n cos
NAME                                                STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
...
prometheus-database-3fe23980-prometheus-0           Bound    pvc-4b69b147-eb20-4df9-8bc5-23a1c77e7c2e   1Gi        RWO            ceph-xfs       <unset>                 27d

Container shows resize was successful

sudo k8s kubectl exec -n cos -c prometheus prometheus-0 -- df -h /var/lib/prometheus
Filesystem      Size  Used Avail Use% Mounted on
/dev/rbd0       700G  1.6G  699G   1% /var/lib/prometheus

It shows that k8s is waiting for the controller to respond back after the resize.

kubectl get events -n cos --sort-by=.metadata.creationTimestamp
LAST SEEN   TYPE     REASON                     OBJECT                                                            MESSAGE
5m49s       Normal   ExternalExpanding          persistentvolumeclaim/prometheus-configurations-24155b26-prometheus-0   waiting for an external controller to expand this PVC
3m10s       Normal   FileSystemResizeRequired   persistentvolumeclaim/prometheus-configurations-24155b26-prometheus-0   Require file system resize of volume on node
3m10s       Normal   Resizing                   persistentvolumeclaim/prometheus-configurations-24155b26-prometheus-0   External resizer is resizing volume pvc-4b69b147-eb20-4df9-8bc5-23a1c77e7c2e

Charm Versions

  • ceph-csi 1.32/stable Rev 70
  • ceph-mon squid/stable Rev 268
  • ceph-osd squid/stable Rev 632
  • k8s 1.32/stable Rev 986

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions