What is minikube config specifying?

3/24/2021

According to the minikube handbook the configuration commands are used to "Configure your cluster". But what does that mean?

If I set cpus and memory then are these the max values the cluster as a whole can ever consume?

Are these the values it will reserve on the host machine in preparation for use?

Are these the values that are handed to the control plane container/VM and now I have to specify more resources when making a worker node?

What if I want to add another machine (VM or bare metal) and add its resources in the form of a worker node to the cluster? From the looks of it I would have to delete that cluster, change the configuration, then start a new cluster with the new configuration. That doesn't seem scalable.

Thanks for the help in advance.

-- Currn Hyde
kubernetes
minikube

1 Answer

3/29/2021

Answering the question:

If I set cpus and memory then are these the max values the cluster as a whole can ever consume?

In short. It will be a limit for the whole resource (either a VM, a container, etc. depending on a --driver used). It will be used for the underlying OS, Kubernetes components and the workload that you are trying to run on it.

Are these the values it will reserve on the host machine in preparation for use?

I'd reckon this would be related to the --driver you are using and how its handling the resources. I personally doubt it's reserving the 100% of CPU and memory you've passed in the $ minikube start and I'm more inclined to the idea that it uses how much it needs during specific operations.

Are these the values that are handed to the control plane container/VM and now I have to specify more resources when making a worker node?

By default, when you create a minikube instance with: $ minikube start ... you will create a single node cluster capable of being a control-plane node and a worker node simultaneously. You will be able to run your workloads (like an nginx-deployment without adding additional node).

You can add a node to your minikube ecosystem with just: $ minikube node add. This will make another node marked as a worker (with no control-plane components). You can read more about it here:

What if I want to add another machine (VM or bare metal) and add its resources in the form of a worker node to the cluster? From the looks of it I would have to delete that cluster, change the configuration, then start a new cluster with the new configuration. That doesn't seem scalable.

As said previously, you don't need to delete the minikube cluster to add another node. You can run $ minikube node add to add a node on a minikube host. There are also options to delete/stop/start nodes.

Personally speaking if the workload that you are trying to run requires multiple nodes, I would try to consider other Kubernetes cluster built on top/with:

  • Kubeadm
  • Kubespray
  • Microk8s

This would allow you to have more flexibility on where you want to create your Kubernetes cluster (as far as I know, minikube works within a single host (like your laptop for example)).

A side note!

There is an answer (written more than 2 years ago) which shows the way to add a Kubernetes cluster node to a minikube here :


Additional resources:

-- Dawid Kruk
Source: StackOverflow