Skip to main content

Expand or delete PVCs

Follow the instructions on this page to either expand or delete Persistent Volume Claims (PVCs). These actions are often necessary to manage storage efficiently based on the application's requirements. For instance, you might need to increase the storage capacity of a PVC to accommodate growing data, or delete unused PVCs to free up resources.

Expand a PVC

  1. Edit the PVC specification:
    Run the following command to open the PVC specification for editing. This step allows you to modify the PVC's configuration to reflect the required storage size.

    kubectl edit pvc <pvc-name> -n <pvc-namespace>
  2. Modify the storage field:
    Locate the resources.requests.storage field in the spec section and update it to the desired storage size. This change specifies the new storage capacity for the PVC. For example, update the storage to the desired capacity:

    spec:
    accessModes:
    - ReadWriteOnce
    resources:
    requests:
    storage: 2Gi
    storageClassName: sc-portworx-fa-direct-access
    volumeMode: Filesystem
    volumeName: pvc-7ba7c112-xxxx-xxxx
  3. Apply the changes:
    Save the modified specification. This action triggers Kubernetes to resize the PVC to match the updated storage request.

Delete a PVC

Run the following command to delete a PVC associated with a FlashArray Direct Access volume. You can use this operation to delete unused PVCs that helps optimize storage resource usage and avoid unnecessary costs.

kubectl delete pvc <pvc-name> -n <pvc-namespace>
persistentvolumeclaim "<pvc-name>" deleted