Last active
March 31, 2022 14:21
-
-
Save sshaaf/dd6493a2bc525f9a1a3e42a20cf2c2ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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