Kubernetes (minikube) on Windows

Our Backstory

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

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

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

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

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

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

Step 4. Setup ingress with Nginx

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.

Step 5. Clean up

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

--

--

--

Helping you build the hardest parts of your Stack

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Rails-Test-Jungle

Introduction to the Delphi Method

CRS score draws visualization

Receive and forward incoming e-mails with AWS SES

OCI — Creating a new User

Jenkins discord notifier Multibranch Pipeline

6 Reasons Why Flutter is the Trend-setter in Mobile App Development

Reducing the Complexity of the Layered Architecture for APIs

Organized lockers with numeric identifiers

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
AirwaveTech

AirwaveTech

Helping you build the hardest parts of your Stack

More from Medium

Understanding Kubernetes deployments with Helm

Kubernetes Audit Logs: Who created or deleted a namespace?

Kubernetes + Init Container Pattern + Minikube

[K8s] How to restart Kubernetes Pods