<p>I am new to Helm Kubernetes. I am currently using a list of bash commands to create a local Minikube cluster with many containers installed. In order to alleviate the manual burden we were thinking of creating an (umbrella) Helm Chart to execute the whole list of commands.</p>
<p>Between the commands that I would need to run in the Chart there are few (cleanup) kubectl deletes, i.e. :</p>
<pre><code>kubectl delete all,configmap --all -n system --force --grace-period=0
</code></pre>
<p>and also some helm installs, i.e.:</p>
<pre><code>helm repo add bitnami https://charts.bitnami.com/bitnami &amp;&amp; \
helm install postgres bitnami/postgresql --set postgresqlPassword=test,postgresqlDatabase=test &amp;&amp; \
</code></pre>
<p><strong>Question1</strong>: is it possible to include <code>kubectl</code> command in my Helm Chart?</p>
<p><strong>Question2</strong>: is it possible to add a dependency from a Chart only remotely available? I.e. the dependency from postgres above.</p>
<p><strong>Question3</strong>: If you think Helm is not the correct tool for doing this, what would you suggest instead?</p>
<p>Thank you</p>

sommario
<p>You can't embed imperative <code>kubectl</code> commands in a Helm chart.  An installed Helm chart keeps track of a specific set of Kubernetes resources it owns; you can <code>helm delete</code> the release, and that will delete that specific set of things.  Similarly, if you have an installed Helm chart, you can <code>helm upgrade</code> it, and the new chart contents will replace the old ones.</p>
<p>For the workflow you describe – you're maintaining a developer environment based on Minikube, and you want to be able to start clean – there are two good approaches to take:</p>
<ol>
<li><code>helm delete</code> the release(s) that are already there, which will uninstall their managed Kubernetes resources; or</li>
<li><code>minikube delete</code> the whole &quot;cluster&quot; (as a single container or VM), and then <code>minikube start</code> a new empty &quot;cluster&quot;.</li>
</ol>
