Not able to see Kubernetes UI Dashboard

4/2/2018

I have set up a cluster where there are 2 nodes. One is Master and Other is a node, both on different Azure ubuntu VMs. For networking, I used Canal tool. $ kubectl get nodes NAME STATUS ROLES AGE VERSION ubuntu-aniket1 Ready master 57m v1.10.0 ubutu-aniket Ready <none> 56m v1.10.0

$ kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE kube-system canal-jztfd 3/3 Running 0 57m kube-system canal-mdbbp 3/3 Running 0 57m kube-system etcd-ubuntu-aniket1 1/1 Running 0 58m kube-system kube-apiserver-ubuntu-aniket1 1/1 Running 0 58m kube-system kube-controller-manager-ubuntu-aniket1 1/1 Running 0 58m kube-system kube-dns-86f4d74b45-8zqqr 3/3 Running 0 58m kube-system kube-proxy-k5ggz 1/1 Running 0 58m kube-system kube-proxy-vx9sq 1/1 Running 0 57m kube-system kube-scheduler-ubuntu-aniket1 1/1 Running 0 58m kube-system kubernetes-dashboard-54865c6fb9-kg5zt 1/1 Running 0 26m When I tried to create kubernetes Dashboard with

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml and set proxy as

sh $ kubectl proxy --address 0.0.0.0 --accept-hosts '.*' Starting to serve on [::]:8001 When I hit url http://<master IP>:8001 in browser, it shows following output { "paths": [ "/api", "/api/v1", "/apis", "/apis/", "/apis/admissionregistration.k8s.io", "/apis/admissionregistration.k8s.io/v1beta1", "/apis/apiextensions.k8s.io", "/apis/apiextensions.k8s.io/v1beta1", "/apis/apiregistration.k8s.io", "/apis/apiregistration.k8s.io/v1", "/apis/apiregistration.k8s.io/v1beta1", "/apis/apps", "/apis/apps/v1", "/apis/apps/v1beta1", "/apis/apps/v1beta2", "/apis/authentication.k8s.io", "/apis/authentication.k8s.io/v1", "/apis/authentication.k8s.io/v1beta1", "/apis/authorization.k8s.io", "/apis/authorization.k8s.io/v1", "/apis/authorization.k8s.io/v1beta1", "/apis/autoscaling", "/apis/autoscaling/v1", "/apis/autoscaling/v2beta1", "/apis/batch", "/apis/batch/v1", "/apis/batch/v1beta1", "/apis/certificates.k8s.io", "/apis/certificates.k8s.io/v1beta1", "/apis/crd.projectcalico.org", "/apis/crd.projectcalico.org/v1", "/apis/events.k8s.io", "/apis/events.k8s.io/v1beta1", "/apis/extensions", "/apis/extensions/v1beta1", "/apis/networking.k8s.io", "/apis/networking.k8s.io/v1", "/apis/policy", "/apis/policy/v1beta1", "/apis/rbac.authorization.k8s.io", "/apis/rbac.authorization.k8s.io/v1", "/apis/rbac.authorization.k8s.io/v1beta1", "/apis/storage.k8s.io", "/apis/storage.k8s.io/v1", "/apis/storage.k8s.io/v1beta1", "/healthz", "/healthz/autoregister-completion", "/healthz/etcd", "/healthz/ping", "/healthz/poststarthook/apiservice-openapi-controller", "/healthz/poststarthook/apiservice-registration-controller", "/healthz/poststarthook/apiservice-status-available-controller", "/healthz/poststarthook/bootstrap-controller", "/healthz/poststarthook/ca-registration", "/healthz/poststarthook/generic-apiserver-start-informers", "/healthz/poststarthook/kube-apiserver-autoregistration", "/healthz/poststarthook/rbac/bootstrap-roles", "/healthz/poststarthook/start-apiextensions-controllers", "/healthz/poststarthook/start-apiextensions-informers", "/healthz/poststarthook/start-kube-aggregator-informers", "/healthz/poststarthook/start-kube-apiserver-informers", "/logs", "/metrics", "/openapi/v2", "/swagger-2.0.0.json", "/swagger-2.0.0.pb-v1", "/swagger-2.0.0.pb-v1.gz", "/swagger.json", "/swaggerapi", "/version" ] } But when I tries to hit http://<master IP>:8001/ui I am not able to see Kubernetes dashboard. Instead I see following output { "paths": [ "/apis", "/apis/", "/apis/apiextensions.k8s.io", "/apis/apiextensions.k8s.io/v1beta1", "/healthz", "/healthz/etcd", "/healthz/ping", "/healthz/poststarthook/generic-apiserver-start-informers", "/healthz/poststarthook/start-apiextensions-controllers", "/healthz/poststarthook/start-apiextensions-informers", "/metrics", "/openapi/v2", "/swagger-2.0.0.json", "/swagger-2.0.0.pb-v1", "/swagger-2.0.0.pb-v1.gz", "/swagger.json", "/swaggerapi", "/version" ] }

Could you please help me resolving dashboard issue?

Thanks in advance

-- aniket kshirsagar
azure
kubernetes
kubernetes-dashboard

3 Answers

2/6/2019

I faced same issue when i was creating my self-hosted kubernetes cluster on aws ec2 machines. I troubleshooted in following way and fixed

$ ssh -i ~/.ssh/id_rsa admin@api.example.com (Enter in Master machines from kops installed machine)

$ kubectl proxy --address=0.0.0.0 --port-8001 &

$ ssh -i pemfile username@Ip-address (in machine where you installed kops )

$ cat ~/.kube/config (to get user  name and password )

$ kubectl -n kube-system describe secret admin-user-token-id

To get DashBoard

http://MasterIP_address:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

-- Shree Prakash
Source: StackOverflow

4/2/2018

As mention in kubernetes/dashboard issue 1803:

changes in kubernetes 1.6 users that want to enable RBACs should configure them first to allow dashboard access to api server.

Make sure you have define a service account as in here, to be able to access the dashboard.

See "Service Account Permissions":

Default RBAC policies grant scoped permissions to control-plane components, nodes, and controllers, but grant no permissions to service accounts outside the “kube-system” namespace (beyond discovery permissions given to all authenticated users).

This allows you to grant particular roles to particular service accounts as needed.
Fine-grained role bindings provide greater security, but require more effort to administrate.
Broader grants can give unnecessary (and potentially escalating) API access to service accounts, but are easier to administrate.

-- VonC
Source: StackOverflow

4/2/2018

Try go to:

http://<master IP>:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

As mentioned here: https://github.com/kubernetes/dashboard

-- rom
Source: StackOverflow