There is no introduction needed for cloud computing at this stage. Kubernetes or k8s goes hand-in-hand when it comes to cloud computing and container orchestration. One of the easy ways of learning kubernetes is to install Minikube in personal laptop and explore.
Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a Virtual Machine (VM) on your laptop for users looking to try out Kubernetes or develop with it day-to-day.https://kubernetes.io/docs/setup/learning-environment/minikube/
In this tutorial, I will take you through how to install and run minikube in Windows 10 (professional) system. In the following segment, I have included docker installation as requirement because I’ll use it for my tests with minikube.
- Windows 10 64-bit (Pro, Enterprise)
- please ensure to enable Hyper-V Windows features. (if you have installed latest docker for windows in your system, you might have already enabled the Hyper-V feature in the docker installation process)
- Minimum 4 GB RAM for ease of operation
Getting started with minikube installation
In this section, I’ll explain how to install minkube step by step.
The Kubernetes command-line tool,https://kubernetes.io/docs/tasks/tools/#kubectl
kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.
Head to https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-windows and download the latest release of kubectl. Place the downloaded kubectl.exe file in a folder of your choice. I have placed it in E:\k8s folder.
While installing Docker Desktop for Windows, it automatically installs its own version of kuectl. The installation path is also added in the PATH environment variable. However, we want to use the newly downloaded kubectl instead of docker installed one. Hence, we will put an entry of the folder path where we placed kubectl.exe (E:\k8s in my case) in PATH environment variable before the docker path.
Type Edit the system environment variables in the windows search bar and edit the PATH variable like below
Now, issue following command to ensure kubectl command has been working properly:
kubectl version –client
The first step before installing minkube is to check whether the virtualization is supported/enabled in our system. If you are following the tutorial as it is, you must have already enabled Hyper-V as part of docker installation (Please cross-check the System Requirement section). However, to cross check, please open a command prompt and execute systeminfo command. If you see Hyper-V output as follows, you are all set.
Next, we’ll download minikube-windows-amd64 from https://github.com/kubernetes/minikube/releases/latest and then :
- Place the dowloaded file in the E:\k8s folder
- Rename the downloaded file to minikube.exe
Now, we have completed our basic steps. Let’s issue the following command from a new command prompt as Administrator to start with the actual minkube installation process.
minikube start –driver=hyperv
It may take a while to complete this process. Hence, have patience. 🙂
The output of this command will be something like following:
Just in case, if you made some mistake while running this command, or want to start afresh, you can do delete the .minikube and .kube folders from %USERPROFILE% folder. Additionally, open Hyper-V Manager and delete the minkube VM. Thereafter, open the command prompt as Administrator and issue this command once more “minikube start –driver=hyperv“
Verify minikube is running
You can open the command prompt as Administrator and issue following command:
If the result is as follows, then your minikube installation is all good and it is running successfully
The dashboard is an integral component of kubernetes. This support is there with minikube as well. To enable the dashboard support, issue following command:
The result will be as follows. It’ll additionally open dashboard in your system’s default web browser.
Should you just want to find the dashboard URL, issue following command:
minikube dashboard –url
This command will not open the dashboard; instead, it will output the dashboard URL.
Start and Stop minikube cluster
You can issue following command to stop your local minikube cluster
You can issue following command to start your local already existing minikube cluster
I hope this simple article will help you to install and spin up your local kubernetes cluster. Happy learning. 🙂