So I actually want to start my minikube cluster with a special directory mounted on it, on /data. This directory contains my db datas.
For this I try:
minikube start \
--driver=docker \
--extra-config=apiserver.service-node-port-range=1-35000 \
--disk-size=5000mb \
--mount \
--mount-string="${PWD}/srcs/mysql/datas:/data"
Actually options --mount
and --mount-string="${PWD}/srcs/mysql/datas:/data"
doesn't seem to works. No warning or error outputs are displayed but when I connect onto the machine and list files onto /data nothing appears. My directory is not mounted.
If I mount the directory with: minikube mount ${PWD}/srcs/mysql/datas:/data
it works and I can list my data in /data. (But I really want to launch it at startup and now what I'm doing wrong).
Posting this community wiki answer to indicate that the issue was resolved by:
To check on the whole scenario, I've reproduced it with a following setup:
Ubuntu 20.04
Docker 20.10.7
KVM 4.2.1
Minikube
:v1.22.0
(tested both versions with the same steps)v1.19.0
I'd reckon the issue was resolved not by deleting the
~/.minikube
directory or upgradingminikube
but rather than with a change to the destination folder that was mounted.Assuming a following setup:
$ mkdir ~/test
$ echo "General Kenobi!" > ~/test/hello_there.txt
$ minikube start --mount --mount-string ~/test:/data
$ minikube ssh
$ ls -al /data
$ minikube start --mount --mount-string ~/test:/src
<-- notice the destination change$ minikube ssh
$ ls -al /src
<-- notice the destination changeAs it can be seen the files showed correctly when mounted to the directory other than
/data
.This could be related to the persistency of some
minikube
's directories. More on that can be found here:Additional resources: