// Module included in the following assemblies:
//
// assembly-storage.adoc

[id='proc-resizing-persistent-volumes-{context}']
= Resizing persistent volumes

[role="_abstract"]
You can provision increased storage capacity by increasing the size of the persistent volumes used by an existing Strimzi cluster.
Resizing persistent volumes is supported in clusters that use either a single persistent volume or multiple persistent volumes in a JBOD storage configuration.

NOTE: You can increase but not decrease the size of persistent volumes.
Decreasing the size of persistent volumes is not currently supported in Kubernetes.

.Prerequisites

* A Kubernetes cluster with support for volume resizing.
* The Cluster Operator is running.
* A Kafka cluster using persistent volumes created using a storage class that supports volume expansion.

.Procedure

. In a `Kafka` resource, increase the size of the persistent volume allocated to the Kafka cluster, the ZooKeeper cluster, or both.

* To increase the volume size allocated to the Kafka cluster, edit the `spec.kafka.storage` property.
* To increase the volume size allocated to the ZooKeeper cluster, edit the `spec.zookeeper.storage` property.
+
For example, to increase the volume size from `1000Gi` to `2000Gi`:
+
[source,yaml,subs=attributes+]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
metadata:
  name: my-cluster
spec:
  kafka:
    # ...
    storage:
      type: persistent-claim
      size: 2000Gi
      class: my-storage-class
    # ...
  zookeeper:
    # ...
----

. Create or update the resource:
+
[source,shell,subs=+quotes]
kubectl apply -f _<kafka_configuration_file>_
+
Kubernetes increases the capacity of the selected persistent volumes in response to a request from the Cluster Operator.
When the resizing is complete, the Cluster Operator restarts all pods that use the resized persistent volumes.
This happens automatically.

[role="_additional-resources"]
.Additional resources

* For more information about resizing persistent volumes in Kubernetes, see {K8sResizingPersistentVolumesUsingKubernetes}.
