kubernetes dashboard not starting : giving error

3/28/2018

I have created 3 Virtualbox VMs -> installed CentOS7 -> installed kubernetes via kubespray.

Dashboard container refuses to run after VM restart. Gives the following error:

goroutine 1 [running]:
github.com/kubernetes/dashboard/src/app/backend/client.(*clientManager).initInsecureClient(0xc4201bf320)
        /home/travis/build/kubernetes/dashboard/.tmp/backend/src/github.com/kubernetes/dashboard/src/app/backend/client/manager.go:335 +0x9a
github.com/kubernetes/dashboard/src/app/backend/client.(*clientManager).init(0xc4201bf320)
        /home/travis/build/kubernetes/dashboard/.tmp/backend/src/github.com/kubernetes/dashboard/src/app/backend/client/manager.go:297 +0x47
github.com/kubernetes/dashboard/src/app/backend/client.NewClientManager(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/travis/build/kubernetes/dashboard/.tmp/backend/src/github.com/kubernetes/dashboard/src/app/backend/client/manager.go:365 +0x84
main.main()
        /home/travis/build/kubernetes/dashboard/.tmp/backend/src/github.com/kubernetes/dashboard/src/app/backend/dashboard.go:92 +0x13b
2018/03/28 11:11:49 Could not init in cluster config: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory

Please help. I am a newbie in kubernetes and unable to find any clue on resolving it.

-- everCurious
kubernetes

1 Answer

4/1/2018

I updated the kubespray playbooks (synced with github). I guess few issues were resolved due to that. The steps to connect/configure to dashboard are as follows

```

# create admin user, as follows:
kubectl create  -f admin.user
kubectl create  -f clusterrolebinding.yaml
# get admin secret token
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
# get port on which dashboard is running
kubectl -n kube-system get service kubernetes-dashboard
# open the url, add the token found above to it. BINGO ! dashboard should open :)

```

-- everCurious
Source: StackOverflow