If you are looking for an easy and cost-effective way of getting started with Kubernetes, then Minikube is your go to resource. So what is Minikube? Minikube is a free and opensource Kubernetes implementation that allows you to create a virtual machine locally on your PC and deploy a simple one-cluster node. Minikube provides a command-line interface that enables you to manage cluster operations such as starting, stopping and deleting nodes from the cluster. In this tutorial, you will learn how to install Minikube on Debian 10 (Buster).
Prerequisites for Minikube
- A newly installed instance of Debian 10 Buster
- A regular user with sudo
- A stable internet connection
Let’s now roll our sleeves and get into installing Minikube on Debian 10.
Step 1) Apply updates & install minikube dependencies
First and foremost, we need to update the system packages on our instance. To achieve this, execute the commands:
$ sudo apt update -y $ sudo apt upgrade -y
Additionally, ensure that you have installed the necessary packages to enable you execute subsequent commands later on in this guide.
$ sudo apt install curl wget apt-transport-https -y
Step 2) Install KVM hypervisor
To create virtual machines, we will need to have a hypervisor installed. In this guide, we are using KVM hypervisor. Check out this guide for more on how to install KVM hypervisor in Debian 10
Step 3) Install Minikube
Once you have the KVM hypervisor is in place, then use the wget command to download the latest Minikube library as shown.
$ wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Next, copy the binary file to the /usr/local/bin path as shown
$ sudo cp minikube-linux-amd64 /usr/local/bin/minikube
Be sure to assign execute permissions to the file.
$ sudo chmod +x /usr/local/bin/minikube
At this point, you can check the version of Minikube installed by running the command below. At the time of writing this guide. The latest version of Minikube is Minikube v1.15.1
$ minikube version
output of above command would be:
[email protected]:~$ minikube version minikube version: v1.15.1 commit: 23f40a012abb52eff365ff99a709501a61ac5876 [email protected]:~$
Step 4) Install kubectl tool
Kubectl is Kubernetes command-line tool that enables you to execute commands against a Kubernetes cluster. With kubectl, you can deploy applications, manage and inspect cluster resources including having a peek at the log files.
To install kubectl , you first need to download the binary file using the curl command as shown:
$ curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
Make the binary file executable.
$ chmod +x ./kubectl
Next, move the binary file to your path as shown.
$ sudo mv ./kubectl /usr/local/bin
You can now verify the installation by running the command:
$ kubectl version -o yaml
Step 4) Starting Minikube
To start Minikube run the command:
$ minikube start
The command automatically select the KVM driver, downloads the virtual machine boot image and creates a Kubernetes cluster with a single node.
You can access Minikube on the command-line by running the command
$ minikube ssh
To exit from the shell, simply run:
To stop a Kubernetes cluster run :
$ sudo minikube stop
To view the status of Minikube, run following minikube command:
[email protected]:~$ minikube status minikube type: Control Plane host: Running kubelet: Running apiserver: Running kubeconfig: Configured [email protected]:~$
Run below command to verify status of node
[email protected]:~$ kubectl get nodes NAME STATUS ROLES AGE VERSION minikube Ready master 3h54m v1.19.4 [email protected]:~$
To verify the status of the cluster, invoke the command:
$ kubectl cluster-info
Some output similar to what we have will be displayed on the terminal.
Additionally, to get a glance at kubectl’s default configuration, run the command:
$ kubectl config view
Step 6) Accessing Kubernetes dashboard
Kubernetes comes with built-in dashboard that allows you to manage your cluster. To view all the addons that come with minikube run:
$ minikube addons list
To activate the Kubernetes dashboard, execute:
$ minikube dashboard
This will trigger your default web browser to pop open the Kubernetes dashboard as shown below:
Perfect! We have successfully installed Minikube on Debian 10 and automatically created a single-node Kubernetes cluster.