-
Notifications
You must be signed in to change notification settings - Fork 5k
Support multi mount-string #21056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Support multi mount-string #21056
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: bugwz The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @bugwz! |
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 Once the patch is verified, the new status will be reflected by the 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
Times for minikube start: 51.3s 52.9s 51.4s 52.5s 51.6s Times for minikube (PR 21056) ingress: 14.6s 16.2s 16.1s 15.1s 15.1s docker driver with docker runtime
Times for minikube start: 24.8s 27.4s 23.4s 26.9s 23.9s Times for minikube ingress: 13.8s 12.8s 11.3s 13.3s 13.4s docker driver with containerd runtime
Times for minikube start: 25.2s 21.2s 21.8s 21.5s 24.0s Times for minikube (PR 21056) ingress: 39.8s 22.8s 38.9s 38.9s 23.8s |
@medyagh Below is the comparison information, please take a look~ Before:
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 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see comments and also fix lint issues (make lint)
Name: "relative container path", | ||
MountString: "/foo/bar:baz/bat:private", | ||
ExpectErr: true, | ||
Name: "relative container path", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add more unit test cases and include some test cases with semi colomon
@@ -173,7 +173,7 @@ func initMinikubeFlags() { | |||
startCmd.Flags().Bool(embedCerts, false, "if true, will embed the certs in kubeconfig.") | |||
startCmd.Flags().StringP(containerRuntime, "c", constants.DefaultContainerRuntime, fmt.Sprintf("The container runtime to be used. Valid options: %s (default: auto)", strings.Join(cruntime.ValidRuntimes(), ", "))) | |||
startCmd.Flags().Bool(createMount, false, "This will start the mount daemon and automatically mount files into minikube.") | |||
startCmd.Flags().String(mountString, constants.DefaultMountDir+":/minikube-host", "The argument to pass the minikube mount command on start.") | |||
startCmd.Flags().String(mountString, constants.DefaultMountDir+":/minikube-host", "The argument to pass the minikube mount command on start, in a semicolon-separated format.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can add an example here for clarity
When using
minikube start
, we can pass in multiple paths that we want to mount inside the container through themount-string
parameter, for example:minikube start --mount --mount-string="/data01:/data01;/data02:/data02:Z,rshared"