Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sshaaf/dd6493a2bc525f9a1a3e42a20cf2c2ff to your computer and use it in GitHub Desktop.
Save sshaaf/dd6493a2bc525f9a1a3e42a20cf2c2ff to your computer and use it in GitHub Desktop.
If you have already tried something like the following:
oc delete project dev --force --grace-period=0
#Most likely Kube is set in the finalizer which does not let the namespace to be removed. here is one way to do it.
kubectl get ns PROJECTNAME -o json > tmp.json
vi tmp.json
#Make sure finalizers are empty as follows
```
"spec": {
"finalizers": []
}
```
#Save and exit
#startup a proxy to access the api via curl
kubectl proxy
curl -k -H "Content-Type: application/json" -X PUT --data-binary \
@tmp.json http://127.0.0.1:8001/api/v1/namespaces/PROJECTNAME/finalize
#Now the namespace should be gone
kubectl get ns PROJECTNAME
source: https://computingforgeeks.com/how-to-force-delete-a-kubernetes-namespace/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment