loading...

Ingress in Kubernetes with Docker for Windows

katzekat profile image Heidi Harding ・2 min read

I am currently in the process of moving my dev systems from my 2017 Macbook Pro over to my new X1 Extreme gen. 2. On the Mac I had previously used minikube for my Kubernetes needs but I wanted to use the Docker for Windows Kubernetes option instead.

Enabling an Ingress controller was a fairly straight forward affair with minikube. Simply use:
minikube addons enable ingress
and there you go. kubectl get pods should then list your controller and it was automatically available from outside of your cluster.

I spent several hours trying to get an Ingress controller to work under Windows. Ultimately it was just as easy as minikube, however it really wasn't obvious. Therefore, I decided to pen this short article in case anyone else is experiencing the same problem.

In the documentation for the Nginx Ingress controller it states that you must run the mandatory command:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml

If you perform this step on its own, you will end up with an empty Address when entering: kubectl describe ing because there is no service connecting the pod to the outside world.

There is no further information on this page for how to install a service for Windows, however if you follow the Docker for Mac instructions then it will work just fine. The following command made everything start up perfectly for me:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml

I am running with Docker for Windows version 2.1.0.3 stable using WSL.

I hope this helps someone :)

Posted on by:

katzekat profile

Heidi Harding

@katzekat

Interested in Frontend Development and DevOps Tech. Doctor Who fangirl :D

Discussion

pic
Editor guide