<p>I have a kubernetes namespace in <code>phase: Terminating</code> (waiting on finalizers or something) and I want it to stop terminating, without deleting it.</p>
<p>Is there a way to do this?</p>

Gavin Haynes
<p>Stop a kubernetes namespace from terminating by updating the finalizers associated with it.</p>
<p>The finalizers of a namespace determine the conditions that must be met before the namespace can be deleted. If a namespace is in a &quot;Terminating&quot; state, it means that there are still finalizers associated with it that need to be resolved. To stop the termination, you need to remove the finalizers from the namespace's resource definition.</p>
<p>You can do it by:</p>
<ol>
<li>retrieving the current definition of the namespace:</li>
</ol>
<pre><code>kubectl get namespace &lt;namespace-name&gt; -o yaml &gt; namespace.yaml
</code></pre>
<ol start="2">
<li>then in the definition file, look for the finalizers field and remove the items associated with it:</li>
</ol>
<pre><code># vi/nano/emacs namespace.yaml # open with your favorite editor
# and replace:

apiVersion: v1
kind: Namespace
metadata:
  name: &lt;namespace-name&gt;
  finalizers:
  - kubernetes
</code></pre>
<p>save it.</p>
<ol start="3">
<li>and then update the namespace definition with the edited file:</li>
</ol>
<pre><code>kubectl replace -f namespace.yaml
</code></pre>
<p>After that, the namespace should no longer be in a &quot;Terminating&quot; state and will remain intact.</p>
