<p>I am using Helm to deploy multiple &quot;components&quot; of my application into a single namespace and using Jenkins to trigger create and destroy jobs. It doesn't seem that I can use Helm to delete the namespace thus I am looking to just use a Kubernetes command.</p>
<p>However, It seems that if I use <code>kubectl delete namespace</code> it will forcefully destroy the namespace and all its resources.</p>
<p>I'd like to destroy the namespace only if it is empty. Is there a command to do this?</p>

<blockquote>
<p>I'd like destroy the namespace only if it is empty. Is there a command
to do this?</p>
</blockquote>
<p>No there is not command to do that. This behavior is by design.</p>
<p>I would suggest a different approach. You should have all your deployment yamls in version control system for all of the components including namespace. When you want to create use <code>kubectl create -f deployment.yaml</code> and when you want to delete use <code>kubectl delete -f deployment.yaml</code></p>
