Comments (6)
Hi @thyarles , that worked! Thanks a lot for debugging this and getting rid of annoying namespace termination failures. Cheers!
from knsk.
Hi @yamaszone,
Thank you for your comment. By the way, sorry for the delay in analyzing your question, I don't know why, but GitHub did not notify me and just now I saw it. Could you please take a look in /tmp folder from a machine that your run the script? There a file named "yournamespacename.json", could you put here the content of it?
Thanks.
from knsk.
Hi @thyarles , thanks a lot for following up on this! Here's an example JSON file for you to review:
{
"apiVersion": "v1",
"kind": "Namespace",
"metadata": {
"creationTimestamp": "2019-12-19T01:57:44Z",
"deletionTimestamp": "2020-04-09T15:25:26Z",
"name": "exp",
"resourceVersion": "7492953",
"selfLink": "/api/v1/namespaces/exp",
"uid": "f2e8f518-2202-11ea-a046-025000000001"
},
"spec": {
"finalizers": [
]
},
"status": {
"phase": "Terminating"
}
}
Let me know if you need more information. Thanks in advance for your help!
from knsk.
Please, could you try to run as
./knsk.sh --delete-all --force --dry-run --no-color
And post the output? You can hide sensitive information, if there any.
from knsk.
Hi @thyarles , here's the output:
Kubernetes NameSpace Killer
Checking if kubectl is configured... ok
Checking for unavailable apiservices... found
.: Broken -> v1beta1.servicecatalog.k8s.io... dry-run
timeout 15 kubectl delete apiservice v1beta1.servicecatalog.k8s.io
Checking for stucked namespaces... found
.: Checking resources in namespace a... not found
.: Checking resources in namespace b... not found
.: Checking resources in namespace catalog... not found
.: Checking resources in namespace exp... not found
Checking for stucked resources in the cluster... not found
Checking for orphan resources in the cluster... not found
Forcing deletion of stucked namespaces
.: Checking compliance of --force option... ok
.: Getting the access token to force deletion... ok
.: Starting kubectl proxy... ok
.: Checking for resisted stucked namespaces to force deletion... found
> Forcing deletion of a... dry-run
curl -s -o /tmp/a.json.log -X PUT --data-binary @/tmp/a.json http://localhost:8765/api/v1/namespaces/a/finalize -H "Content-Type: application/json" --header "Authorization: Bearer ***" --insecure
> Forcing deletion of b... dry-run
curl -s -o /tmp/b.json.log -X PUT --data-binary @/tmp/b.json http://localhost:8765/api/v1/namespaces/b/finalize -H "Content-Type: application/json" --header "Authorization: Bearer ***" --insecure
> Forcing deletion of catalog... dry-run
curl -s -o /tmp/catalog.json.log -X PUT --data-binary @/tmp/catalog.json http://localhost:8765/api/v1/namespaces/catalog/finalize -H "Content-Type: application/json" --header "Authorization: Bearer ***" --insecure
> Forcing deletion of exp... dry-run
curl -s -o /tmp/exp.json.log -X PUT --data-binary @/tmp/exp.json http://localhost:8765/api/v1/namespaces/exp/finalize -H "Content-Type: application/json" --header "Authorization: Bearer ***" --insecure
.: Stopping kubectl proxy... ok
:: Done in 93 seconds.
Let me know if you need any other info.
from knsk.
Awesome, @yamaszone!
The first thin is figure out why you v1beta1.servicecatalog.k8s.io
is broken. You know from it came? Looking in my full working cluster, I don't have it. If you think it is is importante, don't run the command to delete it bellow.
Let's try the commands manually... if all of it works, the error is something about BASH on MacOS.
- In one shell, let's start the proxy on port 8765 (or other port you want)
KPORT=8765
kubectl proxy -p $KPORT
- In another terminal, do the commands
kubectl delete apiservice v1beta1.servicecatalog.k8s.io (do this command only if you sure about it)
KPORT=8765 (it must be the same setted before)
BEARER=xxx (paste here your bearer code)
curl -X PUT --data-binary @/tmp/a.json http://localhost:$KPORT/api/v1/namespaces/a/finalize -H "Content-Type: application/json" -H "Authorization: Bearer $BEARER" --insecure
curl -X PUT --data-binary @/tmp/b.json http://localhost:$KPORT/api/v1/namespaces/b/finalize -H "Content-Type: application/json" -H "Authorization: Bearer $BEARER" --insecure
curl -X PUT --data-binary @/tmp/catalog.json http://localhost:$KPORT/api/v1/namespaces/catalog/finalize -H "Content-Type: application/json" -H "Authorization: Bearer $BEARER" --insecure
curl -X PUT --data-binary @/tmp/exp.json http://localhost:$KPORT/api/v1/namespaces/exp/finalize -H "Content-Type: application/json" -H "Authorization: Bearer $BEARER" --insecure
Please, let me know if it works. If not, please, take a close look at all output.
from knsk.
Related Issues (20)
- grammar error 'stucked' HOT 3
- feedbak: namespace still exists after knsk run HOT 3
- No issue.. Just a "Thank you" for a wonderful script! HOT 3
- Escape sequences are always output HOT 3
- API calls
- Detection of kubernetes
- Still stuck HOT 1
- Rancher is impossible to delete HOT 2
- problem with ns deletion HOT 9
- "service e2e-test-webhook" not found cause delete failed HOT 2
- using --type=merge to delete a stubborn CRD HOT 1
- Add license HOT 1
- Remove finalizers error HOT 4
- Feedback: Script and developer is awesome. HOT 9
- Add reusable functions
- Improve colors
- Improve documentation
- Create a protected branch for the new release HOT 1
- Improve detection of orphan resources
- Incorporate backup task
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knsk.