# Store the Redpanda Data Directory in PersistentVolumes

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [streaming-full.txt](https://docs.redpanda.com/streaming-full.txt)

---
title: Store the Redpanda Data Directory in PersistentVolumes
latest-redpanda-tag: v24.3.9
latest-console-tag: v3.7.3
latest-operator-version: v26.1.4
# EOL = End-of-Life (support lifecycle status)
page-is-nearing-eol: "false"
page-is-past-eol: "true"
page-eol-date: December 3, 2025
latest-connect-version: 4.93.0
docname: kubernetes/storage/k-persistent-storage
page-component-name: streaming
page-version: "24.3"
page-component-version: "24.3"
page-component-title: Streaming
page-relative-src-path: kubernetes/storage/k-persistent-storage.adoc
page-edit-url: https://github.com/redpanda-data/docs/edit/v/24.3/modules/manage/pages/kubernetes/storage/k-persistent-storage.adoc
description: Learn how to configure Redpanda to store the data directory in Kubernetes PersistentVolumes with a static provisioner or a dynamic provisioner.
page-git-created-date: "2024-01-04"
page-git-modified-date: "2024-09-17"
support-status: past end-of-life
---

<!-- Source: https://docs.redpanda.com/streaming/24.3/manage/kubernetes/storage/k-persistent-storage.md -->

You can configure Redpanda to use Kubernetes [PersistentVolumes](https://docs.redpanda.com/streaming/24.3/manage/kubernetes/storage/k-volume-types/) (PV) to store the Redpanda data directory using either a static provisioner or a dynamic provisioner.

## [](#prerequisites)Prerequisites

You must have the following:

-   Kubernetes cluster: Ensure you have a running Kubernetes cluster, either locally, such as with minikube or kind, or remotely.

-   [Kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl): Ensure you have the `kubectl` command-line tool installed and configured to communicate with your cluster.

-   Storage resources: You need to set up the necessary storage resources in your Kubernetes cluster.

-   File system: Ensure that the chosen volume is on an ext4 or XFS file system.


## [](#configure-rp)Configure Redpanda to use PersistentVolumes

Both the Redpanda Helm chart and the Redpanda custom resource provide an interface for configuring persistent storage. These are the default settings:

### Helm + Operator

`redpanda-cluster.yaml`

```yaml
apiVersion: cluster.redpanda.com/v1alpha2
kind: Redpanda
metadata:
  name: redpanda
spec:
  chartRef: {}
  clusterSpec:
    storage:
      persistentVolume:
        enabled: true
        size: 20Gi
        storageClass: ""
        labels: {}
        annotations: {}
```

```bash
kubectl apply -f redpanda-cluster.yaml --namespace <namespace>
```

### Helm

#### --values

`redpanda-persistent-storage.yaml`

```yaml
storage:
  persistentVolume:
    enabled: true
    size: 20Gi
    storageClass: ""
    labels: {}
    annotations: {}
```

```bash
helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
  --values redpanda-persistent-storage.yaml --reuse-values
```

#### --set

```bash
helm upgrade --install redpanda redpanda/redpanda \
  --namespace <namespace> \
  --create-namespace \
  --set storage.persistentVolume.enabled=true \
  --set storage.persistentVolume.size=20Gi \
  --set storage.persistentVolume.storageClass="" \
  --set storage.persistentVolume.labels={} \
  --set storage.persistentVolume.annotations={}
```

-   `storage.persistentVolume.enabled`: Determines if a PersistentVolumeClaim (PVC) should be created for the Redpanda data directory. When set to `true`, a PVC is created.

-   `storage.persistentVolume.size`: The size of the PVC. By default, it’s set to `20Gi`, indicating a volume of 20 Gigabytes. Your underlying PV or StorageClass must support this size.

-   `storage.persistentVolume.storageClass`: Specifies the StorageClass name for the PVC. If set to `"-"`, dynamic provisioning is disabled. Leaving it undefined or empty uses the default dynamic provisioner.

-   `storage.persistentVolume.labels`: For adding additional labels to the created PVC.

-   `storage.persistentVolume.annotations`: For adding additional annotations to the created PVC.


## [](#verify-persistentvolumeclaims)Verify PersistentVolumeClaims

After configuring Redpanda for persistent storage, verify that the Redpanda Pods have claimed the required PV.

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

    ```bash
    kubectl get pvc --namespace <namespace>
    ```

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

2.  Choose a Pod and describe it:

    ```bash
    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.

## [](#suggested-reading)Suggested reading

-   [Supported Volume Types for Data in Redpanda](https://docs.redpanda.com/streaming/24.3/manage/kubernetes/storage/k-volume-types/)

-   For more details about PersistentVolumes, see the [Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/persistent-volumes/).

-   [Redpanda Helm Specification](https://docs.redpanda.com/streaming/24.3/reference/k-redpanda-helm-spec/)

-   [Redpanda CRD Reference](https://docs.redpanda.com/streaming/24.3/reference/k-crd/)


## [](#next-steps)Next Steps

-   After setting up persistent storage for Redpanda, monitor your storage usage. Monitoring storage helps to detect issues early, optimize performance, and plan capacity changes.

    -   [Monitor disk usage](https://docs.redpanda.com/streaming/24.3/manage/kubernetes/monitoring/#infrastructure-resources) in Redpanda.

    -   [Volume health monitoring](https://kubernetes.io/docs/concepts/storage/volume-health-monitoring/) in Kubernetes.


-   Enable [rack awareness](https://docs.redpanda.com/streaming/24.3/manage/kubernetes/k-rack-awareness/) to minimize data loss in the event of a rack failure.


## Suggested labs

-   [Redpanda Iceberg Docker Compose Example](https://docs.redpanda.com/labs/docker-compose/iceberg/)
-   [Enable Unified Identity with Azure Entra ID for Redpanda and Redpanda Console](https://docs.redpanda.com/labs/docker-compose/oidc/)
-   [Owl Shop Example Application in Docker](https://docs.redpanda.com/labs/docker-compose/owl-shop/)
-   [Migrate Data with Redpanda Migrator](https://docs.redpanda.com/labs/docker-compose/redpanda-migrator/)
-   [Start a Single Redpanda Broker with Redpanda Console in Docker](https://docs.redpanda.com/labs/docker-compose/single-broker/)
-   [Start a Cluster of Redpanda Brokers with Redpanda Console in Docker](https://docs.redpanda.com/labs/docker-compose/three-brokers/)
-   [Iceberg Streaming on Kubernetes with Redpanda, MinIO, and Spark](https://docs.redpanda.com/labs/kubernetes/iceberg/)

See more

[Search all labs](https://docs.redpanda.com/labs)