Kubernetes(minikube) on Windows using chocolaty

M Sunil Kumar
4 min readJul 29, 2020

--

Kubernetes (Single-node cluster-Minikube) with Chocolaty on Windows Platform

What is Kubernetes: It is an orchestration platform from google that can manage container runtimes like docker, containerd, cri-o. etc..
What is Chocolaty: It's like a “yum” repo in Linux. Choco(chocolaty) is designed for windows platform.
What is minikube: minikube is a single-node Kubernetes cluster which can be used to run locally to learn the basics of Kubernetes. I recommend to go with minikube first on windows and then multi-node cluster on Linux machines.

Prerequisites:
Windows version 7 or higher (64-bit)
Hyper-V enabled or Oracle VM Virtual box

Let's jump into practice:

First, we have to make sure that anyone of the virtualization feature has configured, i.e either Hyper-V or Oracle VM Virtual box. It's up to your preference. In my case, I already have VM virtual box configured so I used it for this exercise. But you can use Hyper-V by following the below steps.
Start — →hyper-v — →click on Turn Windows features on or off → select the option Hyper-V(expand it and make sure all sub-options selected)
You should reboot your machine after this step.

Open windows power shell in administrator mode and run below commands:

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

This command will install and setup the chocolaty on your windows machine.

Awesome, you are done with choco installation on your windows machine. Let's start our main content, Installing Kubernetes.

There is a simple command in chocolaty to install minikube(Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day).

choco install minikube

By this minikube is downloaded to our local machine. To use this, we need to start the minikube. That will create a virtual machine based on our setup(Hyper-V or Oracle VM Virual box). For me, it is oracle VM virtual box.

minikube start

You can try executing all the commands available in the Kubernetes documentation page. https://kubernetes.io/docs/reference/kubectl/cheatsheet/

Now we can see a virtual machine was created on my VM virtual box and it is running.

That's it. you have successfully installed single node Kubernetes cluster on your windows machine using chocolaty.

Let's create some pods, services and expose

kubectl run nginx --image=nginx
kubectl get po / kubectl get pods
kubectl get deploy / kubectl get deployment
kubectl expose deploy/nginx --type=NodePort --port 80

Here I expected pod to be created but deployment has been created. If you run “kubectl run nginx --image=nginx” command in linux machine it will create only POD.

Now check the nginx server status on web-browser by taking IP address of node where the pod is running along with nodeport 32542.
IP address con be obtained from below command

kubectl describe pod <pod-name> — —> in my case pod is nginx-76df748b9-xdwjr
kubectl describe pod nginx-76df748b9-xdwjr

Great, we came to last. Now we can check the nginx service status on the browser.

http://192.168.99.101:32542

That’s all. We successfully installed Kubernetes(single-node cluster-minikube) on a windows machine using Chocolaty. Have fun...

Thanks for reading this document. I hope you will like this post. If you have any doubts or face any issues you can write to me in the response section.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

M Sunil Kumar
M Sunil Kumar

Written by M Sunil Kumar

DevOps enthusiastic, OpenSource Software Developer.

No responses yet

Write a response