kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.01k stars 4.85k forks source link

How Do You Set the QEMU Driver Flags From Minikube #18895

Closed Dala0 closed 1 month ago

Dala0 commented 3 months ago

What Happened?

I am trying to get Minikube to start up a QEMU based x86 emulator on an ARM CPU under macOS.

It would be useful to access flags such as 'qemu-program', 'qemu-machine', and 'qemu-cpu'. I have been unable to work out how to do this from 'minikube start'.

  1. Is 'minikube start' the correct place to set these flags? If so, what is the syntax?
  2. If 'minikube start' is not the correct place to set the flags, where do you set them?

@afbjorklund

Attach the log file

log.txt

Operating System

macOS (Default)

Driver

QEMU

spowelljr commented 3 months ago

Hi @Dala0, currently those fields are not configurable in minikube, they are automatically chosen depending on the architecture of the machine. However allowing those field to be configurable on start using flags would be a good feature addition.

spowelljr commented 3 months ago

I created a quick 10 minute implementation: https://github.com/kubernetes/minikube/pull/18906

nnzv commented 3 months ago

Looking forward to seeing this feature in the next release.

Dala0 commented 3 months ago

Wow, that was quick! Thank you.

@spowelljr

afbjorklund commented 3 months ago

It would be useful to access flags such as 'qemu-program', 'qemu-machine', and 'qemu-cpu'. I have been unable to work out how to do this from 'minikube start'.

The flags are only available in docker-machine, minikube hardcodes all config in the driver "registry" - no plugins

I am trying to get Minikube to start up a QEMU based x86 emulator on an ARM CPU under macOS.

This is not something that is supported in minikube, since it is too slow to run Kubernetes under emulation

afbjorklund commented 3 months ago

Using the docker driver and qemu-user is faster:

But hopefully there will "soon" be a new tutorial:

medyagh commented 2 months ago

It would be useful to access flags such as 'qemu-program', 'qemu-machine', and 'qemu-cpu'. I have been unable to work out how to do this from 'minikube start'.

The flags are only available in docker-machine, minikube hardcodes all config in the driver "registry" - no plugins

I am trying to get Minikube to start up a QEMU based x86 emulator on an ARM CPU under macOS.

This is not something that is supported in minikube, since it is too slow to run Kubernetes under emulation

@afbjorklund does that mean we need to modify the minikube-machine org code?

afbjorklund commented 2 months ago

does that mean we need to modify the minikube-machine org code?

Not really, minikube has its own fork of all the drivers (e.g. "qemu2")

So there are different ways of setting the Config, whether Flags or not

https://github.com/minikube-machine/machine/blob/main/drivers/qemu/qemu.go#L199

https://github.com/kubernetes/minikube/blob/master/pkg/minikube/registry/drvs/qemu2/qemu2.go#L117

spowelljr commented 1 month ago

@Dala0 @nnzv Sorry, just getting back to this now, you can test this out by downloading the following binary, let me know if it works for you.

https://storage.googleapis.com/minikube-builds/18906/minikube-darwin-arm64