0
0
KubernetesHow-ToBeginner Ā· 3 min read

How to Start Minikube: Quick Guide to Run Kubernetes Locally

To start Minikube, run the command minikube start in your terminal. This command sets up a local Kubernetes cluster on your machine for testing and development.
šŸ“

Syntax

The basic syntax to start Minikube is:

  • minikube start: Starts the local Kubernetes cluster with default settings.
  • --driver=<driver-name>: Optional flag to specify the virtualization driver (e.g., docker, virtualbox).
  • --cpus=<number>: Optional flag to set the number of CPUs for the cluster.
  • --memory=<size>: Optional flag to allocate memory (e.g., 2048mb) to the cluster.
bash
minikube start [--driver=<driver-name>] [--cpus=<number>] [--memory=<size>]
šŸ’»

Example

This example shows how to start Minikube using the Docker driver with 2 CPUs and 2048 MB memory allocated.

bash
minikube start --driver=docker --cpus=2 --memory=2048mb
Output
šŸ˜„ minikube v1.30.1 on Ubuntu 22.04 ✨ Using the docker driver based on user configuration šŸ‘ Starting control plane node minikube in cluster minikube 🐳 Preparing Kubernetes v1.27.3 on Docker 24.0.5 🚜 Pulling base image ... šŸ”„ Restarting existing docker container for "minikube" ... āŒ› Waiting for kubelet: ... šŸ„ Done! kubectl is now configured to use "minikube" cluster
āš ļø

Common Pitfalls

Some common issues when starting Minikube include:

  • Missing virtualization support: Ensure your system supports virtualization and the chosen driver is installed.
  • Driver not specified or unsupported: If Minikube cannot detect a driver, specify one explicitly with --driver.
  • Insufficient resources: Allocate enough CPU and memory to avoid startup failures.
  • Old Minikube version: Use the latest Minikube version to avoid bugs and compatibility issues.

Example of wrong and right usage:

Wrong: minikube start --driver=unknown
Right: minikube start --driver=docker
šŸ“Š

Quick Reference

Here is a quick reference for starting Minikube:

CommandDescription
minikube startStart Minikube with default settings
minikube start --driver=dockerStart Minikube using Docker driver
minikube start --cpus=4 --memory=4096mbStart Minikube with 4 CPUs and 4GB memory
minikube stopStop the running Minikube cluster
minikube statusCheck the status of the Minikube cluster
āœ…

Key Takeaways

Run minikube start to launch a local Kubernetes cluster quickly.
Specify the driver with --driver if Minikube cannot auto-detect one.
Allocate enough CPU and memory to avoid startup errors.
Use the latest Minikube version for best compatibility and features.
Check cluster status anytime with minikube status.