<p>Is there a variant of <code>kubectl delete all --all</code> command or some other command to delete all resources except the <em>kubernetes service</em>?</p>

<p>I don't think there's a built-in command for it, which means you'll have to script your way out of it, something like this (add an <code>if</code> for the namespace you want to spare):</p>

<pre><code>$ for ns in $(kubectl get ns --output=jsonpath={.items[*].metadata.name}); do kubectl delete ns/$ns; done;
</code></pre>

<p>Note: deleting a namespace deletes all its resources.</p>
