Delete k8s namespace - possibility to recover

11/18/2020

If we deleted a NS which was actually stuck without deletion due to finalizer configuration is it possible to cancel the execution and get the NS back to Active ?

example

spec:

finalizers:

  • kubernetes

status:

phase: Terminating

-- Dinuka Mendis
kubernetes

1 Answer

12/1/2020

Well after struggling a lot.. we found a way to handle this... here's the fix.. patch the NS and remove the finalizer : Kubernetes , then immediately create back the NS... this will put the namespace back as active as it was.. all the PODs, PVC, SVCs were retained without any issue... Don't know why but it restored the NS back.

-- Dinuka Mendis
Source: StackOverflow