Please help - minikube + kubernetes: unable to access the dashboard

I am new to kubernetes and I have been experimenting with docker & minkube + kubernetes for a few weeks…

Everything appears to be working properly except the dashboard…These are my investigation but I have no clue how to fix this.

me@DEV ~ minikube version minikube version: v0.28.0 me@DEV ~ kubectl version
Client Version: version.Info{Major:“1”, Minor:“11”, GitVersion:“v1.11.0”, GitCommit:“91e7b4fd31fcd3d5f436da26c980becec37ceefe”, GitTreeState:“clean”, BuildDate:“2018-06-27T20:17:28Z”, GoVersion:“go1.10.2”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“10”, GitVersion:“v1.10.0”, GitCommit:“fc32d2f3698e36b93322a3465f63a14e9f0eaead”, GitTreeState:“clean”, BuildDate:“2018-03-26T16:44:10Z”, GoVersion:“go1.9.3”, Compiler:“gc”, Platform:“linux/amd64”}
zollen@DEV ~ $ kubectl logs pod/kubernetes-dashboard-5498ccf677-hw574 --namespace=kube-system
2018/07/16 00:23:46 Starting overwatch
2018/07/16 00:23:46 Using in-cluster config to connect to apiserver
2018/07/16 00:23:46 Using service account token for csrf signing
2018/07/16 00:23:46 No request provided. Skipping authorization
2018/07/16 00:24:16 Error while initializing connection to Kubernetes apiserver. This most likely means that the cluster is misconfigured (e.g., it has invalid apiserver certificates or service accounts configuration) or the --apiserver-host param points to a server that does not exist. Reason: Get https://10.96.0.1:443/version: dial tcp 10.96.0.1:443: i/o timeout
Refer to our FAQ and wiki pages for more information: https://github.com/kubernetes/dashboard/wiki/

me@DEV ~/Downloads $ minikube dashboard
Waiting, endpoint for service is not ready yet…
Waiting, endpoint for service is not ready yet…

me@DEV ~ $ curl https://10.96.0.1:443/version
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

me@DEV ~ $ kubectl proxy &
Starting to serve on 127.0.0.1:8001

me@DEV ~/Downloads curl (minikube ip):8001
curl: (7) Failed to connect to 10.0.2.15 port 8001: Connection refused
me@DEV ~/Downloads $ curl localhost:8001
{
“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/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”
]
}

.

Hey zollen,

The default minikube installation puts the dashboard on port 30000, but you can verify that with “kubectl get svc --namespace=kube-system”. Here’s what my minikube looks like:

$ kubectl get svc --namespace=kube-system
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns 10.96.0.10 53/UDP,53/TCP 5d
kubernetes-dashboard 10.110.161.176 80:30000/TCP 5d

Once you confirm that, you should be able to hit [minikube ip]:30000 in your browser.

This is mine.

me@DEV ~ $ kubectl get svc --namespace=kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns ClusterIP 10.96.0.10 53/UDP,53/TCP 13m
kubernetes-dashboard NodePort 10.103.52.13 80:30000/TCP 13m

BUT…
me@DEV ~ $ curl localhost:30000

curl: (7) Failed to connect to localhost port 30000: Connection refused

me@DEV ~ $ curl $(minikube ip):30000

curl: (7) Failed to connect to 10.0.2.15 port 30000: Connection refused

Well, if the service is up, I’d also check the rest of the deployment and make sure all the pieces are working correctly with “kubectl get all --namespace=kube-system” just to rule out issues with the deployment. (Hey, maybe the image got corrupted) I expect they are fine, though, and it looks like an environmental issue to me. My first guess is firewall rules, but I don’t know what your setup looks like. Are you running VBox on metal or inside a VM? Are you running something other than VBox? Without knowing your specifics, that’s the direction I would explore.

Frankly, though, if you don’t track it down yourself, based on the number of people who are watching, this question would probably be better over in either StackOverflow or Slack.

me@DEV ~ $ kubectl get pod/kubernetes-dashboard-5498ccf677-qb5m9 --namespace=kube-system
NAME READY STATUS RESTARTS AGE
kubernetes-dashboard-5498ccf677-qb5m9 0/1 CrashLoopBackOff 11 1h

me@DEV ~ $ kubectl logs pod/kubernetes-dashboard-5498ccf677-qb5m9 --namespace=kube-system
2018/07/16 23:51:17 Starting overwatch
2018/07/16 23:51:17 Using in-cluster config to connect to apiserver
2018/07/16 23:51:17 Using service account token for csrf signing
2018/07/16 23:51:17 No request provided. Skipping authorization
2018/07/16 23:51:47 Error while initializing connection to Kubernetes apiserver. This most likely means that the cluster is misconfigured (e.g., it has invalid apiserver certificates or service accounts configuration) or the --apiserver-host param points to a server that does not exist. Reason: Get https://10.96.0.1:443/version: dial tcp 10.96.0.1:443: i/o timeout
Refer to our FAQ and wiki pages for more information: https://github.com/kubernetes/dashboard/wiki/FAQ

I am running my home computer window 10 + VirtualBox (Linux Mint)

If it’s actually a certificate error, like it seems to be… well, you could track it down, but it would be way easier to wipe the whole minikube cluster and start over. “minikube delete”, followed by making sure the VM was deleted inside VBox, then re-running “minikube start” should put you back to a good state. I would pay particular attention during the minikube start phase, to make sure it doesn’t throw any errors.

I think I may have found the issue. When I reapply the dashboard.yaml as follow:

me@DEV ~ $ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
secret/kubernetes-dashboard-certs created
serviceaccount/kubernetes-dashboard created
role.rbac.authorization.k8s.io/kubernetes-dashboard-minimal created
rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard-minimal created
service/kubernetes-dashboard configured
_The Deployment “kubernetes-dashboard” is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{“k8s-app”:“kubernetes-dashboard”}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable

The error prevented the dashboard from fully deployed to the cluster.

Minikube actually comes with dashboard as an addon that can be enabled without having to manage any yaml outside of it :slight_smile:

You can enable it automatically with:

minikube addons enable dashboard

If you want to see the other available plugins, you can view them all with this command:

minikube addons list
1 Like