<p>I deploy my Helm deploys to isolated namespaces.</p>
<p>Deleting a namespace deletes all the resources in it - except the Helm deployment.</p>
<p>Deleting a Helm deployment deletes all resource in it - except the namespace.</p>
<p>I have to do this which seems redundant:</p>
<pre><code>helm del `helm ls NAMESPACE --short` --purge
kubectl delete namespace NAMESPACE
</code></pre>
<p>I'd rather just delete my namespace and have the Helm deploy also purged - is this possible?</p>

red888
<blockquote>
  <p>Deleting a namespace deletes all the resources in it- except the helm deployment</p>
</blockquote>

<p>This can't be (deleting a namespace implies deleting everything in it, there aren't any exceptions), and must means that the state representing Helm's concept of a deployment doesn't live in that namespace. Helm stores these as config maps in the <code>TILLER_NAMESPACE</code>.  See <a href="https://helm.sh/docs/architecture/#implementation" rel="nofollow noreferrer">here</a> and <a href="https://v3.helm.sh/docs/faq/#release-names-are-now-scoped-to-the-namespace" rel="nofollow noreferrer">here</a>.</p>

<p>It's not surprising that if you create some resources with <code>helm</code> and then go "under the hood" and delete those resources directly via <code>kubectl</code>, Helm's state of the world won't result in that deployment disappearing.</p>

<blockquote>
  <p>Deleting a helm deployment deletes all resource in it- except the namespace</p>
</blockquote>

<p>That sounds like expected behaviour. Presumably you created the namespace out of band with <code>kubectl</code>, it's not part of your Helm deployment. So deleting the Helm deployment wouldn't delete that namespace.</p>

<p>If you <code>kubectl create namespace NS</code> and <code>helm install CHART --namespace NS</code> then it's not surprising that to clean up, you need to <code>helm delete</code> the release and then <code>kubectl delete</code> the namespace.</p>

<p>The only way I could imagine to do that would be for the Helm chart itself to both create a namespace and create all subsequent namespace-scoped resources within that namespace. <a href="https://github.com/helm/charts/tree/5e00179b109d7290eb05a2b9705839fcf666d29a/stable/magic-namespace" rel="nofollow noreferrer">Here</a> is an example that appears to do such a thing.</p>
