背景: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分支:4 个月前 )
9a476333 Bumps [jest-preset-angular](https://github.com/thymikee/jest-preset-angular) from 14.2.0 to 14.2.2. - [Release notes](https://github.com/thymikee/jest-preset-angular/releases) - [Changelog](https://github.com/thymikee/jest-preset-angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/thymikee/jest-preset-angular/compare/v14.2.0...v14.2.2) --- updated-dependencies: - dependency-name: jest-preset-angular 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> 4 个月前
11b7e82e Bumps [cypress](https://github.com/cypress-io/cypress) from 13.13.1 to 13.13.2. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.13.1...v13.13.2) --- updated-dependencies: - dependency-name: cypress 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> 4 个月前
Logo

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

更多推荐