<p>In minikube I can get a service's url via <code>minikube service kubedemo-service --url</code>.  How do I get the URL for a <code>type: LoadBalancer</code> service in Docker for Mac or Docker for Windows in Kubernetes mode?</p>

<p><code>service.yml</code> is:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: kubedemo-service
spec:
  type: LoadBalancer
  selector:
    app: kubedemo
  ports:
  - port: 80
    targetPort: 80
</code></pre>

<p>When I switch to <code>type: NodePort</code> and run <code>kubectl describe svc/kubedemo-service</code> I see:</p>

<pre><code>...
Type:                     NodePort
LoadBalancer Ingress:     localhost
...
NodePort:                 &lt;unset&gt;  31838/TCP
...
</code></pre>

<p>and I can browse to <code>http://localhost:31838/</code> to see the content.  Switching to <code>type: LoadBalancer</code>, I see localhost ingress lines in <code>kubectl describe svc/kubedemo-service</code> but I get <code>ERR_CONNECTION_REFUSED</code> browsing to it.</p>

<p>(I'm familiar with <code>http://localhost:8080/api/v1/namespaces/kube-system/services/kubedemo-service/proxy/</code> though this changes the root directory of the site, breaking css and js references that assume a root directory.  I'm also familiar with <code>kubectl port-forward pods/pod-name</code> though this only connects to pods until k8s 1.10.)</p>

<p>How do I browse to a <code>type: LoadBalancer</code> service in Docker for Win or Docker for Mac?</p>

robrich
<p>LoadBalancer will work on Docker-for-Mac and Docker-for-Windows as long as you're running a recent build. Flip the type back to <code>LoadBalancer</code> and update. When you check the describe command output look for the <code>Port:  &lt;unset&gt;  80/TCP</code> line. And try hitting <a href="http://localhost:80" rel="noreferrer">http://localhost:80</a>.</p>
