<p>I made a Kafka and zookeeper as a statefulset and exposed Kafka to the outside of the cluster. However, whenever I try to delete the Kafka statefulset and re-create one, the data seemed to be gone? (when I tried to consume all the message using <code>kafkacat</code>, the old messages seemed to be gone) even if it is using the same PVC and PV. I am currently using EBS as my persistent volume. </p>

<p>Can someone explain to me what is happening to PV when I delete the statefulset? Please help me.</p>

<p>I would probably look at how the persistent volume is created.
If you run the command
<code>kubectl get pv</code>
you can see the <code>Reclaim policy</code>, if it is set to retain, then your volume will survive even when stateful set is deleted</p>
