kubernetes minikube not working with mount

8/6/2019

I am using kubernetes with minikube and trying to create a mount on my machine, see original SO question

Someone pointed out this github issue stating that hostPath mount on minikube is not working and suggested this fix.

When I try to implement the fix and starting minikibe with the following command:

minikube start --mount --mount-string /home/user/data:/data

I suddenly cannot use

minikube dashboard

because I get this error (about a few tens of times):

Temporary Error: Error getting service kubernetes-dashboard: Get https://192.168.39.73:8443/api/v1/namespaces/kube-system/services/kubernetes-dashboard?timeout=1m0s: dial tcp 192.168.39.73:8443: connect: connection refused

When I start minikube with

minikube start 

The dashboard is working perfectly.

-- thebeancounter
filesystems
kubernetes
minikube
mount
ubuntu

1 Answer

8/14/2019

There are some things to consider:

  1. Check if you have the dashboard addon enabled:
kubectl get pods -n kube-system
kubectl describe pod <dashboard-addon-name> -n kube-system

ALSO

minikube addons list

Look for this:

...
- dashboard: enabled
...

To enable execute: minikube addons enable dashboard

  1. There might be some issue with the versions due to the changes you made. Try to execute:
minikube stop
minikube delete
minikube start

before you hit:

minikube start --mount --mount-string /home/user/data:/data
  1. Minikube needs dome time to get the pods ready. Try to simply wait a few minutes longer before trying to execute: minikube dashboard. Also you can check it with kubectl get pods --all-namespaces

  2. Check your proxy configuration. You might need to add the minikube ip to the no_proxy env variable:

export no_proxy=$no_proxy,$(minikube ip)
  1. If nothing helps you'll need to dig deeper. Start from the logs:
minikube dashboard --logtostderr --v=2

Please let me know if that helped.

-- OhHiMark
Source: StackOverflow