Minikube is a single-node Kubernetes cluster that can be installed on macOS, Linux and Windows.
By default, it starts with 2 CPUs and 2GB of memory, that may not be enough for experiments with some heavy projects.
This note describes 3 easy ways to start the Minikube with more memory and CPUs.
Cool Tip: How to check how much RAM do I have! Read more →
Start Minikube With More Memory & CPUs
Before changing the Minikube’s resources, take into account that it requires at least 2 CPUs and 2GB of memory:
Exiting due to RSRC_INSUFFICIENT_CORES: Requested cpu count 1 is less than the minimum allowed of 2
– or –
Exiting due to RSRC_INSUFFICIENT_REQ_MEMORY: Requested memory allocation 1024 MiB is less than the usable minimum of 1800MB
You can check the resources of the running Minikube instance, using the kubectl
:
$ kubectl get node minikube -o jsonpath='{.status.capacity}'
If your Minikube instance uses the VirtualBox driver, you can get the memory and CPU settings with the vboxmanage
command:
# Linux, macOS $ vboxmanage showvminfo minikube | grep "Memory size\|Number of CPUs" Memory size 1900MB Number of CPUs: 2 # Windows command prompt (CMD) C:\> cd "C:\Program Files\Oracle\VirtualBox\" C:\> .\VBoxManage.exe showvminfo minikube | findstr /c:"Memory size" Memory size: 2200MB C:\> .\VBoxManage.exe showvminfo minikube | findstr /c:"Number of CPUs" Number of CPUs: 2
Option 1 – Delete & Recreate With More Resources
Warning: This method requires the deletion of the current instance of Minikube.
To start the Minikube with more memory and CPUs, the easiest way is to delete the current instance and recreate it with the new resources:
$ minikube stop $ minikube delete $ minikube start --memory 8192 --cpus 2
Option 2 – Set The Memory & CPU
Alternatively you can try set the memory and CPU settings as follows:
$ minikube stop $ minikube config set memory 8192 $ minikube config set cpus 4 $ minikube start
This method doesn’t require the deletion of the Minikube, but doesn’t work for all drivers, so you may see the errors as follows:
These changes will take effect upon a
minikube delete
and then aminikube start
– or –
You cannot change the memory size for an existing minikube cluster. Please first delete the cluster.
Option 3 – Add More Memory & CPUs To The VirtualBox VM
If the Minikube uses the VirtualBox driver, you can add more memory and CPUs to the Minikube’s VM without deleting it.
Stop the Minikube:
$ minikube stop
Change the VM’s memory and CPU settings using the vboxmanage
command:
# Linux, macOS $ vboxmanage modifyvm "minikube" --cpus 4 --memory 8192 # Windows command prompt (CMD) C:\> cd "C:\Program Files\Oracle\VirtualBox\" C:\> .\VBoxManage.exe modifyvm "minikube" --cpus 4 --memory 8192
Or start the “Oracle VM VirtualBox” GUI and change the VM’s resources through it.
After changing the VM’s resources, give the VirtualBox a couple of seconds before starting the Minikube, otherwise you may get:
Exiting due to PROVIDER_VIRTUALBOX_NOT_RUNNING: signal: killed
Start the Minikube with more memory and CPUs:
$ minikube start
this may require a change in memory allocated to Docker running in local.
Thanks a lot!
Nice article