-
Notifications
You must be signed in to change notification settings - Fork 5k
vfkit: Bump to Preferred driver on macOs #20808
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
Conversation
vfkit is using the native virtualization framework, provides good best performance and all the features needed by minikube. It is also well maintained and used by other projects like podman. This fixes the automatic driver selection. When we start minikube on a system with both vfkit and qemu, vfkit is selected: % minikube start 😄 minikube v1.35.0 on Darwin 15.5 (arm64) ✨ Automatically selected the vfkit driver. Other choices: qemu2, ssh, podman (experimental) 👍 Starting "minikube" primary control-plane node in "minikube" cluster 🔥 Creating vfkit VM (CPUs=2, Memory=6000MB, Disk=20000MB) ... 🐳 Preparing Kubernetes v1.33.1 on Docker 28.0.4 ... ▪ 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 "minikube" cluster and "default" namespace by default
Hi @nirs. 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? |
@afbjorklund what do you think? |
@@ -41,13 +42,17 @@ const ( | |||
) | |||
|
|||
func init() { | |||
priority := registry.Unknown | |||
if runtime.GOOS == "darwin" { | |||
priority = registry.Preferred |
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.
I think is better than preffered registry.Default so it be the same level as qemu,
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.
based on comment from @nirs I agree to bump prefered.
Both vfkit and qemu are using the native hypervisor interface (hypervisor framewlrk).
But vfkit is using Apple virtualization framework maintained by the vendor. qemu is not well maintained on macOS.
You may not notice it because you was using an old mac, but M4 is still not fully supported in qemu. Not long ago starting qemu on M4 was crashing and it took few month until they fixed the issue, only after I pushed for it and convinced UTM maintainer to send a trivial workaround to avoid the crash to qemu.
lima is using VZ as the default vm type instead of qemu since 1.0 (Nov 6, 2024). Podman switch to vfkit long time ago (was using qemu before). We should move forward and recommend vfkit.
Unless we have some important features that does not work on vfkit and work on qemu. I'm not a ware of any.
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.
Looks good to me!
@@ -104,7 +109,7 @@ func configure(cfg config.ClusterConfig, n config.Node) (interface{}, error) { | |||
func status() registry.State { | |||
_, err := exec.LookPath("vfkit") | |||
if err != nil { | |||
return registry.State{Error: err, Fix: "Run 'brew tap cfergeau/crc && brew install vfkit'", Doc: docURL} | |||
return registry.State{Error: err, Fix: "Run 'brew install vfkit'", Doc: docURL} |
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.
👍
vfkit in cfergeau/crc will no longer be updated now that it’s in the main repo. I should remove it from this personal tap.
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.
sure
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.
@@ -41,13 +42,17 @@ const ( | |||
) | |||
|
|||
func init() { | |||
priority := registry.Unknown | |||
if runtime.GOOS == "darwin" { | |||
priority = registry.Preferred |
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.
based on comment from @nirs I agree to bump prefered.
Both vfkit and qemu are using the native hypervisor interface (hypervisor framewlrk).
But vfkit is using Apple virtualization framework maintained by the vendor. qemu is not well maintained on macOS.
You may not notice it because you was using an old mac, but M4 is still not fully supported in qemu. Not long ago starting qemu on M4 was crashing and it took few month until they fixed the issue, only after I pushed for it and convinced UTM maintainer to send a trivial workaround to avoid the crash to qemu.
lima is using VZ as the default vm type instead of qemu since 1.0 (Nov 6, 2024). Podman switch to vfkit long time ago (was using qemu before). We should move forward and recommend vfkit.
Unless we have some important features that does not work on vfkit and work on qemu. I'm not a ware of any.
/ok-to-test |
/lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh, nirs 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 |
kvm2 driver with docker runtime
Times for minikube start: 49.8s 49.3s 46.0s 47.8s 51.4s Times for minikube ingress: 15.0s 15.0s 15.0s 14.9s 14.5s docker driver with docker runtime
Times for minikube ingress: 12.8s 12.3s 12.8s 12.8s 10.8s Times for minikube start: 22.5s 24.3s 22.6s 22.3s 22.3s docker driver with containerd runtime
Times for minikube start: 24.3s 25.5s 22.3s 20.6s 21.8s Times for minikube ingress: 31.3s 37.8s 23.8s 38.8s 38.8s |
For the record, this is not an isolated event, there was a similar problem around the time podman switched to vfkit, qemu hang on startup which took several weeks/months to be fixed.
vfkit has support for virtiofs and rosetta (important features off the top of my head), and the fact that Apple maintains most of the virtualization code is both a plus and a minus, but in my opinion mostly a plus. It overall works well, we had minimal issues over the years, but when there are issues, we are dependent on Apple to fix them, containers/podman#25121 is a recent example of this. This bug only impacted some Intel macs, and is fixed with macOS 15.5 |
I started to work on #20803 for GPU acceleration. |
The main feature of Having to split minikube into different hypervisors and different runtimes (not just Docker) complicated things a lot. |
EDIT: no, it was the names that are confusing. Docker is "HighlyPreferred", while others are just "Preferred" If you wanted to run in a separate VM, instead of running in a container, there was always the |
docker on macOS should be Obsolete, it requires so you should really use one of the open source vm drivers. |
vfkit is using the native virtualization framework, provides good best performance and all the features needed by minikube. It is also well maintained and used by other projects like podman.
This fixes the automatic driver selection. When we start minikube on a system with both vfkit and qemu, vfkit is selected:
Fixes #20807