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.
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.
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.
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.
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 .
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 !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With