Starting an Ingress service on Docker for Mac

Chris G. picture Chris G. · Jan 13, 2018 · Viewed 7.2k times · Source

Using:

kubectl expose deployment <Name-Of-Servce> --name=loadbalancer --port=8080 --target-port=8080 --type=LoadBalancer

The kubectl get services is showing pending:

loadbalancer                 LoadBalancer   <x.x.x.x>   <pending>     8080:32670/TCP   2m

Before Docker surported Kubernetes, I could use MiniKube and Helm:

helm install stable/jenkins
kubectl get services // To get the service name
minikube service original-llama-jenkins // << The service name

Now that we have Docker for Mac(Edge) supporting Kubernetes, how do you add an EXTERNAL-IP?

Answer

citizenrich picture citizenrich · Feb 3, 2018

Both type LoadBalancer and NodePort work on Docker for Mac Kubernetes. It's a lovely bit of magic, actually. Just hit localhost:[port]. For NodePort, a port is automatically assigned unless specified in the service definition. For type LoadBalancer, it is also specified in the service definition. Note that in using LoadBalancer, the status from kubectl will be shown as <pending> for EXTERNAL-IP but it does work.

This guy notes that it's exposed through vpnkit though I think another source would be helpful:

https://github.com/jnewland/local-dev-with-docker-for-mac-kubernetes

Edit: updated because Kubernetes is now available in stable versions of DfM.