<p>I install the helm release by</p>

<pre><code>helm install --name my-release .
</code></pre>

<p>And delete it by</p>

<pre><code>helm delete --purge my-release
</code></pre>

<p>But I found out that kubernetes does not clear any storage associated to the containers of that release. I installed postgresql, did lot of things to it, deleted, and when I reinstalled it, all my data was there. How do I clear the storage via helm delete? </p>

<p><strong>Edit:</strong> I'm using <a href="https://github.com/helm/charts/tree/master/stable/postgresql" rel="noreferrer">Postgresql Stable Chart</a> version <code>5.3.10</code></p>

<p>Here's the only custom thing I have in my release</p>

<p>values.yaml</p>

<pre><code>postgresql:
  postgresqlDatabase: test
  postgresqlUsername: test
  postgresqlPassword: test
</code></pre>

vcmkrtchyan
<p>Look at the helm chart file:
<a href="https://github.com/helm/charts/blob/master/stable/postgresql/templates/statefulset.yaml" rel="noreferrer">https://github.com/helm/charts/blob/master/stable/postgresql/templates/statefulset.yaml</a></p>

<p>It is evident that if you don't specify the value for <code>.Values.persistence.existingClaim</code> in values.yaml, it will automatically create a persistent volume claim.</p>

<ul>
<li>If you have a storage calss set for <code>.Values.persistence.storageClass</code> the created pvc will use that class to provision volumes.</li>
<li>If you set the storage class as "-", the dynamic provisioning will be disabled. </li>
<li>If you don't specify anything for <code>.Values.persistence.storageClass</code>, the automatically created pvc will not have a storage class field specified. </li>
</ul>

<p>Since you are using the default values.yaml of the chart, you have the third case.   </p>

<p>In kubernetes, if you don't specify a storage class in a persistent volume claim, it will use the <strong>default storage class</strong> of the cluster to provision volumes.</p>

<p>Check which is your cluster's stoage class:</p>

<pre><code>kubectl get sc 
</code></pre>

<p>The default StorageClass will be marked by <code>(default)</code>. 
Describe that storage class and find it's <code>Reclaim Policy</code>.</p>

<p>If the Reclaim Policy is <strong>Delete</strong>, the pv created by it will be automatically deleted when it's claim is removed (In your case, when the chart is uninstalled).</p>

<p>If the default storage class's Reclaim Policy is not  <strong>Delete</strong>, you have to create your own storage class with Delete policy and then use it further. </p>
