A minimal minikube cheat sheet

A collection of commands and tips and tricks for using minikube.

A minimal minikube cheat sheet
minikube Logo from their Website https://minikube.sigs.k8s.io

What is minikube?

Minikube is a lightweight tool that enables developers to run a cluster locally on their machine. It's an ideal solution for those looking to learn Kubernetes, develop applications, or test deployments without needing access to a full-scale Kubernetes cluster. With Minikube, users can quickly experiment with Kubernetes features, making it a valuable tool for local development and prototyping.

Minikube profiles

Minikube is able to run and manage multiple Kubernetes clusters at the same time. A Kubernetes cluster in this context is referred to as profile. To define which Kubernetes cluster should be use you can use the --profile / -p flag together with the desired minikube command.

Adding the flag to each command can quickly become tedious, thankfully you can also switch into another profile:

minikube profile <PROFILE-NAME>

To display which profile is currently active you can use:

minikube profile list

The output show a column with the active profile:

|--------------|-----------|---------|--------------|------|---------|---------|-------|--------|
|   Profile    | VM Driver | Runtime |      IP      | Port | Version | Status  | Nodes | Active |
|--------------|-----------|---------|--------------|------|---------|---------|-------|--------|
| cluster1     | docker    | docker  | 192.168.58.2 | 8443 | v1.30.4 | Running |     1 | *      |
| cluster2     | docker    | docker  | 192.168.49.2 | 8443 | v1.30.4 | Running |     1 |        |
|--------------|-----------|---------|--------------|------|---------|---------|-------|--------|

Starting a Cluster

The probably most important command is starting - or if it doesn't exist yet creating - a cluster:

minikube start

Helpful flags:

  • --kubernetes-version: The Kubernetes version to use (like v1.30.4). Defaults to stable.
  • --nodes: the number of nodes. Defaults to 1.
  • --cpus: Number of CPUs to allocate. Defaults to 2. Use max to use the maximum number of CPUs.
  • --memory: Amount of RAM to allocate (like 4g). Use max to
    use the maximum amount of memory.

Cluster Lifecycle

You can see the status of a cluster with:

minikube status

Stop a cluster, but keep the user data. The cluster can be started again with the start command:

minikube stop

Delete a cluster and remove all the user data. The cluster can not be started again:

minikube delete

Service interaction

Display all deployed Services and their URL:

minikube service list

Open the service in your Browser:

minikube service <SERVICE_NAME>

Node interaction

Retrieve the IP address of the specified node:

minikube ip --node=<NODE_NAME>

Retrieve log entries of minikube:

minikube logs

You can also specify which node to get logs for:

minikube logs --node=<NODE_NAME>

Minikube Addons

Minikube has support for a lot of addons. See the documentation for the complete list: https://minikube.sigs.k8s.io/docs/handbook/addons.

Display all available addons and if they are enabled or disabled:

minikube addons list

Enable an addon:

minikube addons enable <ADDON_NAME>

Disable an addon:

minikube addons disable <ADDON_NAME>

Use the Minikube Dashboard:

minikube dashboard

Minikube CLI

Create completion scripts:

minikube completion <SHELL>

Check for updates:

minikube update-check

More Resources