can't access kubernetes Dashboard

Hugo picture Hugo · Feb 7, 2017 · Viewed 14.7k times · Source

i followed this guide link to install a kubernetes cluster and i have no error, but i can't access kubernetes-Dashboard

I did kubectl create -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml and when i go to https://192.168.11.20/ui is nothing there

how can i access the dashboard?

some additional information

[root@kubeMaster ~]# kubectl get nodes
NAME        STATUS    AGE
kubenode1   Ready     6h
kubenode2   Ready     6h

[root@kubeMaster ~]# kubectl get pods
No resources found.

[root@kubeMaster ~]# kubectl describe svc kubernetes-dashboard --namespace=kube-system
Name:           kubernetes-dashboard
Namespace:      kube-system
Labels:         app=kubernetes-dashboard
Selector:       app=kubernetes-dashboard
Type:           NodePort
IP:         10.254.81.213
Port:           <unset> 80/TCP
NodePort:       <unset> 31785/TCP
Endpoints:      <none>
Session Affinity:   None
No events.

[root@kubeMaster ~]# kubectl get deployment kubernetes-dashboard --namespace=kube-system
NAME                   DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
kubernetes-dashboard   1         0         0            0           6h

[root@kubeMaster ~]# kubectl --namespace=kube-system get ep kubernetes-dashboard
NAME                   ENDPOINTS   AGE
kubernetes-dashboard   <none>      6h

[root@kubeMaster ~]# kubectl cluster-info
Kubernetes master is running at http://kubeMaster:8080

[root@kubeMaster ~]# kubectl get ns
NAME          STATUS    AGE
default       Active    6h
kube-system   Active    6h

[root@kubeMaster ~]# kubectl get ep
NAME         ENDPOINTS            AGE
kubernetes   192.168.11.20:6443   6h

Answer

Tim Allclair picture Tim Allclair · Feb 7, 2017

192.168.0.0/16 is a private IP range, meaning you need to be within the cluster's network to access it.

The easiest way to access your service outside the cluster is to run kubectl proxy, which will proxy requests to your localhost port 8001 to the Kubernetes API server. From there, the apiserver can proxy to your service:

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