How To Install Kubernetes Via Minikube On Using Windows 10 PowerShell

Introduction

Minikube is the simplest and quickest way to create a local Kubernetes cluster. It can do this on Windows and Linux macOS. Minikube is a great tool for both developers and those who are new to Kubernetes who want to learn more about the solution, how it works, and its concepts.

In this article, I will teach how to set up Kubernetes in an On-prem environment.

Prerequisites:

  • 2 CPU cores or more
  • 2 GB of free Memory
  • 20 GB of free disk space
  • Internet connection or V Switch should be External
  • Virtualization (Hyper-V or VMware)

In my case, I used Windows 10 Pro and Virtualization Hyper-V.

Step 1

Open PowerShell and Run as Administrator in your Hyper-V host machine.

Step 2

Use the command to install a chocolatey package manager. Once you copy past the command, the chocolatey package will download automatically. You can see choco.exe is now ready. This means the command has been executed successfully.

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Step 3

Once you type choco you can verify the version of chocolatey.

choco

Step 4

Use the following commands, choco install minikube. It will download Kubernetes-cli and the minikube package. Select Yes to confirm installation.

Step 5

I have successfully installed Kubernetes and minikube on my local machine.

Step 6

Once you run the command, it will take some time to download minikube iso from the internet. Once it is finished downloading, Kubernetes cluster will appear on your Hyper-V manager.

minikube start

Step 7

If you want to confirm the minikube control information, you can use the following command.

You can get the dashboard panel URL details also.

kubectl cluster-info

Step 8

If you want, you can navigate directly to the dashboard using the following command. Now, my Kubernetes has been created successfully.

minikube dashboard

Step 9

For example, I created a service in Kubernetes.

apiVersion: v1
kind: Service
metadata:
 name: shanuka-prod
spec:
 selector:
 app.kubernetes.io/name: Shanuka-App
 ports:
 - protocol: TCP
 port: 80
 targetPort: 9376

Conclusion 

This article taught us how to set up Kubernetes using minikube on local Windows 10 machines. If you have any questions, please contact me.

Thanks.


Similar Articles