背景:k8s集群重新安装kubernetes-dashboard出现了这个问题,使用了删除命名空间,但因为一直在termnating,所以导致无法有效删除.

解决办法:

1、查看命名空间:
kubectl  get ns 

在这里插入图片描述

2、查看kubernetes-dashboard的命名空间描述
kubectl get ns kubernetes-dashboard  -o json > kubernetes-dashboard.json
3、编辑
sudo vim kubernetes-dashboard.json
删除spec
删除前

在这里插入图片描述

删除后

在这里插入图片描述

4、 打开一个新窗口运行kubectl proxy跑一个API代理在本地的8081端口
kubectl proxy --port=8081
5、curl删除
curl -k -H "Content-Type:application/json" -X PUT --data-binary @kubernetes-dashboard.json http://127.0.0.1:8081/api/v1/namespaces/kubernetes-dashboard/finalize
6、结果如下:

在这里插入图片描述
在这里插入图片描述

GitHub 加速计划 / da / dashboard
7
2
下载
General-purpose web UI for Kubernetes clusters
最近提交(Master分支:6 个月前 )
60975e98 Bumps [@graphql-mesh/runtime](https://github.com/ardatan/graphql-mesh/tree/HEAD/packages/legacy/runtime) from 0.105.10 to 0.105.11. - [Release notes](https://github.com/ardatan/graphql-mesh/releases) - [Changelog](https://github.com/ardatan/graphql-mesh/blob/master/packages/legacy/runtime/CHANGELOG.md) - [Commits](https://github.com/ardatan/graphql-mesh/commits/@graphql-mesh/runtime@0.105.11/packages/legacy/runtime) --- updated-dependencies: - dependency-name: "@graphql-mesh/runtime" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1 个月前
8d93b32e Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 9.1.0 to 9.1.2. - [Release notes](https://github.com/open-cli-tools/concurrently/releases) - [Commits](https://github.com/open-cli-tools/concurrently/compare/v9.1.0...v9.1.2) --- updated-dependencies: - dependency-name: concurrently dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