<p>I am trying to follow the instructions in this tutorial: <a href="https://docs.docker.com/docker-for-windows/kubernetes/#use-docker-commands" rel="nofollow noreferrer">https://docs.docker.com/docker-for-windows/kubernetes/#use-docker-commands</a>.  I have followed these steps:</p>

<p>1) Enable Kubernetes in Docker Desktop.</p>

<p>2) Create a simple asp.net core 3.1 app in Visual Studio 2019 and add container orchestration support (Docker Compose).</p>

<p>3) Run the app in Visual Studio 2019 to confirm it runs successfully in Docker.</p>

<p>4) Run the following command in DOS: <code>docker-compose build kubernetesexample</code></p>

<p>5) Run the following command in DOS: <code>docker stack deploy --compose-file docker-compose.yml mystack</code></p>

<p>6) Run the following command in DOS: <code>kubectl get services</code>.  Here is the result:</p>

<p><a href="https://i.stack.imgur.com/UeNXF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UeNXF.png" alt="enter image description here"></a></p>

<p>How do I browse to my app? I have tried to browse to: <a href="http://localhost:5100" rel="nofollow noreferrer">http://localhost:5100</a> and <a href="http://localhost:32442" rel="nofollow noreferrer">http://localhost:32442</a>.</p>

<p>Here is my docker-compose.yml:</p>

<pre><code>    services:
      kubernetesexample:
        environment:
          - ASPNETCORE_ENVIRONMENT=Development
        ports:
          - "45678:80"


  [1]: https://i.stack.imgur.com/FAkAZ.png

Here is the result of running: kubectl get svc kubernetesexample-published -o yaml:

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2020-03-14T17:51:41Z"
  labels:
    com.docker.service.id: mystack-kubernetesexample
    com.docker.service.name: kubernetesexample
    com.docker.stack.namespace: mystack
  name: kubernetesexample-published
  namespace: default
  ownerReferences:
  - apiVersion: compose.docker.com/v1alpha3
    blockOwnerDeletion: true
    controller: true
    kind: Stack
    name: mystack
    uid: 75f037b1-661c-11ea-8b7c-025000000001
  resourceVersion: "1234"
  selfLink: /api/v1/namespaces/default/services/kubernetesexample-published
  uid: a8e6b35a-35d1-4432-82f7-108f30d068ca
spec:
  clusterIP: 10.108.180.197
  externalTrafficPolicy: Cluster
  ports:
  - name: 5100-tcp
    nodePort: 30484
    port: 5100
    protocol: TCP
    targetPort: 5100
  selector:
    com.docker.service.id: mystack-kubernetesexample
    com.docker.service.name: kubernetesexample
    com.docker.stack.namespace: mystack
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - hostname: localhost
</code></pre>

<p>Please note the port has now changed:</p>

<p><a href="https://i.stack.imgur.com/UeNXF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UeNXF.png" alt="enter image description here"></a></p>

<p><strong>Update</strong></p>

<blockquote>
  <p>Service - An abstract way to expose an application running on a set of Pods as a network service.</p>
</blockquote>

<p>Rather use Kubernetes documentation. They've interactive, in browser, examples. I see you tried to use <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/" rel="nofollow noreferrer">LoadBalancer</a>, this must be supported on cloud provider or properly set up environments. All publishing services are summered <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types" rel="nofollow noreferrer">here</a>. Try using NodePort, simple configuration 'd be eg.:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: np-kubernetesexample
  labels:
    app: kubernetesexample
spec:
  type: NodePort
  ports:
    port: 5100
    protocol: TCP
    targetPort: 5100
  selector:
    app: kubernetesexample
</code></pre>

<p>... from what I get gather from provided SCs and description, please check port and labels. If successful, application should be available on localhost:3xxxx, 2nd port described under PORTS when you type <code>kubectl get services</code>, <code>xxxx:3xxxx/TCP</code>.</p>
