Support multi mount-string
When using minikube start, we can pass in multiple paths that we want to mount inside the container through the mount-string parameter, for example:
minikube start --mount --mount-string="/data01:/data01;/data02:/data02:Z,rshared"
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: bugwz / name: bugwz (14c679030368174bde9cbd24753f8c141c6e6da0, 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c, ec06ac5586627ec67dd4e03d1015755f6246b66d, ce2bea2441324f77d9502712817f4368f40ac312)
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: bugwz Once this PR has been reviewed and has the lgtm label, please assign comradeprogrammer for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Welcome @bugwz!
It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes/minikube has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
Hi @bugwz. Thanks for your PR.
I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
Can one of the admins verify this patch?
/ok-to-test
@bugwz can you plz share Before/After this PR output of minikube?
kvm2 driver with docker runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 51.9s | 53.6s |
| enable ingress | 15.3s | 15.4s |
+----------------+----------+---------------------+
Times for minikube start: 51.3s 52.9s 51.4s 52.5s 51.6s Times for minikube (PR 21056) start: 58.1s 53.1s 51.7s 52.8s 52.2s
Times for minikube (PR 21056) ingress: 14.6s 16.2s 16.1s 15.1s 15.1s Times for minikube ingress: 15.1s 16.1s 15.6s 14.6s 15.1s
docker driver with docker runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 25.3s | 25.2s |
| enable ingress | 12.9s | 13.1s |
+----------------+----------+---------------------+
Times for minikube start: 24.8s 27.4s 23.4s 26.9s 23.9s Times for minikube (PR 21056) start: 25.8s 24.3s 23.6s 26.4s 26.0s
Times for minikube ingress: 13.8s 12.8s 11.3s 13.3s 13.4s Times for minikube (PR 21056) ingress: 13.3s 13.3s 13.3s 12.8s 12.8s
docker driver with containerd runtime
+-------------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+-------------------+----------+---------------------+
| minikube start | 22.8s | 23.3s |
| ⚠️ enable ingress | 23.5s | 32.8s ⚠️ |
+-------------------+----------+---------------------+
Times for minikube start: 25.2s 21.2s 21.8s 21.5s 24.0s Times for minikube (PR 21056) start: 24.1s 23.8s 22.5s 22.2s 24.0s
Times for minikube (PR 21056) ingress: 39.8s 22.8s 38.9s 38.9s 23.8s Times for minikube ingress: 24.4s 23.8s 22.8s 23.8s 22.8s
@medyagh Below is the comparison information, please take a look~
Before:
[bugwz@iZj6cibr8kn3thfefwcyg3Z minikube]# ./out/minikube version
minikube version: v1.36.0
commit: 78989b99c29903d39ba5a8f2a0fef52d8b2c4497
[bugwz@iZj6cibr8kn3thfefwcyg3Z minikube]# ./out/minikube start --help
...
--mount-string='/home/bugwz:/minikube-host':
The argument to pass the minikube mount command on start.
...
[bugwz@iZj6cibr8kn3thfefwcyg3Z minikube]$ ./out/minikube start --driver="podman" --mount --mount-string="/data01:/data01"
😄 minikube v1.36.0 on Centos 8.5.2111 (amd64)
✨ Using the docker driver based on user configuration
💣 Exiting due to PROVIDER_DOCKER_VERSION_EXIT_1: "docker version --format <no value>-<no value>:<no value>" exit status 1: Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
time="2025-07-12T12:19:12+08:00" level=error msg="XDG_RUNTIME_DIR directory \"/run/user/0\" is not owned by the current user"
📘 Documentation: https://minikube.sigs.k8s.io/docs/drivers/docker/
[bugwz@iZj6cibr8kn3thfefwcyg3Z minikube]$ ./out/minikube start --driver="podman" --mount --mount-string="/data01:/data01"
😄 minikube v1.36.0 on Centos 8.5.2111 (amd64)
❗ The minimum required version for podman is "4.9.0". your version is "3.3.1". minikube might not work. use at your own risk. To install latest version please see https://podman.io/getting-started/installation.html
✨ Using the podman driver based on user configuration
🧯 The requested memory allocation of 3072MiB does not leave room for system overhead (total system memory: 3625MiB). You may face stability issues.
💡 Suggestion: Start minikube with less memory allocated: 'minikube start --memory=3072mb'
📌 Using Podman driver with root privileges
👍 Starting "minikube" primary control-plane node in "minikube" cluster
🚜 Pulling base image v0.0.47 ...
💾 Downloading Kubernetes v1.33.2 preload ...
> preloaded-images-k8s-v18-v1...: 348.11 MiB / 348.11 MiB 100.00% 10.32 M
> gcr.io/k8s-minikube/kicbase...: 502.26 MiB / 502.26 MiB 100.00% 6.70 Mi
E0712 12:20:35.359832 15917 cache.go:225] Error downloading kic artifacts: not yet implemented, see issue #8426
🔥 Creating podman container (CPUs=2, Memory=3072MB) ...
🐳 Preparing Kubernetes v1.33.2 on Docker 28.1.1 ...
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
🔗 Configuring bridge CNI (Container Networking Interface) ...
🔎 Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: storage-provisioner, default-storageclass
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
[bugwz@iZj6cibr8kn3thfefwcyg3Z minikube]$ sudo podman inspect minikube
[
{
"Id": "db2b5308a1f00f4fa9bd5192286f320a0fe4ae8ca636a1a29d386505599a5d7c",
"Created": "2025-07-12T12:21:45.17550111+08:00",
"Path": "/usr/local/bin/entrypoint",
"Args": [
"/sbin/init"
...
"Mounts": [
{
"Type": "volume",
"Name": "minikube",
"Source": "/var/lib/containers/storage/volumes/minikube/_data",
"Destination": "/var",
"Driver": "local",
"Mode": "",
"Options": [
"exec",
"nosuid",
"nodev",
"rbind"
],
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/lib/modules",
"Destination": "/lib/modules",
"Driver": "",
"Mode": "",
"Options": [
"rbind"
],
"RW": false,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/data01",
"Destination": "/data01",
"Driver": "",
"Mode": "",
"Options": [
"rbind"
],
"RW": true,
"Propagation": "rprivate"
}
],
...
After:
[bugwz@iZj6cibr8kn3thfefwcyg3Z minikube]$ ./out/minikube version
minikube version: v1.36.0
commit: 14c679030368174bde9cbd24753f8c141c6e6da0
[bugwz@iZj6cibr8kn3thfefwcyg3Z minikube]# ./out/minikube start --help
...
--mount-string='/home/bugwz:/minikube-host':
The argument to pass the minikube mount command on start, in a semicolon-separated format.
...
[bugwz@iZj6cibr8kn3thfefwcyg3Z minikube]$ ./out/minikube start --driver="podman" --mount --mount-string="/data01:/data01;/data02:/data02:Z,rshared"
😄 minikube v1.36.0 on Centos 8.5.2111 (amd64)
❗ The minimum required version for podman is "4.9.0". your version is "3.3.1". minikube might not work. use at your own risk. To install latest version please see https://podman.io/getting-started/installation.html
✨ Using the podman driver based on user configuration
🧯 The requested memory allocation of 3072MiB does not leave room for system overhead (total system memory: 3625MiB). You may face stability issues.
💡 Suggestion: Start minikube with less memory allocated: 'minikube start --memory=3072mb'
📌 Using Podman driver with root privileges
👍 Starting "minikube" primary control-plane node in "minikube" cluster
🚜 Pulling base image v0.0.47 ...
E0712 12:30:33.731925 33550 cache.go:225] Error downloading kic artifacts: not yet implemented, see issue #8426
🔥 Creating podman container (CPUs=2, Memory=3072MB) ...
🐳 Preparing Kubernetes v1.33.2 on Docker 28.1.1 ...
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
🔗 Configuring bridge CNI (Container Networking Interface) ...
🔎 Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: storage-provisioner, default-storageclass
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
[bugwz@iZj6cibr8kn3thfefwcyg3Z minikube]$ sudo podman inspect minikube
[
{
"Id": "7cea00a807474ac6a111bc91ab33c9a857ca17831c1ba4df0521221bdca384b9",
"Created": "2025-07-12T12:30:43.641329142+08:00",
"Path": "/usr/local/bin/entrypoint",
"Args": [
"/sbin/init"
],
...
"Mounts": [
{
"Type": "volume",
"Name": "minikube",
"Source": "/var/lib/containers/storage/volumes/minikube/_data",
"Destination": "/var",
"Driver": "local",
"Mode": "",
"Options": [
"exec",
"nosuid",
"nodev",
"rbind"
],
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/lib/modules",
"Destination": "/lib/modules",
"Driver": "",
"Mode": "",
"Options": [
"rbind"
],
"RW": false,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/data01",
"Destination": "/data01",
"Driver": "",
"Mode": "",
"Options": [
"rbind"
],
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/data02",
"Destination": "/data02",
"Driver": "",
"Mode": "",
"Options": [
"rbind"
],
"RW": true,
"Propagation": "rshared"
}
],
...
thank you @bugwz can you plz fix the lint issue ? u can run "make lint" or look at output of https://github.com/kubernetes/minikube/actions/runs/16223086483/job/45836007332?pr=21056
@medyagh Thank you for the suggestion, it has been updated.
kvm2 driver with docker runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 49.6s | 52.8s |
| enable ingress | 14.7s | 14.8s |
+----------------+----------+---------------------+
Times for minikube (PR 21056) start: 51.8s 53.2s 54.5s 51.6s 52.9s Times for minikube start: 52.1s 48.7s 49.4s 48.2s 49.8s
Times for minikube ingress: 14.6s 15.0s 14.5s 14.6s 15.0s Times for minikube (PR 21056) ingress: 15.0s 15.0s 15.0s 14.5s 14.6s
docker driver with docker runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 24.4s | 24.0s |
| enable ingress | 12.8s | 13.0s |
+----------------+----------+---------------------+
Times for minikube start: 25.6s 23.3s 25.4s 22.9s 24.7s Times for minikube (PR 21056) start: 25.6s 24.3s 23.3s 22.3s 24.4s
Times for minikube ingress: 13.3s 13.3s 12.3s 12.3s 12.8s Times for minikube (PR 21056) ingress: 12.8s 13.8s 13.3s 12.8s 12.3s
docker driver with containerd runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 23.7s | 21.6s |
| enable ingress | 23.2s | 24.4s |
+----------------+----------+---------------------+
Times for minikube start: 22.1s 25.0s 23.2s 26.8s 21.4s Times for minikube (PR 21056) start: 20.6s 22.1s 21.0s 22.9s 21.5s
Times for minikube ingress: 22.8s 22.8s 22.8s 23.3s 24.3s Times for minikube (PR 21056) ingress: 22.8s 30.8s 22.8s 22.9s 22.8s
/retest-this-please
kvm2 driver with docker runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 50.7s | 51.2s |
| enable ingress | 14.9s | 15.1s |
+----------------+----------+---------------------+
Times for minikube ingress: 14.6s 15.0s 15.5s 14.5s 15.0s Times for minikube (PR 21056) ingress: 15.0s 14.5s 15.0s 16.0s 15.0s
Times for minikube start: 49.8s 51.6s 48.5s 52.4s 51.2s Times for minikube (PR 21056) start: 49.7s 51.2s 50.8s 51.1s 53.3s
docker driver with docker runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 25.5s | 23.8s |
| enable ingress | 13.1s | 13.4s |
+----------------+----------+---------------------+
Times for minikube ingress: 13.9s 13.3s 13.8s 11.3s 13.3s Times for minikube (PR 21056) ingress: 13.3s 12.8s 13.4s 13.8s 13.8s
Times for minikube (PR 21056) start: 24.2s 24.3s 23.8s 23.0s 23.7s Times for minikube start: 26.3s 25.2s 26.5s 24.6s 25.1s
docker driver with containerd runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 22.9s | 23.1s |
| enable ingress | 26.9s | 29.6s |
+----------------+----------+---------------------+
Times for minikube (PR 21056) ingress: 38.8s 23.8s 39.8s 22.8s 22.8s Times for minikube ingress: 38.8s 22.8s 22.8s 27.3s 22.8s
Times for minikube start: 24.9s 22.3s 21.9s 22.5s 23.0s Times for minikube (PR 21056) start: 21.6s 23.5s 24.4s 21.3s 24.4s
@bugwz are you interested to add the same functionality to "minikube mount" command as well so it has feature parity?
@medyagh Thank you for your suggestion. I will continue to improve as per your advice. Stay tuned!😜
PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
@medyagh
Hello, I have submitted new changes, please conduct a code review.
The relevant changes are as follows:
- Added support for multiple mounts in the mount feature.
- Modified documentation for mount and start.
Design approach for minikube mount:
- Added
RootandRootIdxvariables to theUfsstruct of the 9p server to record the hostPaths and index. - Added a
rootvariable to theufsFidstruct of the 9p server to record the mapped hostPath. - Passed the
hostPathsas an argument when starting the 9p server. - When the
mount -t 9p *command is called sequentially, the 9p server processes the requests from the kernel by calling theAttachfunction. TheAttachfunction selectsRoot[RootIdx]based on the execution order and assigns it to thefid.rootvariable. - Subsequent file and directory operations will parse the value of the
fid.rootvariable.
Although the 9p server processes messages in parallel, our execution of the mount -t 9p * operation is sequential, so theoretically, the final mapping order should not be incorrect.
kvm2 driver with docker runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 49.0s | 49.3s |
| enable ingress | 14.9s | 14.8s |
+----------------+----------+---------------------+
Times for minikube ingress: 14.9s 15.4s 14.9s 14.5s 14.9s Times for minikube (PR 21056) ingress: 14.9s 15.0s 14.6s 15.0s 14.4s
Times for minikube start: 48.2s 47.1s 51.0s 49.2s 49.6s Times for minikube (PR 21056) start: 50.8s 50.7s 48.8s 47.8s 48.5s
docker driver with docker runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 23.5s | 23.6s |
| enable ingress | 13.2s | 13.1s |
+----------------+----------+---------------------+
Times for minikube start: 25.4s 22.8s 21.8s 21.7s 25.9s Times for minikube (PR 21056) start: 24.8s 22.4s 22.7s 23.4s 24.6s
Times for minikube ingress: 13.3s 12.8s 13.8s 13.3s 12.8s Times for minikube (PR 21056) ingress: 13.3s 12.8s 13.8s 12.8s 12.8s
docker driver with containerd runtime
+----------------+----------+---------------------+
| COMMAND | MINIKUBE | MINIKUBE (PR 21056) |
+----------------+----------+---------------------+
| minikube start | 23.4s | 22.4s |
| enable ingress | 22.9s | 22.9s |
+----------------+----------+---------------------+
Times for minikube ingress: 22.8s 22.8s 22.8s 22.8s 23.3s Times for minikube (PR 21056) ingress: 22.8s 23.3s 22.8s 22.8s 22.8s
Times for minikube start: 25.1s 23.9s 22.1s 23.3s 22.5s Times for minikube (PR 21056) start: 21.4s 22.5s 21.8s 23.7s 22.7s
@nirs please review this
Is anyone following up?
When using
minikube start, we can pass in multiple paths that we want to mount inside the container through themount-stringparameter, for example:minikube start --mount --mount-string="/data01:/data01;/data02:/data02:Z,rshared"
--mount is not use now. For --mount-string we should not use non standard format like this.
A better way would be to use multiple --mount-string flags using cmd.Flags().StringArray():
--mount-string /dir1:/mnt/dir1[:options]
--mount-string /dir2:/mnt/dir2[:options]
This will be parsed as:
[]string{"/dir1:/mnt/dir1:options", "/dir2:/mnt/dir2:options"}
The advantage is not having to use non-standard separator for users, and having to write special code for parsing the flags.
We ware adding virtiofs support (currently in vfkit and krunkit), so we need to pass options that can work with virtiofs. This should work also with 9p (legacy mount for other drivers), and for podamn/docker we need the special Z option.
We have issues with how --mount-options and other flags like --mount-uid and --mount=guid will be handled. We want to depracate these flags in 1.37 and remove them in 1.38, so options will be specified per mount.
See #21149
minikube mount ~/.asdf/:/tmp1/;~/.vscode/:/tmp2
We should not support such thing, we can accept multiple arguments:
minikube mount "/a:/b" "/c:/d"
But do can we mount multiple mounts with single mount command? It makes sense if we can run single mount server serving multiple commands. If we actually start multiple servers it is better to support one mount argument.
@bugwz: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| pull-minikube-build | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test pull-minikube-build |
| pull-minikube-integration | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test pull-minikube-integration |
| integration-kvm-crio-linux-x86-64 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-kvm-crio-linux-x86-64 |
| integration-kvm-containerd-linux-x86-64 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-kvm-containerd-linux-x86-64 |
| integration-kvm-docker-linux-x86-64 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-kvm-docker-linux-x86-64 |
| integration-docker-docker-linux-x86-64 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-docker-docker-linux-x86-64 |
| integration-docker-crio-linux-x86-64 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-docker-crio-linux-x86-64 |
| integration-docker-containerd-linux-x86-64 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-docker-containerd-linux-x86-64 |
| integration-none-docker-linux-x86-64 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-none-docker-linux-x86-64 |
| integration-docker-docker-linux-arm64 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-docker-docker-linux-arm64 |
| integration-kvm-docker-linux-x86 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-kvm-docker-linux-x86 |
| integration-none-docker-linux-x86 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-none-docker-linux-x86 |
| integration-kvm-containerd-linux-x86 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-kvm-containerd-linux-x86 |
| integration-docker-docker-linux-arm | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-docker-docker-linux-arm |
| integration-kvm-crio-linux-x86 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-kvm-crio-linux-x86 |
| integration-docker-crio-linux-x86 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-docker-crio-linux-x86 |
| integration-docker-docker-linux-x86 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-docker-docker-linux-x86 |
| integration-docker-containerd-linux-x86 | 82c5e0ec7ef1534ec2b8b85ad6446903c408b18c | link | true | /test integration-docker-containerd-linux-x86 |
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.