Installation MiniKube

Installing Minikube

In this lesson, we will walk through the process of installing Minikube on different operating systems—Windows, macOS, and Linux. By the end of this lesson, you will have Minikube installed and ready to run your first local Kubernetes cluster.

1. Downloading and Installing Minikube

Minikube can be installed using package managers, directly via a downloadable binary, or through other methods specific to your operating system.


Installing Minikube on Windows:

Step 1: Install a Hypervisor

  • Ensure that Hyper-V or another supported hypervisor (like VirtualBox or Docker) is installed and enabled.

  • If using Hyper-V:

    • Enable Hyper-V via the "Windows Features" menu.

    • Restart your machine if required.

Step 2: Download Minikube

  • Open PowerShell or Command Prompt as an Administrator.

  • Run the following command to download and install Minikube:

    choco install minikube

Step 3: Verify Installation

  • After installation, verify that Minikube is installed by running:

    minikube version
    • This command should display the version of Minikube installed on your system.


Installing Minikube on macOS:

Step 1: Install a Hypervisor

  • You can use Docker Desktop, HyperKit, or VirtualBox. Docker Desktop is recommended as it integrates well with Minikube.

  • Install Docker Desktop by downloading it from the Docker website.

Step 2: Install Minikube via Homebrew

  • Open your Terminal and run the following command to install Minikube using Homebrew:

    brew install minikube

Step 3: Verify Installation

  • Verify that Minikube is installed by running:

    minikube version
    • This command should show the installed Minikube version.


Installing Minikube on Linux:

Step 1: Install a Hypervisor

  • KVM, VirtualBox, or Docker are common choices for Linux. For high performance, KVM is recommended.

  • To install KVM, run the following commands:

    sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils
    sudo apt-get install virt-manager
    sudo systemctl enable libvirtd
    sudo systemctl start libvirtd

Step 2: Download and Install Minikube

  • You can install Minikube using a package manager or by downloading the binary.

    Using a Package Manager (Debian/Ubuntu):

    curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
    sudo dpkg -i minikube_latest_amd64.deb

    Using Binary Download:

    Curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
    sudo install minikube-linux-amd64 /usr/local/bin/minikube

Step 3: Verify Installation

  • Check that Minikube is properly installed by running:

    minikube version
    • This command will display the installed Minikube version.


2. Starting Your First Minikube Cluster

After installing Minikube, the next step is to start your first Kubernetes cluster.

Step 1: Start Minikube

  • Open your terminal or command prompt and start Minikube by running:

    minikube start
    • This command will create and start a local Kubernetes cluster. By default, Minikube will choose the best virtualization option based on your system.

Step 2: Verify the Cluster is Running

  • To check if your cluster is running correctly, use the following command:

    kubectl get nodes
    • You should see a single node listed, indicating that Minikube has successfully started the cluster.


3. Accessing the Minikube Dashboard

Minikube comes with a built-in Kubernetes dashboard that provides a web-based UI to interact with your cluster.

Step 1: Launch the Dashboard

  • To launch the dashboard, run:

    minikube dashboard
    • This command will open the Kubernetes dashboard in your default web browser.

Step 2: Explore the Dashboard

  • Use the dashboard to explore various Kubernetes components like Pods, Deployments, and Services. The dashboard is a great tool for visualizing and managing your cluster.


4. Stopping and Deleting Minikube

If you want to stop the Minikube cluster or delete it altogether:

Step 1: Stop Minikube

  • To stop the Minikube cluster without deleting it, run:

    minikube stop

Step 2: Delete Minikube

  • To delete the Minikube cluster, use:

    minikube delete

Last updated