<p>I am creating some secrets when <code>helm install</code> is executed via <code>pre-install</code> hooks.</p>

<p>Everything works great. However when <code>helm delete</code> is performed the secrets created are not deleted. This is because any resource installed using <code>pre-install</code> is considered to be self managed. So I read this could be done using <code>post-delete</code> hooks.</p>

<p>So questions are:</p>

<ol>
<li><p>How do I delete secrets in post delete?</p></li>
<li><p>If we remove <code>pre-install</code> hooks then then delete works just fine. But then how to guarantee that secrets are created before the pods are even created when we perform <code>helm install</code>?</p></li>
</ol>

<p>Tiller creates resources in a specific order (find it in the source code here: <a href="https://github.com/kubernetes/helm/blob/master/pkg/tiller/kind_sorter.go#L26" rel="noreferrer">https://github.com/kubernetes/helm/blob/master/pkg/tiller/kind_sorter.go#L26</a>)</p>

<p>So for this specific user case there is no need for hooks or any other mechanism, just include your secret and your pods and magic will happen ;)</p>

<p>That said, there is still the issue with <em>pre-installed</em> objects. The documentation states that this is the desired behaviour:</p>

<blockquote>
  <p>Practically speaking, this means that if you create resources in a
  hook, you cannot rely upon helm delete to remove the resources. To
  destroy such resources, you need to either write code to perform this
  operation in a pre-delete or post-delete hook or add
  "helm.sh/hook-delete-policy" annotation to the hook template file.</p>
</blockquote>

<p>The only solution is to add a job to the chart, with the <em>post-delete</em> hook, that deletes those resources.</p>
