<p><code>kubectl describe node docker-for-desktop</code>
This gets the IP address of Docker desktop for Windows.</p>

<p>But we run it on browser with <code>ip:nodeport</code> it is not working.</p>

<p><code>nodeport</code> - is the port number that we mention in the services file of kubernetes cluster.</p>

<p>Please find <code>myservice.yaml</code> file in the code section.</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: xxxx

spec:
  # This defines which pods are going to be represented by this Service
  # The service becomes a network endpoint for either other services
  # or maybe external users to connect to (eg browser)
  selector:
    mykey: webapp
    release: "0-5"

  ports:
    - name: http
      port: 80
      nodePort: 30080
      #this is port number greater than 30000, and it is port of the Node where this cluster is present.

  type: NodePort
</code></pre>

<p><code>http://&lt;dockerDesktopIdaddress&gt;:&lt;nodeport&gt;</code></p>

<p><code>nodeport</code> is the port number in the service file of kubernetes cluster.</p>

<p>always gives error.</p>

<p>I had the same issue and the resolution was simple.
curl localhost:$NODE_PORT</p>

<p>Docker for Mac runs on the same host and you can call the service through localhost. </p>
