简体   繁体   中英

Why minikube needs a VM

I guess that minikube needs VirtualBox because of dockers' dependencies, but my current docker version doesn't need it.

So do I still need VirtualBox or another VM to start minikube?

这只是在 windows 或 osx 上的情况,确实需要 virtualbox,vmware 使用 boot2docker 创建 minikube vm,在 Linux 中,即使 Linux VM minikube 也可以在选择 --vm-driver none 时直接在主机 docker 中运行 kubernetes,它使用 localkube。

Minikube uses the docker machine to manage the kubernetes VM, so it abstracts the plugin architecture that Docker Machine uses to provide a consistent way to manage various VM providers. Minikube embeds VirtualBox and VMware Fusion drivers so there are no additional steps to use them. However, other drivers require an extra binary to be present in the host PATH like KVM, xhyve, HyperV, etc.

Yes you need the virtualbox along with respective driver to run the kubernetes cluster on your machine and it is because of docker dependencies. Minikube started a virtual machine for us(based on our local environment), and a Kubernetes cluster is running in that VM ie all your nodes and services are running under the VM box.

Minikube creates a simple local kubernetes cluster having one VM. Minikube needs a hypervisor such as VirtualBox or KVM... to create this VM.

Minikube won't be able to start if VirtualBox (which is the default) is not available.

minikube start 

You will get this error:

VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path

You can work on Minikube even without installing VirtualBox.

Minikube also supports a --driver=none option that runs the Kubernetes components on the host and not in a VM. Using this driver requires Docker and a Linux environment but not a hypervisor.

If you're using the none driver in Debian or a derivative, use the .deb packages for Docker rather than the snap package, which does not work with Minikube . You can download .deb packages from Docker.

You can also use --driver=docker

For more information, you can refer here

As per minikube Windows Getting started you can now choose between Virtual Box and Hyper-V for Windows, meaning Virtual Box is not mandatory if you have Hyper-V.

Prerequisites

  • Windows 8 or above
  • A hypervisor, such as Hyper-V or VirtualBox
  • Hardware virtualization support must be enabled in BIOS
  • 4GB of RAM

Using minikube start --driver=docker works just fine. The docker engine could act as a virtual machine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM