<p>I am running local kubernetes cluster installed as a part of Docker Desktop.</p>
<pre><code>kubectl version
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;18&quot;, GitVersion:&quot;v1.18.0&quot;, GitCommit:&quot;9e991415386e4cf155a24b1da15becaa390438d8&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-03-25T14:58:59Z&quot;, GoVersion:&quot;go1.13.8&quot;, Compiler:&quot;gc&quot;, Platform:&quot;windows/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;16+&quot;, GitVersion:&quot;v1.16.6-beta.0&quot;, GitCommit:&quot;e7f962ba86f4ce7033828210ca3556393c377bcc&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-01-15T08:18:29Z&quot;, GoVersion:&quot;go1.13.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p>I am creating deployment by running</p>
<pre><code>kubectl create deployment firstkube-deployment --image=firstkube:v1
deployment.apps/firstkube-deployment created
</code></pre>
<p>Then exposing the deployment by</p>
<pre><code>kubectl expose deployment firstkube-deployment --type=NodePort --port=8080
service/firstkube-deployment exposed
</code></pre>
<p>The kubectl describe services command returns the following</p>
<pre><code>kubectl describe services/firstkube-deployment
Name:                     firstkube-deployment
Namespace:                default
Labels:                   app=firstkube-deployment
Annotations:              &lt;none&gt;
Selector:                 app=firstkube-deployment
Type:                     NodePort
IP:                       10.107.205.123
LoadBalancer Ingress:     localhost
Port:                     &lt;unset&gt;  8080/TCP
TargetPort:               8080/TCP
NodePort:                 &lt;unset&gt;  31448/TCP
Endpoints:                10.1.0.8:8080
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   &lt;none&gt;
</code></pre>
<p>The request to <a href="http://127.0.0.1:31448/" rel="nofollow noreferrer">http://127.0.0.1:31448/</a> from browser fails with
This page isn’t working
127.0.0.1 didn’t send any data.
ERR_EMPTY_RESPONSE</p>
<p>If I am trying to reach my app using api proxy, by requesting
<a href="http://127.0.0.1:8001/api/v1/namespaces/default/pods/firstkube-deployment-6778f8d74-qhgz2/proxy/" rel="nofollow noreferrer">http://127.0.0.1:8001/api/v1/namespaces/default/pods/firstkube-deployment-6778f8d74-qhgz2/proxy/</a>
I am able to get response back, the application is app and running.</p>
<p>I have tried the proposed solution from this post
<a href="https://stackoverflow.com/questions/50178696/access-a-kubernetes-service-running-locally-in-docker-for-desktop">Access a Kubernetes Service running locally in Docker For Desktop?</a>
It doesn't help.</p>
<p>Providing also pods info</p>
<pre><code>kubectl describe pods
Name:         firstkube-deployment-6778f8d74-qhgz2
Namespace:    default
Priority:     0
Node:         docker-desktop/192.168.65.3
Start Time:   Sat, 27 Jun 2020 18:30:38 -0400
Labels:       app=firstkube-deployment
              pod-template-hash=6778f8d74
Annotations:  &lt;none&gt;
Status:       Running
IP:           10.1.0.4
IPs:
  IP:           10.1.0.4
Controlled By:  ReplicaSet/firstkube-deployment-6778f8d74
Containers:
  firstkube:
    Container ID:   docker://1662d883b9f049a5e4fa0eab9283e2eefdfac80b0ce95ac6db02c89d9357cf18
    Image:          firstkube:v2
    Image ID:       docker://sha256:78332407ac919779bc6fb331b955bcdd0183452a8e699c8552c6cbca05978c42
    Port:           &lt;none&gt;
    Host Port:      &lt;none&gt;
    State:          Running
      Started:      Sat, 27 Jun 2020 18:30:39 -0400
    Ready:          True
    Restart Count:  0
    Environment:    &lt;none&gt;
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-8tfz2 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  default-token-8tfz2:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-8tfz2
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type    Reason     Age   From                     Message
  ----    ------     ----  ----                     -------
  Normal  Scheduled  10m   default-scheduler        Successfully assigned default/firstkube-deployment-6778f8d74-qhgz2 to docker-desktop
  Normal  Pulled     10m   kubelet, docker-desktop  Container image &quot;firstkube:v2&quot; already present on machine
  Normal  Created    10m   kubelet, docker-desktop  Created container firstkube
  Normal  Started    10m   kubelet, docker-desktop  Started container firstkube
</code></pre>

Alexey Auslender
<p>The problem was with kubectl expose deployment command. It needs to be provided port 80</p>
<pre><code>kubectl expose deployment firstkube-deployment --type=NodePort --port=80
service/firstkube-deployment exposed
</code></pre>
<p>Then get services returns the following</p>
<pre><code>kubectl get services/firstkube-deployment
NAME                   TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
firstkube-deployment   NodePort   10.96.23.130   &lt;none&gt;        80:32001/TCP   32s
</code></pre>
<p>Now I can reach my application in browser by requesting http://localhost:32001</p>
