Minikube: Insufficient memory / CPU?

Created on 12 Sep 2016  ·  21Comments  ·  Source: kubernetes/minikube

My laptop has 60+ GB of ram, and a 4-core i7 cpu. But when I try to create a deployment using 1 cpu and 1Gi as the memory / cpu requests, I get told there's insufficient CPU and memory. What gives?

Ubuntu 16.04, virtualbox.

Most helpful comment

I did this on my mac

minikube stop
minikube delete
minikube --memory 8192 --cpus 2 start

All 21 comments

Hey,

The minikube VM is configured by default to only use 1gb of memory. You can pass more during minikube start with the --memory flag. Note that you'll need to stop/start minikube for this to take effect.

Thanks. And the CPU?

Same thing, we start with 1 CPU by default. --cpus= will get you more.

You can run minikube start -h to display this helptext

https://github.com/kubernetes/minikube/blob/master/docs/minikube_start.md

I'm 'guessing' that the memory is is specified in Mb but it would be useful to have that listed more clearly in the help text

Running:

minikube stop && minikube start --cpus 4 --memory 8192

in Minikube v0.14.0 does not change the capacity of kubectl describe nodes, which stays at cpu: 2, the current default. Maybe there is something else to recreate too?

minikube start --memory 4096
Does not increase the memory for my machine.

I am on a mac using virtualbox as a virtualisation-driver.

If i take a look in the virtualbox settings of the VM i can see that memory is still at 2gb.

Any idea?

@uschmann Was a minikube VM already running? If there is already a minikube VM running, the memory won't be changed as this is done on creation of the VM. You will have to run a minikube delete; minikube start --memory 4096 to have the increased memory. We have an issue tracking this here: https://github.com/kubernetes/minikube/issues/1147

@uschmann or to set as default you can do something like this and restart Minikube:
minikube config set memory <memory>

You do indeed have to delete before any edited config is reflected 😞

On OS/X Virtualbox, I found the minikube memory setting was having no effect. I had to change it in VB.

I did this on my mac

minikube stop
minikube delete
minikube --memory 8192 --cpus 2 start

Finally, I had to delete entire minikube cluster to enlarge my minikube node to accommodate more Eclipse Che workspaces. Fortunately, it was only results of investigations but I spent few days to accumulate these results. Could you propose another way to manage minikube node size, even, via re-configuration of Oracle V-Box VM manually?

If you are using VirtualBox, you can first change the momory for that vm , then reconfig and restart. Look at this.

I used:

minikube config set memory 8192
minikube config set cpus 2

Seemed to persist my changes as well

Yes, it saves new values in config file:

$ cat ~/.minikube/config/config.json 
{
    "cpus": 4,
    "dashboard": true,
    "memory": 4096
}

You dont have to _delete_ minikube vm just to reconfigure some specs. Use the cli command of your hypervisor to reconfigure. For virtualbox:

$ minikube stop
$ VBoxManage modifyvm "minikube" --cpus 4 --memory 8196
$ minikube start --memory=8196 --cpus=4 --kubernetes-version=v1.13.0 \
    --vm-driver=virtualbox

Either way there is still a problem with minikube (v1.0.0), we cannot reconfigure --cpu for virtualbox (v5.2.24)

If you're on a mac using the hyperkit driver, here's a workaround to change memory or cpu without deleting your vm:

minikube stop
edit $HOME/.minikube/machines/minikube/config.json, change "Driver.CPU" and/or "Driver.Memory"
minikube start

This is due to insufficient RAM. Set RAM to 2gb.
minikube start --memory=2gb

I confirm that the most simple method works on recent version:

❯ minikube delete
❯ minikube start --cpus 2 --memory 2048
😄  minikube v1.14.0 on Darwin 10.15.7
✨  Using the virtualbox driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...

Which is confirmed by VirtualBox GUI:

Screenshot 2020-10-20 at 13 36 47

Thanks @cglacet for sharing! If anyone else is seeing this, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings