File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ ### 1. This command (with kubectl 1.11+) will show you what resources remain in the namespace:
2
+
3
+ ``` sh
4
+ $ kubectl api-resources --verbs=list --namespaced -o name \
5
+ | xargs -n 1 kubectl get --show-kind --ignore-not-found -n < namespace>
6
+ ```
7
+
8
+ ### 2. Force-delete the namespace (perhaps leaving dangling resources):
9
+
10
+ ``` sh
11
+ $ NAMESPACE=your-rogue-namespace
12
+
13
+ $ kubectl proxy & (for auth purposes)
14
+
15
+ $ kubectl get namespace $NAMESPACE -o json | jq ' .spec = {"finalizers":[]}' > temp.json
16
+
17
+ $ curl -k -H " Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE /finalize
18
+
19
+ ```
20
+
21
+ ### 3. This way you will not have to spawn a kubectl proxy process and avoid dependency with curl
22
+
23
+ ``` sh
24
+ kubectl get namespace " stucked-namespace" -o json \
25
+ | tr -d " \n" | sed " s/\" finalizers\" : \[[^]]\+\]/\" finalizers\" : []/" \
26
+ | kubectl replace --raw /api/v1/namespaces/stucked-namespace/finalize -f -
27
+
28
+
29
+ ```
You can’t perform that action at this time.
0 commit comments