Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to mount multiple volumes when starting minikube?

I tried this but didn't work:

minikube start --vm-driver=hyperkit --memory 8192 --mount \
               --mount-string /home/user/app1:/minikube-host/app1 \
               --mount-string /home/user/app2:/minikube-host/app2

but only /home/user/app2 was mounted.

like image 661
Eduardo Sanchez-Ros Avatar asked Jan 10 '19 13:01

Eduardo Sanchez-Ros


People also ask

How do I mount a folder to minikube?

You can't mount your local directory into your Pod directly. First, you need to mount your directory $HOME/go/src/github.com/nginx into your minikube. Then If you mount /data into your Pod using hostPath, you will get you local directory data into Pod.

How big is minikube?

The answer is Minikube, which can help you easily set up a proper Kubernetes node suitable for your everyday development needs. To get going, the minikube start command just brings up a single-node Kubernetes environment with 2GB RAM, 2 CPUS, and a disk of 20GB.

How do I start minikube Apiserver?

Running minikube start will automatically configure kubectl . You can run minikube ip to get the IP that your minikube is on. The API server runs on 8443 by default. Update: To access the API server directly, you'll need to use the custom SSL certs that have been generated.


Video Answer


2 Answers

You can run multiple mount commands after starting your minikube to mount the different folders:

minikube mount /home/user/app1:/minikube-host/app1
minikube mount /home/user/app2:/minikube-host/app2

This will mount multiple folders in minikube .

like image 58
Prafull Ladha Avatar answered Oct 16 '22 08:10

Prafull Ladha


There is no need for multiple volumes when starting in your case.

Also, minikube mount after start needs a terminal in running state(opened always).

You can mount /home/user -> /minikube-host. All the folders inside /home/user will be inside VM at /minikube-host.

  • /home/user/app1 will be available inside VM as /minikube-host/app1
  • /home/user/app2 will be available inside VM as /minikube-host/app2

    minikube start --vm-driver=hyperkit --memory 8192 --mount \ --mount-string /home/user:/minikube-host

Hope this helps !

like image 1
devansvd Avatar answered Oct 16 '22 08:10

devansvd