MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Minikube Tutorials: minikube commands

minikube config set memory 10000 sets the default memory for new minikube clusters. It does not resize a cluster that already exists. This page explains how minikube config works, how to actually change memory and CPUs on an existing cluster, how to check the allocation for each driver, and which minikube commands you will use every day.

minikube config

The command you provided, minikube config set memory 10000, will set the default memory allocation for new Minikube clusters to 10 gigabytes (10000 megabytes).

If you have already started a Minikube cluster and want to update the memory allocation for that cluster, you can use the minikube stop and minikube start commands with the --memory flag, like this:

  1. Stop the running Minikube cluster: minikube stop
  2. Start the Minikube cluster with the desired memory allocation: minikube start --memory=10000 Replace 10000 with the desired memory allocation, in megabytes.
  3. Wait for Minikube to start. Depending on the size of the cluster and the resources available on your computer, this could take a few minutes.
  4. Verify that the memory allocation has been updated by running the following command:cCopy codeminikube ssh -- free -m This command will log into the Minikube virtual machine and display the amount of memory that is currently available.

Correction: stop and start does not resize an existing cluster

The steps above suggest that running minikube stop and then minikube start --memory=10000 changes the memory of an existing cluster. With current minikube versions this does not work. Memory, CPUs and disk size are fixed when the VM or container is created. If you pass a different --memory value to an existing profile, minikube keeps the old size and prints a warning like this:

โ—  You cannot change the memory size for an existing minikube cluster. Please first delete the cluster.Code language: JavaScript (javascript)

The working procedure is to delete the cluster and create it again with the new size:

minikube delete
minikube start --memory=10000 --cpus=4Code language: JavaScript (javascript)

Note: minikube delete removes the cluster and everything in it: deployments, PersistentVolumes stored on the node, and images you loaded or built inside it. Export any manifests you need first, or keep your YAML in Git so you can reapply it with kubectl apply -f.

How minikube config works

minikube config stores default values in ~/.minikube/config/config.json. minikube start reads these defaults whenever you don't pass a flag. Flags on the command line always override the stored values.

# Set defaults for future clusters
minikube config set memory 8192
minikube config set cpus 4
minikube config set driver docker
minikube config set kubernetes-version v1.30.0

# Read a single value
minikube config get memory

# Show everything you have set
minikube config view

# Remove a value and go back to minikube's built-in default
minikube config unset memory

# List the accepted values for a property
minikube config defaults driverCode language: PHP (php)

When you set a resource value while a cluster exists, minikube warns that the change takes effect only after minikube delete and a new minikube start. This is the same rule as in the correction above.

PropertyExample valueNotes
memory8192, 8g, maxA plain number is read as megabytes. Units such as mb and g are accepted.
cpus4, maxNumber of virtual CPUs for the node.
disk-size40gSize of the node disk. Applies only when the cluster is created.
driverdocker, virtualbox, hyperkit, kvm2, hyperv, qemuWhich drivers are available depends on your OS.
kubernetes-versionv1.30.0, stable, latestKubernetes version for new clusters.
container-runtimecontainerd, docker, cri-oRuntime used inside the node.

Note: 10000 MB is about 9.8 GiB, not exactly 10 GB. To get a round figure, use --memory=10g or --memory=10240.

Changing resources without losing your current cluster

If you want to keep the existing cluster while you try a larger one, create a second profile. Each profile is a separate cluster with its own resources and its own kubectl context.

  1. Create a new profile with the size you want: minikube start -p big --memory=10g --cpus=4
  2. Point kubectl at it. minikube switches the context for you on start, and you can switch back with kubectl config use-context minikube.
  3. Make big the default profile for later minikube commands: minikube profile big
  4. List all clusters and their status: minikube profile list
  5. When you no longer need the old cluster, delete it: minikube delete -p minikube

Verifying the memory allocation

minikube ssh -- free -m works well for VM drivers such as VirtualBox, Hyper-V, KVM2 and HyperKit, because the guest sees only its own RAM. With the Docker driver the node is a container, and free inside it usually reports the host's total memory rather than the container limit. Use the check that matches your driver:

# Value minikube recorded for the profile (works for every driver)
grep -i '"Memory"' ~/.minikube/profiles/minikube/config.json

# VM drivers: memory seen by the guest OS
minikube ssh -- free -m

# Docker driver: container memory limit in bytes
docker inspect minikube --format '{{.HostConfig.Memory}}'

# What Kubernetes can schedule on the node
kubectl describe node minikube | grep -A 6 AllocatableCode language: PHP (php)

With --memory=10000 on the Docker driver, docker inspect returns 10485760000, which is 10000 ร— 1024 ร— 1024 bytes.

Everyday minikube commands

