Kubernetes (minikube) on Windows

Our Backstory

Airwave Tech is an agency that was born out of the need to build better software while building better culture. I have been a part of big company initiatives that have spanned multiple years and I have raised over $4M USD in venture capital trying to help live streamers make a livable wage from creating content. Now, Airwave Tech is here to you help you build the hardest parts of your Stack.

Objectives

  1. Requirements — Making sure you have everything ready before you begin.
  2. Setup minikube on Windows 10 — Have Kubernetes running locally
  3. Deploy a webapp — Deploy something to mimic the real world
  4. Setup ingress with Nginx — Make your webapp resolvable using a reverse proxy

Step 1. Requirements — Making sure you have everything ready before you begin

a. Make sure you can run Hyper-V and then install it

systeminfo
Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.
choco -?

Step 2. Setup minikube on Windows 10

a. Now that Chocolately is installed, use it to install minikube.

choco install minikube
If it fails, run it again. This happened to me a few times, but I never looked into why.
New-VMSwitch -name minikube -NetAdapterName Ethernet -AllowManagementOS $true
Hyper-V Manager > Action > Virtual Switch Manager..
minikube start --vm-driver hyperv --hyperv-virtual-switch "minikube"
kubectl get pods
minikube dashboard --url
minikube start --help

Step 3. Deploy a webapp

Now that minikube is running on Windows, let’s deploy a webapp. Here is a webapp I have created for this demo. The links to everything mentions are just a few scrolls down.

kubectl apply -f https://raw.githubusercontent.com/airwavetechio/hello-world/master/_k8s/deployment.yml

Step 3b (optional). Understand what’s happening.

If you took a look at the Github repository, you would see that the app.js is being served on port 5000.

docker run -p 5000:5000 --name airwave-helloworld airwavetechio/hello-world
docker kill airwave-helloworld

Step 4. Setup ingress with Nginx

In this exercise, you will finally be able to hit your webapp hosted on minikube.

minikube addons enable ingress
kubectl get pods -n kube-system
kubectl expose deployment airwavetechio-hello-world-deployment --target-port=4998 --type=NodePort
minikube service airwavetechio-hello-world-deployment --url

Your URL is proably going to be different.

This is what we did:

Step 5. Clean up

Delete the NodePort service

kubectl delete service airwavetechio-hello-world-deployment
kubectl delete -f https://raw.githubusercontent.com/airwavetechio/hello-world/master/_k8s/deployment.yml
minikube stop

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store