Expand PersistentVolumes

To give Redpanda brokers more storage, you can expand the size of PersistentVolumes (PVs). The way you expand PVs depends on the provisioner that you use.

Some storage operations may cause temporary disruptions to your service or require the restart of associated Pods. Plan these operations during maintenance windows or times of low usage.

Expand PersistentVolumes that use static provisioners

The process of resizing PVs that use a static provisioner varies depending on the way your file system is allocated. Follow the recommended process for your system. You do not need to make any configuration changes to the Redpanda Helm chart or your Redpanda custom resource.

Expand PersistentVolumes that use dynamic provisioners

To expand a PersistentVolume that uses a dynamic provisioner, you can reconfigure the Redpanda Helm chart to increase the size specification of your Pods' PersistentVolumeClaims (PVCs). Before making this change, make sure that your StorageClass is capable of volume expansions. For a list of volumes that support volume expansion, see the Kubernetes documentation.

When you increase the size of a PVC connected to a StatefulSet, only new Pods recognize the changed PVC size. Existing Pods remain associated with the original PVC size. Manual intervention is necessary to modify the size of PVCs for existing Pods. Not all storage drivers recognize and act upon such modifications. Before making any changes, ensure your storage driver supports this operation.
  1. Delete the StatefulSet associated with your Redpanda brokers using the cascade=orphan option. This action deletes the StatefulSet while leaving the Pods and their associated PVCs intact.

    kubectl --namespace <namespace> delete statefulset <cluster-name> --cascade=orphan
  2. Manually resize any pre-existing PVCs to your desired capacity by modifying the spec.resources.requests.storage field to the new size.

  3. Redeploy the StatefulSet with the updated PVC size.

    For the Redpanda data directory:

    • Helm + Operator

    • Helm

    redpanda-cluster.yaml
    apiVersion: cluster.redpanda.com/v1alpha1
    kind: Redpanda
    metadata:
      name: redpanda
    spec:
      chartRef: {}
      clusterSpec:
        storage:
          persistentVolume:
            enabled: true
            size: <custom-size>Gi
    kubectl apply -f redpanda-cluster.yaml --namespace <namespace>
    • --values

    • --set

    persistentvolume-size.yaml
    storage:
      persistentVolume:
        enabled: true
        size: <custom-size>Gi
    helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
      --values persistentvolume-size.yaml --reuse-values
    helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
      --set storage.persistentVolume.enabled=true \
      --set storage.persistentVolume.size=<custom-size>Gi

    For the Tiered Storage cache:

    • Helm + Operator

    • Helm

    redpanda-cluster.yaml
    apiVersion: cluster.redpanda.com/v1alpha1
    kind: Redpanda
    metadata:
      name: redpanda
    spec:
      chartRef: {}
      clusterSpec:
        storage:
          tieredStoragePersistentVolume:
            enabled: true
            size: <custom-size>Gi
    kubectl apply -f redpanda-cluster.yaml --namespace <namespace>
    • --values

    • --set

    persistentvolume-size.yaml
    storage:
      tieredStoragePersistentVolume:
        enabled: true
        size: <custom-size>Gi
    helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
      --values persistentvolume-size.yaml --reuse-values
    helm upgrade --install redpanda redpanda/redpanda \
      --namespace <namespace> \
      --create-namespace \
      --set storage.tieredStoragePersistentVolume.enabled=true \
      --set storage.tieredStoragePersistentVolume.size=<custom-size>Gi

Verify PersistentVolumeClaims

After redeploying the StatefulSet, verify that the Redpanda Pods have claimed the required PVs.

  1. Use the following command to list the PVCs in your cluster:

    kubectl get pvc --namespace <namespace>

    Ensure that the PVCs related to Redpanda are in the Bound state and note the PVs to which they’re bound.

  2. Choose a Pod and describe it:

    kubectl describe pod <redpanda-pod-name> --namespace <namespace>

In the output, ensure the PVC is mounted to the correct path and that the source PV matches what you’ve configured.