Unable to remove kubernetes-dashboard

12/27/2019

I am unable to remove Kubernetes dashboard and need help on this. I have Kubernetes and Minikube running on an AWS instance. I installed Kubernetes Dashboard by running following command:

sudo kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml

Now I want to remove this dashboard purely for the sake of learning. I have performed following steps but unsuccessful so far:

1. Delete through YAML

Command

$ sudo kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml

Output

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

Namespace and other resources get recreated immediately and dashboards keeps running:

$ 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. Delete deployments

List of dashboard deployments

$ 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

Delete dashboard deployments

$ 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

Deployments are recreated

$ 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

I am new to this technology. Please guide me on way forward here.

-- Muhammad Bilal
kubernetes
kubernetes-dashboard
kubernetes-deployment

1 Answer

12/27/2019

This issue is solved after following the solution mentioned here:

Stackoverflow: How to delete kubernetes dashboard from kube-system

-- Muhammad Bilal
Source: StackOverflow