Skip to content
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

add support for 'vmnet-*' networks in qemu with root privs #16339

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

prezha
Copy link
Contributor

@prezha prezha commented Apr 17, 2023

this pr adds support for "vmnet-host", "vmnet-shared" and "vmnet-bridged" networks in qemu v7.1+ run with elevated-root privileges (for *nix) via existing --network flag

note: --network vmnet-shared is probably what most users would want to use

example run on M1 Pro (Ventura 13.3.1) with QEMU 7.2.1:

➜  minikube git:(master) ✗ out/minikube start --driver qemu --network vmnet-shared
😄  minikube v1.30.1 on Darwin 13.3.1 (arm64)
✨  Using the qemu2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...- Passwor-

🐳  Preparing Kubernetes v1.26.3 on Docker 20.10.23 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring bridge CNI (Container Networking Interface) ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass
🔎  Verifying Kubernetes components...
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗ out/minikube profile list
|----------|-----------|---------|---------------|------|---------|---------|-------|--------|
| Profile  | VM Driver | Runtime |      IP       | Port | Version | Status  | Nodes | Active |
|----------|-----------|---------|---------------|------|---------|---------|-------|--------|
| minikube | qemu2     | docker  | 192.168.105.8 | 8443 | v1.26.3 | Running |     1 | *      |
|----------|-----------|---------|---------------|------|---------|---------|-------|--------|
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗ kubectl get nodes,deployments,pods -A -owide
NAME            STATUS   ROLES           AGE   VERSION   INTERNAL-IP     EXTERNAL-IP   OS-IMAGE               KERNEL-VERSION   CONTAINER-RUNTIME
node/minikube   Ready    control-plane   29s   v1.26.3   192.168.105.8   <none>        Buildroot 2021.02.12   5.10.57          docker://20.10.23

NAMESPACE     NAME                      READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES                                   SELECTOR
kube-system   deployment.apps/coredns   1/1     1            1           26s   coredns      registry.k8s.io/coredns/coredns:v1.9.3   k8s-app=kube-dns

NAMESPACE     NAME                                   READY   STATUS    RESTARTS   AGE   IP              NODE       NOMINATED NODE   READINESS GATES
kube-system   pod/coredns-787d4945fb-p9nrf           1/1     Running   0          12s   10.244.0.2      minikube   <none>           <none>
kube-system   pod/etcd-minikube                      1/1     Running   0          25s   192.168.105.8   minikube   <none>           <none>
kube-system   pod/kube-apiserver-minikube            1/1     Running   0          27s   192.168.105.8   minikube   <none>           <none>
kube-system   pod/kube-controller-manager-minikube   1/1     Running   0          26s   192.168.105.8   minikube   <none>           <none>
kube-system   pod/kube-proxy-cfpm4                   1/1     Running   0          12s   192.168.105.8   minikube   <none>           <none>
kube-system   pod/kube-scheduler-minikube            1/1     Running   0          27s   192.168.105.8   minikube   <none>           <none>
kube-system   pod/storage-provisioner                1/1     Running   0          25s   192.168.105.8   minikube   <none>           <none>
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗ kubectl run nginx --image nginx
pod/nginx created
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗ kubectl get nodes,deployments,pods -A -owide
NAME            STATUS   ROLES           AGE   VERSION   INTERNAL-IP     EXTERNAL-IP   OS-IMAGE               KERNEL-VERSION   CONTAINER-RUNTIME
node/minikube   Ready    control-plane   47s   v1.26.3   192.168.105.8   <none>        Buildroot 2021.02.12   5.10.57          docker://20.10.23

NAMESPACE     NAME                      READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES                                   SELECTOR
kube-system   deployment.apps/coredns   1/1     1            1           44s   coredns      registry.k8s.io/coredns/coredns:v1.9.3   k8s-app=kube-dns

