5

I'm just getting started on k8s and got stuck on running k8s locally (it's running, but I don't understand exactly)

Pretty much all the tutorials on running k8s locally use minikube and I'm a little bit puzzled.

Isn't docker + k8s combination enough to run k8s locally?

Why do I need an extra layer with a virtual machine in order run k8s locally?

I've read about minikube and followed tutorials on the offical k8s website, but I'm still puzzled.

Can anyone shed light on me?

1 Answer 1

6

Kubernetes has several system-level parts. It needs a functioning etcd cluster, the API server proper, and a per-node service called the kubelet. It also generally expects to be able to use 100% of the resources available on any given node for its own use. Just having the kubectl binary on its own isn't enough to use Kubernetes; you also need the rest of the cluster that goes with it.

There's no specific reason you can't directly install all of the Kubernetes cluster parts on the host (using kubeadm, or Minikube's "none" VM driver), but it will be trickier to maintain. It may or may not conflict with local Docker use, and it will be tricky to uninstall or upgrade it. If you run Minikube in a VM (or Kind in a Docker container) then all of the parts are preinstalled for you, and you can easily stop or delete the VM (or container) when you don't need it any more.

3
  • Thank you David. That makes sense, but I still have a question. How does Amazon or Google run their k8s cluster on their cloud? I understand that minikube is suggested for dev and local only. Do cloud companies also use a VM? I thought one of the advantages of using kube is avoding VM to use full hardware performance.
    – Moon
    May 8, 2020 at 12:13
  • There are other ways to install Kubernetes. If you're running your own cluster, there's a tool called kops that can do it; if you know all of the pieces involved, you can do it manually using a cluster automation tool like Ansible or Chef; I'm sure Google has their own internal tooling. Those setups probably run "directly on the host", but host environments like EC2 or GCE are heavily virtualized already. In particular Kubernetes benefits from being run in an environment where it's easy to dynamically add and remove nodes, which a cloud setup can offer.
    – David Maze
    May 8, 2020 at 12:43
  • Thanks David. I appreciate it. I'm still a bit confused tbh, but I think it's clear that I need to try both ways in order to understand fully.
    – Moon
    May 8, 2020 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.