How to Install Minikube on Linux Mint 21 Step-by-Step

In this guide, we will demonstrate how to install Minikube on Linux Mint 21 step by step.

Minikube is lightweight single node Kubernetes deployment on your local system. Minikube is generally used for some testing, POCs and learning purposes. It is a good starting point for those who want to learn and explore Kubernetes objects like POD, deployment, replicas, Service, ingress controllers, metrics server and Dashboard etc.

Minikube can easily be installed on Linux, Mac and Windows too.

Prerequisites

  • Pre-Install Linux Mint 21 System
  • sudo user with admin access
  • Minimum 2vCPUs and 4 GB of RAM.
  • Minimum 20GB of free disk space
  • Stable Internet connectivity

Without any delay, let’s deep dive into Minikube installation steps.

1) Install Updates

It is highly recommended to install all the available updates before start installing minikube. In order to install updates, run the following apt commands from the terminal.

$ sudo apt update
$ sudo apt upgrade -y

Install-Updates-LinuxMint21-for-Docker

Post installing the updates, install the necessary command line tools like curl and wget using beneath apt command.

$ sudo apt install curl wget apt-transport-https -y

Install-Curl-Wget-LinuxMint21

2) Install Docker (Container Runtime)

Minikube supports multiple drivers such docker, VirtualBox, Podman, kvm2 and qemu. In this guide, we will use docker as minikube driver. To install latest docker on Linux Mint 21, run the beneath commands one after the another from the terminal.

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

Install-Docker-Driver-on-LinuxMint21

Add your local user to docker group using following command.

$ sudo usermod -aG docker $USER
$ newgrp docker

Verify the docker version and its service.

$ docker version
$ system status docker

Docker-Service-Status-LinuxMint21

3) Install Minikube on Linux Mint 21

Minikube binary is not available in the default package repositories of Linux Mint 21. Use the below curl command to download it from the console.

$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

Dowload-Minikube-Binary-LinuxMint21

Next, install Minikube using the following command. This installs Minikube in the /usr/local/bin/ directory.

$ sudo install minikube-linux-amd64 /usr/local/bin/minikube

Once done, check the version of Minikube installed using the command:

$ minikube version

The output confirms that we have installed Minikube v1.32.0

Install-MiniKube-on-LinuxMint21

4) Install Kubectl Utility

Kubectl is a command line utility which allow us to interact with Kubernetes  cluster. Run curl command to download kubectl.

$ curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl

Download-Kubectl-Curl-Command-LinuxMint21

Next, assign execute permissions to the downloaded kubectl file and move it to /usr/local/bin directory.

$ chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin/kubectl

The kubectl command-line utility is now installed. To check its version, run the command:

$ kubectl version -o json  --client

The command prints out the output in JSON format.

Kubectl-Version-Check-LinuxMint21

5) Start the Minikube Using Docker Driver

With all the prerequisites for starting minikube in place, start minikube using the following command and remember to specify `docker` as the driver using the –driver option.

$ minikube start --driver=docker

The command starts a Kubernetes cluster called ‘minikube’. It also pulls a base image, creates a docker container from the image, and ensures that all the Kubernetes components including the control plane, API server, bridge CNI, and RBAC rules are working as expected.

Start-Minikube-Cluster-LinuxMint21

To verify minikube status, run the command:

$ minikube status

The output shown confirms that Minikube is running as expected.

Verify-Minikube-Status-LinuxMint21

To Interact with your Kubernetes, use kubectl commands as shown below:

$ kubectl get nodes
$ kubectl cluster-info
$ kubectl get pods -A

Interacting-with-Minikube-Kubernetes-Cluster-LinuxMint21

6) Test Minikube Installation

To test minikube installation, lets try to deploy nginx based deployment, run following kubectl commands.

$ kubectl create deployment demo-app --image nginx
$ kubectl expose deployment demo-app --name=demo-app-svc --type=NodePort --port=80
$ kubectl get deployment demo-app
$ kubectl get pods
$ minikube service demo-app-svc --url

Test-Minikube-Installation-LinuxMint21

Great, output above confirms that minikube installation is successful as we are able to access our nginx based application.

7) Managing Minikube Addons

Minikube offers multiple addons to add additional functionality to your Kubernetes. By default, only couple of addons are enabled and rest are disabled. To list all the addons of minikube, run

$ minikube addons list

Support-Minikube-Addons-Linuxmint21

To enable an addon, for example, ‘metrics-server‘ and ‘dashboard‘ run the command:

$ minikube addons enable metrics-server
$ minikube addons enable dashboard

Enable-Minikube-Addons-LinuxMint21

To access Kubernetes dashboard, run

$ minikube dashboard

This will automatically start the dashboard in your system’s web browser as show below:

Minikube-Dashboard-Command-LinuxMint21

Minikube-Kubernetes-Dashboard-LinuxMint21

To disable the add-on, run the command:

$ minikube addons disable <addon-name>

8) Manage Minikube

To Stop a minikube cluster, run following command.

$ minikube stop
To delete minikube cluster, run 
 
$ minikube delete

To start the minikube with default resources, run

$ minikube start

To start the minikube with specific resources, run

$ minikube config set cpus 4
$ minikube config set memory 8192
$ minikube delete
$ minikube start

That’s all from this guide, we hope you have found it informative and useful, Kindly do post your queries and feedback in below comments section.

Also Read: How to Register Existing Kubernetes Cluster in Rancher

Leave a Comment