NAMESPACE     NAME                                   READY   STATUS    RESTARTS   AGE   IP              NODE       NOMINATED NODE   READINESS GATES
default       pod/nginx                              1/1     Running   0          11s   10.244.0.3      minikube   <none>           <none>
kube-system   pod/coredns-787d4945fb-p9nrf           1/1     Running   0          30s   10.244.0.2      minikube   <none>           <none>
kube-system   pod/etcd-minikube                      1/1     Running   0          43s   192.168.105.8   minikube   <none>           <none>
kube-system   pod/kube-apiserver-minikube            1/1     Running   0          45s   192.168.105.8   minikube   <none>           <none>
kube-system   pod/kube-controller-manager-minikube   1/1     Running   0          44s   192.168.105.8   minikube   <none>           <none>
kube-system   pod/kube-proxy-cfpm4                   1/1     Running   0          30s   192.168.105.8   minikube   <none>           <none>
kube-system   pod/kube-scheduler-minikube            1/1     Running   0          45s   192.168.105.8   minikube   <none>           <none>
kube-system   pod/storage-provisioner                1/1     Running   0          43s   192.168.105.8   minikube   <none>           <none>
➜  minikube git:(master) ✗

Accessing apps example run with minikube service with tunnel:

➜  minikube git:(master) ✗ out/minikube start --driver qemu --network vmnet-shared
😄  minikube v1.30.1 on Darwin 13.3.1 (arm64)
✨  Using the qemu2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...- Passwor/

🐳  Preparing Kubernetes v1.26.3 on Docker 20.10.23 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring bridge CNI (Container Networking Interface) ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🔎  Verifying Kubernetes components...
🌟  Enabled addons: default-storageclass, storage-provisioner
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗ kubectl create deployment hello-minikube1 --image=kicbase/echo-server:1.0
deployment.apps/hello-minikube1 created
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗ kubectl expose deployment hello-minikube1 --type=NodePort --port=8080
service/hello-minikube1 exposed
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗ kubectl get svc
NAME              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
hello-minikube1   NodePort    10.99.251.155   <none>        8080:32622/TCP   5s
kubernetes        ClusterIP   10.96.0.1       <none>        443/TCP          43s
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗ out/minikube service hello-minikube1 --url
http://192.168.105.10:32622/
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗
➜  minikube git:(master) ✗ curl http://192.168.105.10:32622/
Request served by hello-minikube1-8587cd9b85-lkjjf

HTTP/1.1 GET /

