Store the Redpanda Data Directory in emptyDir Volumes
You can configure Redpanda to use Kubernetes emptyDir
volumes to store the Redpanda data directory.
Use emptyDir volumes only for development environments. When a Pod is removed from a node for any reason, the data in the emptyDir volume is deleted permanently.
|
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: Ensure you have the
kubectl
command-line tool installed and configured to communicate with your cluster.
Configure Redpanda to use emptyDir volumes
Both the Redpanda Helm chart and the Redpanda custom resource provide an interface for configuring emptyDir
volumes.
To store the Redpanda data directory in emptyDir
volumes:
-
Helm + Operator
-
Helm
redpanda-cluster.yaml
apiVersion: cluster.redpanda.com/v1alpha2
kind: Redpanda
metadata:
name: redpanda
spec:
chartRef: {}
clusterSpec:
storage:
hostPath: ""
persistentVolume:
enabled: false
kubectl apply -f redpanda-cluster.yaml --namespace <namespace>
-
--values
-
--set
emptydir.yaml
storage:
hostPath: ""
persistentVolume:
enabled: false
helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
--values emptydir.yaml --reuse-values
helm upgrade --install redpanda redpanda/redpanda \
--namespace <namespace> \
--create-namespace \
--set storage.hostPath="" \
--set storage.persistentVolume.enabled=false
-
storage.hostPath
: Absolute path on the host to store the Redpanda data directory. If unspecified, then anemptyDir
volume is used. -
storage.persistentVolume.enabled
: Determine if a PersistentVolumeClaim (PVC) should be created for the Redpanda data directory. When set tofalse
, a PVC is not created.
Suggested reading
-
For more details about
emptyDir
volumes, see the Kubernetes documentation.
Next steps
Monitor disk usage to detect issues early, optimize performance, and plan capacity.