第一种方式
sudo kubectl delete deployment kubernetes-dashboard --namespace=kube-system
sudo kubectl delete service kubernetes-dashboard --namespace=kube-system
sudo kubectl delete role kubernetes-dashboard-minimal --namespace=kube-system
sudo kubectl delete rolebinding kubernetes-dashboard-minimal --namespace=kube-system
sudo kubectl delete sa kubernetes-dashboard --namespace=kube-system
sudo kubectl delete secret kubernetes-dashboard-certs --namespace=kube-system
sudo kubectl delete secret kubernetes-dashboard-csrf --namespace=kube-system
sudo kubectl delete secret kubernetes-dashboard-key-holder --namespace=kube-system
第二种方式
$ sudo kubectl -n kube-system delete $(sudo kubectl -n kube-system get pod -o name | grep dashboard)
pod "kubernetes-dashboard-3313488171-7706x" deleted
pod "kubernetes-dashboard-3313488171-ddkqd" deleted
pod "kubernetes-dashboard-3313488171-dpf9t" deleted
pod "kubernetes-dashboard-3313488171-jdz1n" deleted
pod "kubernetes-dashboard-3313488171-sxc9n" deleted
参考资料
How do I remove the Kubernetes dashboard pod from my deployment on Google Cloud Platform?