CommandWhat it does
minikube startCreates the cluster, or starts it again if it is stopped
minikube statusShows the state of the host, kubelet, API server and kubeconfig
minikube stopStops the cluster and keeps its state
minikube pause / minikube unpauseFreezes Kubernetes to save CPU without stopping the node
minikube deleteDeletes the current profile's cluster
minikube delete --all --purgeDeletes every profile and the ~/.minikube folder
minikube kubectl -- get pods -ARuns a kubectl that matches the cluster version
minikube dashboardOpens the Kubernetes Dashboard in a browser
minikube addons list / minikube addons enable ingressLists or enables add-ons such as ingress and metrics-server
minikube service <name> --urlPrints a reachable URL for a NodePort or LoadBalancer Service
minikube tunnelGives LoadBalancer Services an external IP (keep it running in a separate terminal)
minikube image load myapp:1.0Copies a local image into the cluster
eval $(minikube docker-env)Points your Docker CLI at the Docker daemon inside the node (Docker runtime only)
minikube mount ./src:/dataMounts a host folder into the node
minikube ipPrints the node IP
minikube logsShows minikube and component logs for troubleshooting
minikube node addAdds a worker node to the current profile
minikube update-contextFixes a kubeconfig entry that points to a stale IP or port

Common errors and fixes

SymptomCauseFix
"You cannot change the memory size for an existing minikube cluster"Resources are fixed when the cluster is createdRun minikube delete, then minikube start --memory=..., or create a new profile with -p
minikube config get memory shows the new value but the cluster has not changedConfig affects only clusters created afterwardsDelete the cluster and create it again
Requested memory is more than the system limitYou asked for more RAM than the host, or Docker Desktop, can giveLower --memory, or raise the memory limit in Docker Desktop settings first
Requested memory is below the usable minimumValue too small for Kubernetes to runUse at least 2 GB. 4 GB or more is a realistic minimum once add-ons are enabled
Pods stuck in Pending with Insufficient memoryRequests add up to more than the node can allocateLower the resource requests, or recreate the cluster with more memory

Best practices

  • Set memory, cpus and driver once with minikube config set so every new cluster is created the same way.
  • Leave at least a few gigabytes for the host OS. Giving minikube all your RAM makes both the host and the cluster slow.
  • Use minikube stop or minikube pause at the end of the day. Save minikube delete for when you need a clean cluster or a different size.
  • Keep manifests in version control so deleting and recreating a cluster takes minutes.
  • Use a separate profile for each experiment (-p test, -p ingress-lab) so one cluster doesn't break another.
  • Remember that minikube is for local development and learning. For production behaviour such as error handling, see the 500 errors troubleshooting guide.

Frequently asked questions

How do I increase memory for an existing minikube cluster?

Run minikube delete, then minikube start --memory=8g (or another size). minikube cannot resize an existing cluster, so a stop and start with a new --memory flag only prints a warning.

What unit does minikube use for –memory?

A plain number is read as megabytes, so --memory=4096 means 4096 MB. You can also add a unit, for example --memory=4g, or use max to give minikube as much memory as the driver allows.

Where does minikube config store its settings?

Global defaults set with minikube config set go in ~/.minikube/config/config.json. Settings for each cluster, including the memory actually used, are in ~/.minikube/profiles/<profile>/config.json.

Why does free -m inside minikube show my host's total RAM?

With the Docker driver the node is a container, and free reads host memory figures. Check the real limit with docker inspect minikube --format '{{.HostConfig.Memory}}' instead.

What is the difference between minikube stop and minikube delete?

minikube stop shuts down the node but keeps the cluster and its workloads, so you can start it again later. minikube delete removes the cluster completely. You need it before you can change memory, CPUs or disk size.

Related tutorials

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Knative Tutorials: How to install Knative Serving 1.9 in Minikube?

This page shows how to install Knative Serving 1.9.3 on a local Minikube cluster, using Istio as the networking layer and an optional cert-manager integration. Below the…

Read More

Knative Tutorials – Chapter 3 – Install Knative with YAML using minikube

This chapter installs Knative Serving, with Istio as the networking layer, on a local minikube cluster using the official YAML manifests. Below the original steps you will…

Read More

Kubernetes Setup Options: The Complete Guide from Local Labs to Enterprise Production

Kubernetes Setup Options: The Complete Guide from Local Labs to Enterprise Production Kubernetes can be installed in many different ways. The right approach depends on your goal:…

Read More

Complete List of Methods to Deploy Kubernetes

There are many ways to deploy Kubernetes, depending on your needs (learning, production, cloud-native, on-premises, bare metal, multi-cloud, etc). Hereโ€™s a structured list of the main ways…

Read More

Docker and Kubernetes Demo Project

Here’s a step-by-step guide to creating a simple project with a web server and app server using Docker and Kubernetes on Ubuntu, ensuring that the Docker image…

Read More

Minikube Tutorials: minikube tunnel explained

How to access applications running within minikube There are two major categories of services in Kubernetes: NodePort access with Minikube A NodePort service is the most basic…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x