This question already has answers here:
How can I delete the Kubernetes dashboard from kube-system?

(3个答案)


在10个月前关闭。




我无法删除Kubernetes仪表板,因此需要帮助。我在一个AWS实例上运行Kubernetes和Minikube。我通过运行以下命令安装了Kubernetes仪表板:
sudo kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
现在,我只想出于学习目的而删除此仪表板。我已经执行了以下步骤,但到目前为止未成功:

1.通过YAML删除

命令
$ sudo kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
输出量
serviceaccount "kubernetes-dashboard" deleted
service "kubernetes-dashboard" deleted
secret "kubernetes-dashboard-certs" deleted
secret "kubernetes-dashboard-csrf" deleted
secret "kubernetes-dashboard-key-holder" deleted
configmap "kubernetes-dashboard-settings" deleted
role.rbac.authorization.k8s.io "kubernetes-dashboard" deleted
clusterrole.rbac.authorization.k8s.io "kubernetes-dashboard" deleted
rolebinding.rbac.authorization.k8s.io "kubernetes-dashboard" deleted
clusterrolebinding.rbac.authorization.k8s.io "kubernetes-dashboard" deleted
deployment.apps "kubernetes-dashboard" deleted
service "dashboard-metrics-scraper" deleted
deployment.apps "dashboard-metrics-scraper" deleted

命名空间和其他资源将立即重新创建,并且仪表板将继续运行:
$ sudo kubectl get namespaces
NAME                   STATUS   AGE
default                Active   8d
kube-node-lease        Active   8d
kube-public            Active   8d
kube-system            Active   8d
kubernetes-dashboard   Active   1s

2.删除部署

仪表板部署列表
$ sudo kubectl get deployments --namespace=kubernetes-dashboard
NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
dashboard-metrics-scraper   1/1     1            1           3m38s
kubernetes-dashboard        1/1     1            1           3m38s

删除仪表板部署
$ sudo kubectl delete deployments dashboard-metrics-scraper --namespace=kubernetes-dashboard
deployment.apps "dashboard-metrics-scraper" deleted
$ sudo kubectl delete deployments kubernetes-dashboard --namespace=kubernetes-dashboard
deployment.apps "kubernetes-dashboard" deleted

重新创建部署
$ sudo kubectl get deployments --namespace=kubernetes-dashboard
NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
dashboard-metrics-scraper   0/1     1            0           22s
kubernetes-dashboard        0/1     1            0           1s

我是这项技术的新手。请在这里引导我前进。

最佳答案

按照此处提到的解决方案解决此问题:

Stackoverflow: How to delete kubernetes dashboard from kube-system

关于kubernetes - 无法删除kubernetes-dashboard ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/59496871/

10-17 03:15