This post covers how to install Docker & Kubernetes on Windows 10 Pro/Ent using Hyper-V/PowerShell/Chocolatey. Ensure Hyper-V features are enabled before proceeding. All commands below are ran via PS.

— Docker Setup —

1) Install Chocolatey:

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString(''))

2) Install Docker for Windows using:

choco install docker-desktop -y

3) Reboot to complete the installation and ensure MobyLinuxVM is running in Hyper-V

4) Spin up a Docker container using:

docker run -ti -p 8080:80 nginx

5) Visit http://localhost:8080 and you should see the nginx start page.

Congrats, you've installed Docker successfully. This is an independent install of Docker. It won't talk to minikube at all, but it's a good toolset for spinning up and playing around with containers. We'll install minikube next, it hosts it's own Docker daemon within the VM itself.

— Kubernetes Setup —

1) Install minikube using:

choco install minikube -y

2) Configure minikube use an existing Hyper-V Virtual Switch via PowerShell:

minikube start --vm-driver=hyperv --hyperv-virtual-switch=NAME

To create one for use with minikube (Adapter with External Access on Host):

New-VMSwitch –Name "minikube" –AllowManagement $True –NetAdapterName "INSERT_HERE_ADAPTER"

3) Boot and configure minikube to use your switch:

minikube start --vm-driver=hyperv --hyperv-virtual-switch=NAME

If this fails to boot you can use: minikube delete

4) Make sure your minikube node is up and running:

kubectl get nodes

5) Open your minikube dashboard:

minikube dashboard

— Deploy your first pod in Kubernetes —

1) Deploy using kubectl

kubectl run hello-nginx --image=nginx --port 80

2) Check the status of the deploy

kubectl get pods

3) Expose to hit the pod

kubectl expose deployment hello-nginx --type=nodeport

4) get the URL of nginx

minikube service --url=true hello-nginx

5) Open nginx via browser

minikube service hello-nginx

— Scale Test —

1) Create a replica of your existing pod

kubectl scale --replicas=2 deployment/hello-nginx

2) Check that your replica is up and running

kubectl get deployment