Host: 192.168.105.10:32622
Accept: */*
User-Agent: curl/7.87.0
➜  minikube git:(master) ✗

takes about 30sec to start (depending on how fast you type root pass):

➜  minikube git:(master) ✗ time out/minikube start --driver qemu --network vmnet-shared
😄  minikube v1.30.1 on Darwin 13.3.1 (arm64)
✨  Using the qemu2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...| Passwor-

🐳  Preparing Kubernetes v1.26.3 on Docker 20.10.23 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring bridge CNI (Container Networking Interface) ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: default-storageclass, storage-provisioner
🔎  Verifying Kubernetes components...
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
out/minikube start --driver qemu --network vmnet-shared  1.06s user 1.41s system 7% cpu 33.381 total

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 17, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: prezha

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 17, 2023
@medyagh
Copy link
Member

medyagh commented Apr 18, 2023

@prezha prezha do you mind putting instructions to run qemu as root for macOS ? Do I install still it brew? But run it differently ?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 18, 2023
@prezha
Copy link
Contributor Author

prezha commented Apr 18, 2023

@prezha prezha do you mind putting instructions to run qemu as root for macOS ? Do I install still it brew? But run it differently ?

@medyagh yes, you install qemu using brew with brew install qemu // ref: https://www.qemu.org/download/#macos

as for running qemu as root: you do not need to run anything upfront - ie, based on the platform, minikube will automatically pick the right qemu binary and then also run it as root (using sudo) for you

i've amended pr to add more user-friendly handling of the password for sudo - there'll be two options:

  1. show a prompt asking the user to type in the password for sudo - example:
➜  minikube git:(qemu-root) out/minikube start --driver qemu --network vmnet-shared
😄  minikube v1.30.1 on Darwin 13.3.1 (arm64)
✨  Using the qemu2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...|
sudo password:
🐳  Preparing Kubernetes v1.26.3 on Docker 20.10.23 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring bridge CNI (Container Networking Interface) ...
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
➜  minikube git:(qemu-root)
  1. eg, for full (ci/cd) automation: one can export SUDO_PASSWORD env var, and it will then be automatically picked up by minikube when running qemu with sudo (ie, no prompt will be shown asking user to enter password) - example:
➜  minikube git:(qemu-root) export SUDO_PASSWORD=super_secret_password
➜  minikube git:(qemu-root)
➜  minikube git:(qemu-root)
➜  minikube git:(qemu-root) out/minikube start --driver qemu --network vmnet-shared
😄  minikube v1.30.1 on Darwin 13.3.1 (arm64)
✨  Using the qemu2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.26.3 on Docker 20.10.23 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring bridge CNI (Container Networking Interface) ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🔎  Verifying Kubernetes components...
🌟  Enabled addons: default-storageclass, storage-provisioner
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
➜  minikube git:(qemu-root)

@medyagh
Copy link
Member

medyagh commented May 8, 2023

@prezha thank you for this PR ! sorry for the long wait on the review

I have two issues

1. qemu-system-aarch64 not in the path for sudo

(I had to manually add /opt/homebrew/bin/ to "secure_path" in vi /etc/sudoers

$ out/minikube start --driver qemu --network vmnet-shared
😄  minikube v1.30.1 on Darwin 13.3.1 (arm64)
ERROR: Password: 
sudo: qemu-system-aarch64: command not found
🤦  StartHost failed, but will try again: creating host: create: creating: Password: 
sudo: qemu-system-aarch64: command not found: exit status 1
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) .../ OUTPUT: 
ERROR: sudo: qemu-system-aarch64: command not found

Issue 2. it goes stopped after I run minikube-gui

https://github.com/kubernetes-sigs/minikube-gui

after a successful start (after adding the homebrew to secure_path)

$ out/minikube start --driver qemu --network vmnet-shared
😄  minikube v1.30.1 on Darwin 13.3.1 (arm64)
✨  Using the qemu2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
❗  This VM is having trouble accessing https://registry.k8s.io
💡  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
🐳  Preparing Kubernetes v1.26.3 on Docker 20.10.23 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring bridge CNI (Container Networking Interface) ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

I can minikube ssh and I can minikube profile list
but after 1 minute it shows "stopped"

qemu-root ✓
$ ./out/minikube profile list --alsologtostderr -v=8
I0508 09:58:45.652469    6903 out.go:296] Setting OutFile to fd 1 ...
I0508 09:58:45.652719    6903 out.go:348] isatty.IsTerminal(1) = true
I0508 09:58:45.652724    6903 out.go:309] Setting ErrFile to fd 2...
I0508 09:58:45.652728    6903 out.go:348] isatty.IsTerminal(2) = true
I0508 09:58:45.652815    6903 root.go:336] Updating PATH: /Users/medya/.minikube/bin
I0508 09:58:45.653037    6903 out.go:303] Setting JSON to false
I0508 09:58:45.653149    6903 cli_runner.go:164] Run: docker ps -a --filter label=name.minikube.sigs.k8s.io --format {{.Names}}
I0508 09:58:45.653825    6903 notify.go:220] Checking for updates...
W0508 09:58:45.673370    6903 cli_runner.go:211] docker ps -a --filter label=name.minikube.sigs.k8s.io --format {{.Names}} returned with exit code 1
I0508 09:58:45.673650    6903 config.go:182] Loaded profile config "minikube": Driver=qemu2, ContainerRuntime=docker, KubernetesVersion=v1.26.3
I0508 09:58:45.673664    6903 host.go:66] Checking if "minikube" exists ...
|----------|-----------|---------|---------------|------|---------|---------|-------|--------|
| Profile  | VM Driver | Runtime |      IP       | Port | Version | Status  | Nodes | Active |
|----------|-----------|---------|---------------|------|---------|---------|-------|--------|
| minikube | qemu2     | docker  | 192.168.105.4 | 8443 | v1.26.3 | Stopped |     1 | *      |
|----------|-----------|---------|---------------|------|---------|---------|-------|--------|

and same for minikube status

qemu-root ✓
$ ./out/minikube status --alsologtostderr -v=8
I0508 09:59:22.288965    6943 out.go:296] Setting OutFile to fd 1 ...
I0508 09:59:22.289171    6943 out.go:348] isatty.IsTerminal(1) = true
I0508 09:59:22.289174    6943 out.go:309] Setting ErrFile to fd 2...
I0508 09:59:22.289178    6943 out.go:348] isatty.IsTerminal(2) = true
I0508 09:59:22.289232    6943 root.go:336] Updating PATH: /Users/medya/.minikube/bin
I0508 09:59:22.289389    6943 out.go:303] Setting JSON to false
I0508 09:59:22.289402    6943 mustload.go:65] Loading cluster: minikube
I0508 09:59:22.289421    6943 notify.go:220] Checking for updates...
I0508 09:59:22.289565    6943 config.go:182] Loaded profile config "minikube": Driver=qemu2, ContainerRuntime=docker, KubernetesVersion=v1.26.3
I0508 09:59:22.289572    6943 status.go:255] checking status of minikube ...
I0508 09:59:22.289754    6943 status.go:330] minikube host status = "Stopped" (err=<nil>)
I0508 09:59:22.289758    6943 status.go:343] host is not running, skipping remaining checks
I0508 09:59:22.289760    6943 status.go:257] minikube status: &{Name:minikube Host:Stopped Kubelet:Stopped APIServer:Stopped Kubeconfig:Stopped Worker:false TimeToStop: DockerEnv: PodManEnv:}
minikube
type: Control Plane
host: Stopped
kubelet: Stopped
apiserver: Stopped
kubeconfig: Stopped

@prezha
Copy link
Contributor Author

prezha commented May 9, 2023

@medyagh thanks for the feedback!

as for the issues you've faced, i, unfortunately, don't have a mac at hand to try to reproduce, but here are a couple of hints:

  1. qemu-system-aarch64 not in the path for sudo

i don't remember i had to do anything in addition to brew install qemu - while it appears that we used the same macos version 13.3.1, could it be due to some specific settings/requirements you have on your corp laptop?

  1. it goes stopped after I run minikube-gui

i suspect that it stopped because of the issue related to ❗ This VM is having trouble accessing https://registry.k8s.io error you got (indicating issues with the network connectivity and thus potentially with vmnet) and not necessarily because you used the minikube-gui

looking at the sudo password prompt you got in the previous step (under 1. qemu-system-aarch64 not in the path for sudo): ERROR: Password: , it could be that you might not have used the latest commit, as i would expect to see sudo password: instead (pls see #16339 (comment) example output above)
can you please check if you've checked out the latest commit and, if the issue persists, can you please share the complete output of the:
minikube start --driver qemu --network vmnet-shared --alsologtostderr -v 7 -p qemu-vmnet

@medyagh
Copy link
Member

medyagh commented Jun 1, 2023

@prezha can u find a solution for this problem ?


1. qemu-system-aarch64 not in the path for sudo

(I had to manually add /opt/homebrew/bin/ to "secure_path" in vi /etc/sudoer

@prezha
Copy link
Contributor Author

prezha commented Jun 1, 2023

@prezha can u find a solution for this problem ?


1. qemu-system-aarch64 not in the path for sudo

(I had to manually add /opt/homebrew/bin/ to "secure_path" in vi /etc/sudoer

@medyagh i used just the "official" one-liner to install qemu on m1 macos using homebrew

unfortunately, i don't have access to that mac anymore to try to reproduce, but i also don't recall having the issue you saw

on the other hand, i found a similar issue other users had with qemu installed with homebrew on macos that might help:
containers/podman#12775 (comment)

so, based on that, in the case of the problem you've described, the steps could be:

  1. brew install qemu
  2. brew link qemu
  3. optionally: brew reinstall qemu

@medyagh
Copy link
Member

medyagh commented Jun 1, 2023

@prezha

$ brew link qemu

Warning: Already linked: /opt/homebrew/Cellar/qemu/8.0.0
To relink, run:
  brew unlink qemu && brew link qemu
15:13:19 medya/workspace/minikube
qemu-root •1
$ 
15:13:19 medya/workspace/minikube
qemu-root •1
$  brew unlink qemu && brew link qemu
Unlinking /opt/homebrew/Cellar/qemu/8.0.0... 50 symlinks removed.
Linking /opt/homebrew/Cellar/qemu/8.0.0... 50 symlinks created.
15:13:29 medya/workspace/minikube

and still same issue

qemu-root •1
$ ./out/minikube start --driver=qemu2 --network=vmnet-shared
😄  minikube v1.30.1 on Darwin 13.4 (arm64)
✨  Using the qemu2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...| 
sudo password:- 
- 
sudo password:  
sudo password:  OUTPUT: 
ERROR: Password: 
sudo: qemu-system-aarch64: command not found


did u install it using brew command?

// vmnet network requires elevated privileges
if strings.HasPrefix(d.Network, "vmnet-") {
//TODO: handle windows
startProgram = "sudo"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe change this to "sudo -e"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@medyagh sorry for not coming back sooner to this, but i didn't have a mac at hand to test earlier - now i do :)

i was finally able to replicate the issue you described above (not sure what's the difference between this and prev mac i tried on and did not have that problem before)

i tried with -E (i guess you meant with the capital e) - ie, the preserve environment flag, but the issue remained

in the latest commit, i opted to retain the user's PATH explicitly, and it worked - can you please pull & try and let me know if that worked for you as well

before:

% minikube start --driver qemu --network vmnet-shared
😄  minikube v1.30.1 on Darwin 13.5 (arm64)
✨  Using the qemu2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...\
sudo password:-
sudo password:
sudo password:  OUTPUT:
ERROR: Password:
sudo: qemu-system-aarch64: command not found


🔥  Deleting "minikube" in qemu2 ...
🤦  StartHost failed, but will try again: creating host: create: creating: Password:
sudo: qemu-system-aarch64: command not found: exit status 1
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...|
sudo password:/
sudo password:
sudo password:  OUTPUT:
ERROR: Password:
sudo: qemu-system-aarch64: command not found


😿  Failed to start qemu2 VM. Running "minikube delete" may fix it: creating host: create: creating: Password:
sudo: qemu-system-aarch64: command not found: exit status 1

❌  Exiting due to GUEST_PROVISION: error provisioning guest: Failed to start host: creating host: create: creating: Password:
sudo: qemu-system-aarch64: command not found: exit status 1

╭───────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                           │
│    😿  If the above advice does not help, please let us know:                             │
│    👉  https://github.com/kubernetes/minikube/issues/new/choose                           │
│                                                                                           │
│    Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.    │
│                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────╯

after:

% minikube start --driver qemu --network vmnet-shared
😄  minikube v1.30.1 on Darwin 13.5 (arm64)
✨  Using the qemu2 driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...\
sudo password:
❗  This VM is having trouble accessing https://registry.k8s.io
💡  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
🐳  Preparing Kubernetes v1.26.3 on Docker 20.10.23 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring bridge CNI (Container Networking Interface) ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🔎  Verifying Kubernetes components...
🌟  Enabled addons: default-storageclass, storage-provisioner
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 28, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 7, 2023
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 2, 2023
@alessiodionisi
Copy link

Any news about this feature? I'm available to work on it if help is needed

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 26, 2024
@prezha
Copy link
Contributor Author

prezha commented Feb 26, 2024

Any news about this feature? I'm available to work on it if help is needed

thanks @alessiodionisi !

the last time i checked this pr (a long time ago!) - it was working, i rebased it now

can you please test yourself as well and see if there's anything additional we need to do

@alessiodionisi
Copy link

I'm testing it and everything seems to work fine. I'll use it as a development environment in the next few days.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Feb 27, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Feb 27, 2024
@prezha
Copy link
Contributor Author

prezha commented Mar 7, 2024

@alessiodionisi fyi: i've just synched with the current master

@prezha
Copy link
Contributor Author

prezha commented Mar 7, 2024

/ok-to-test

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
KVM_Linux_crio TestStartStop/group/default-k8s-diff-port/serial/SecondStart (gopogh) 1.67 (chart)
Docker_Linux_containerd_arm64 TestAddons/parallel/InspektorGadget (gopogh) 1.96 (chart)
Docker_Linux_containerd_arm64 TestAddons/StoppedEnableDisable (gopogh) 1.96 (chart)
Docker_Linux_containerd_arm64 TestAddons/parallel/Volcano (gopogh) 2.33 (chart)
Hyper-V_Windows TestAddons/Setup (gopogh) 2.56 (chart)
Hyper-V_Windows TestPause/serial/DeletePaused (gopogh) 15.38 (chart)
Hyper-V_Windows TestMultiControlPlane/serial/AddWorkerNode (gopogh) 16.24 (chart)
Hyper-V_Windows TestMultiControlPlane/serial/CopyFile (gopogh) 17.12 (chart)
KVM_Linux_crio TestAddons/Setup (gopogh) 17.88 (chart)
Docker_Windows TestStartStop/group/old-k8s-version/serial/SecondStart (gopogh) 41.86 (chart)
Hyper-V_Windows TestMultiControlPlane/serial/StopSecondaryNode (gopogh) 45.19 (chart)

To see the flake rates of all tests by environment, click here.

@minikube-pr-bot

This comment has been minimized.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 10, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 8, 2024
@prezha
Copy link
Contributor Author

prezha commented Oct 8, 2024

do we still need this pr/functionality?

@spowelljr
Copy link
Member

Sorry, missed this PR, once the binary building fix is merged (#19862) we should rebase and re-run the tests.

@spowelljr spowelljr removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 24, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 25, 2024
cmd/minikube/cmd/start_flags.go Outdated Show resolved Hide resolved
prezha and others added 2 commits October 25, 2024 18:17
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
pkg/drivers/qemu/qemu.go Outdated Show resolved Hide resolved
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
@@ -473,6 +473,11 @@ func getNetwork(driverName string) string {
return n
}
switch n {
case "vmnet-host", "vmnet-shared", "vmnet-bridged":
//TODO: check if QEMU v7.1+ version is installed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a required macOS version as well? Just wondering how far back the vmnet protocol is supported

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the apple docs: vmnet framework requires macOS 10.10+

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just tried it on sonoma 14.7

$ minikube -p vmnet start --driver=qemu --network=vmnet-shared
😄  [vmnet] minikube v1.34.0 on Darwin 14.7 (arm64)
✨  Using the qemu2 driver based on user configuration
👍  Starting "vmnet" primary control-plane node in "vmnet" cluster
🔥  Creating qemu2 VM (CPUs=2, Memory=4000MB, Disk=20000MB) .../
sudo password:
🐳  Preparing Kubernetes v1.31.1 on Docker 27.3.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: default-storageclass, storage-provisioner
🏄  Done! kubectl is now configured to use "vmnet" cluster and "default" namespace by default

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's quite old, not sure if thats worth adding a version check for

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, ten years now, so probably not

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16339) |
+----------------+----------+---------------------+
| minikube start | 51.6s    | 51.2s               |
| enable ingress | 17.5s    | 15.9s               |
+----------------+----------+---------------------+

Times for minikube start: 51.4s 53.8s 50.5s 50.9s 51.5s
Times for minikube (PR 16339) start: 51.0s 49.4s 51.2s 54.5s 49.7s

Times for minikube ingress: 18.5s 19.0s 15.6s 15.0s 19.0s
Times for minikube (PR 16339) ingress: 14.5s 15.1s 19.1s 15.0s 16.1s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16339) |
+----------------+----------+---------------------+
| minikube start | 23.0s    | 22.7s               |
| enable ingress | 12.6s    | 12.4s               |
+----------------+----------+---------------------+

Times for minikube start: 24.3s 21.1s 24.1s 21.1s 24.1s
Times for minikube (PR 16339) start: 21.9s 24.1s 24.3s 21.6s 21.5s

Times for minikube ingress: 12.3s 12.3s 12.3s 12.8s 13.3s
Times for minikube (PR 16339) ingress: 12.8s 12.3s 12.3s 12.3s 12.3s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16339) |
+----------------+----------+---------------------+
| minikube start | 21.8s    | 22.3s               |
| enable ingress | 32.6s    | 34.1s               |
+----------------+----------+---------------------+

Times for minikube (PR 16339) start: 23.0s 23.7s 19.9s 22.1s 22.9s
Times for minikube start: 20.0s 22.6s 22.8s 20.5s 23.0s

Times for minikube ingress: 39.3s 38.8s 22.8s 23.3s 38.8s
Times for minikube (PR 16339) ingress: 39.3s 39.3s 22.8s 30.3s 38.8s

@minikube-pr-bot
Copy link

Here are the number of top 10 failed tests in each environments with lowest flake rate.

Environment Test Name Flake Rate

Besides the following environments also have failed tests:

To see the flake rates of all tests by environment, click here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants