How to Install Minikube on Ubuntu 20.04

Kubernetes is a popular system for container orchestration. Minikube is an open-source tool to create and deploy a simple Kubernetes cluster on your local machine. Learning how to install Minikube on Ubuntu 20.04 is a must for a system administrator.

With the growth in large-scale software applications, you can observe that bundling software in isolated and independent environments ensures the reliability of the overall software system. In addition, it also provides flexibility to manage hardware and software resources efficiently. Before installing Minikube, let’s go through some of the Kubernetes concepts

Kubernetes Concepts

Containers are a standard way of packaging software into an independent unit with no external dependencies. Large-scale applications are usually based on more than one container.  On the other hand, a cluster comprises a group of hardware and software resources coordinated to work in tandem. You deploy these clusters on the containerized applications. This is where Kubernetes comes in. It manages the cluster resources, allocation of clusters to containers, and intra-container communication.

Kubernetes has a component acting as a cluster manager called Control Plane, and it has resources that are being managed called the Nodes. On the other hand, Minikube is a scaled-down version of Kubernetes to help you get started with Kubernetes development. 

In this article, we will cover how to install Minikube on your Ubuntu machines and how to launch it. Furthermore, we will also look at its usage. So, let’s dive in!

Installation Prerequisites

Please make note of the following items before starting PIP installation.

  • Root user privileges on Ubuntu 20.04 machine
  • The minimum number of processors required is 2
  • Free memory required is 2 GB
  • The minimum free disk space required is 20GB
  • You can deploy Minikube as a guest, a container, or natively. In our setup, Minikube will use VirtualBox, a virtual machine manager, to create and launch a guest with Docker and Kubernetes components installed in it.

Install Minikube on Ubuntu

Update and Install Minikube

Firstly, it is a good practice to update your Ubuntu APT package lists to have information about the latest and greatest version of the packages.

sudo apt update

It is also recommended to make the actual upgrade before continuing installation.

sudo apt upgrade

Secondly, install curl to download other packages later.

sudo apt install curl

In the next step, install apt-transport-https package to install APT transport for downloading via the HTTP Secure protocol (HTTPS).

sudo apt install apt-transport-https
Install Minikube on Ubuntu

After that, install VirtualBox and its extension pack to allow Minikube to use it for creating and launching a virtual machine.

sudo apt install virtualbox virtualbox-ext-pack

While installing VirtualBox, you will have to OK the terms and conditions and accept the license.

Minikube is not available under APT. Therefore, you have to download it manually.

wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Install Minikube on Ubuntu

Next, allow the image to be executable using the chmod command.

chmod +x minikube-linux-amd64

Now, either you can add the path where you downloaded the binary to $PATH or place the Minikube executable on a path already in the $PATH variable. Also, it’s better to rename the binary to just minikube.

sudo mv minikube-linux-amd64 /usr/local/bin/minikube

After that, confirm installation by running a version check.

minikube version
Install Minikube on Ubuntu

If the version check displays a proper version, Minikube has been installed successfully. Please note that the version may be different in your environment.

Install Minikube Utility Manager

Although at this point, you have successfully installed Minikube, we recommend that you also install a utility to manage and deploy the cluster. kubectl is the go-to tool in Kubernetes to manage clusters. Similar to Minikube, you have to manually download it.

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

Secondly, allow the image to be executable using the chmod command.

chmod +x ./kubectl

Now, either you can add the path where you downloaded the binary to $PATH or place the kubctl executable on a path already in the $PATH variable. 

sudo mv ./kubectl /usr/local/bin

Finally, confirm installation by running a version check.

kubectl version -o json  --client
Install Minikube on Ubuntu

If the version check displays a proper version, kubectl has been installed successfully. Please note that the version may be different in your environment.

Launch Minikube

It’s time to take Minikube for a spin. Firstly, launch Minikube using the start command of Minikube as follows. It will create the virtual machine and download the cluster image. The cluster image download will take some time.

minikube start

Secondly, check the status of the launched single-node cluster using the status command.

minikube status
status

Thus, as you can see above, our local Kubernetes cluster is up and running.

In addition, you can get more information about this cluster with kubectl.

kubectl cluster-info
Minikube Cluster Info

Hence, as the output of the above command shows, an IP address and port have been assigned to the Kubernetes control plane in the cluster.

On the other hand, you can get information about the nodes in the cluster.

kubectl get nodes
minikube

As the output of the above command shows, there is only one node in the cluster. Finally, you have launched your own Minikube.

Minikube Usage

Minikube has several commands for provisioning and managing local Kubernetes clusters. This is done to optimize the development workflows. The syntax for specifying commands is as follows.

minikube <command>

Minikube Commands

Some of the commands are described as follows.

  • Start: Starts a local Kubernetes cluster
  • Status: Gets the status of the cluster
  • Stop: Stops a running cluster
  • Delete: Deletes a cluster
  • Dashboard: Access the Kubernetes dashboard running within the cluster
  • Pause: Pause the cluster
  • Unpause: Resume the cluster
  • Config: Modify configuration like processors or memory size
  • Addons: Enable or disable a minikube addon
  • Service: Returns a URL to connect to a service in the cluster
  • Ssh: Log in to the minikube environment via ssh for debugging
  • Node: Add, remove or list additional nodes

In conclusion, Minikube is a useful tool for learning Kubernetes as an orchestration method. It is so rich in implementation that with this tool you can evaluate the Kubernetes platform to see if it’s the right platform for your real application. It supports the latest Kubernetes releases, is cross-platform and has several driver options. Furthermore, it also possesses advanced features like load balancing, filesystem mounts, etc., has many add-ons, and supports common CI environments. 

We hope that this detailed guide will assist you in setting up your first Minikube on Ubuntu 20.04 successfully. Stay tuned for more tutorials and articles on the latest trends in the software and IT industry!

If this guide helped you, please share it.

Leave a Reply
Related Posts