0

I am looking to learn Kubernetes, specifically from this resource. I only want to run Docker containers, rather than full-fat VMs. It says that I need any of these as a base from which to work:

  • Docker Desktop
  • kind
  • Minikube

I have plumped for Minikube, as I'm on Linux, and it's pretty easy to install. I'm using these instructions. The second doc link says:

To check if virtualization is supported on Linux, run the following command and verify that the output is non-empty:

grep -E --color 'vmx|svm' /proc/cpuinfo

This does not produce any output for me, since my standard development environment runs inside a VirtualBox container. I don't plan to change this - Docker, Docker Compose and Docker Swarm run very well here.

It later says:

Install a Hypervisor

If you do not already have a hypervisor installed, install one of these now:

  • KVM, which also uses QEMU

  • VirtualBox

This makes it seem that hypervisor CPU support is necessary, but I do not see why that would be.

However it does go onto say:

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.

This appears to be something of an addendum, and is given much less prominence that the suggestion that virtualisation instructions are a requirement. Were the documentation authors just "covering all bases", or will I bump into a roadblock later on by continuing despite not having the required CPU?

halfer
  • 161
  • 1
  • 5
  • 25

1 Answers1

3

Minikube itself runs in a virtual machine, the point being to keep it contained and separated from your host environment. You should create a new virtual machine for Minikube, not try to run it inside an existing VM.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • Thanks Michael. Is the VM requirement because K8S will try to enumerate Docker containers running on the machine, and then it'd get confused if it finds containers or other resources that have been started outside of its control? – halfer Jun 13 '20 at 17:02
  • @halfer Yes, among other things. Kubernetes generally expects to be the only thing running on a given (virtual) machine and expects to be able to orchestrate everything. In production you would have Kubernetes running on several (virtual) machines. There are a lot of moving parts. Minikube simplifies it enough to be a good development and testing platform but it's still expecting to be in control of the whole thing. And VirtualBox will happily run more than one VM... – Michael Hampton Jun 13 '20 at 17:04
  • If you want to work in a VM, you can certainly do so, as long as the two VMs can communicate with each other. – Michael Hampton Jun 13 '20 at 17:09
  • Yes, that's a very good idea - thanks. I will look into configuring `kubectl` to connect from one VM to another. – halfer Jun 13 '20 at 17:10
  • 1
    You'll be using it the same way in production anyway :) – Michael Hampton Jun 13 '20 at 17:19