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

[id='ref-ephemeral-storage-{context}']
= Ephemeral storage

Ephemeral storage uses the {K8sEmptyDir} to store data.
To use ephemeral storage, the `type` field should be set to `ephemeral`.

IMPORTANT: `EmptyDir` volumes are not persistent and the data stored in them will be lost when the Pod is restarted.
After the new pod is started, it has to recover all data from other nodes of the cluster.
Ephemeral storage is not suitable for use with single node Zookeeper clusters and for Kafka topics with replication factor 1, because it will lead to data loss.

.An example of Ephemeral storage
[source,yaml,subs="attributes+"]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
metadata:
  name: my-cluster
spec:
  kafka:
    # ...
    storage:
      type: ephemeral
    # ...
  zookeeper:
    # ...
    storage:
      type: ephemeral
    # ...
----
