<p>I have managed to deploy a simple ASP.NET MVC application to Kubernetes (Kubernetes enabled in Docker Desktop) using this tutorial: <a href="https://medium.com/@bterkaly/running-asp-net-applications-in-kubernetes-a-detailed-step-by-step-approach-96c98f273d1a" rel="nofollow noreferrer">https://medium.com/@bterkaly/running-asp-net-applications-in-kubernetes-a-detailed-step-by-step-approach-96c98f273d1a</a>.  My manifest looks like this:</p>

<pre><code>environment: development

apphost: k8s

label:
  name: aspnet3core

container:
  name: aspnet3
  pullPolicy: IfNotPresent
  image: aspnet3k8s
  tag: v1
  port: 80
replicas: 3

service:
  port: 8888
  type: ClusterIP
</code></pre>

<p>I have also managed to deploy a simple Web API project to Kubernetes using this tutorial: <a href="https://dev.to/wolnikmarcin/run-asp-net-core-3-on-kubernetes-with-helm-1o01" rel="nofollow noreferrer">https://dev.to/wolnikmarcin/run-asp-net-core-3-on-kubernetes-with-helm-1o01</a>.  My manifest looks  like this:</p>

<pre><code>//myDeploy.yaml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: dotnetlinux
spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: dotnetlinux
    spec:
      containers:
        - image: "brunoterkaly/dotnetlinux"
          imagePullPolicy: Always
          name: dotnetlinux
          ports:
            - containerPort: 80

//myService.yaml
apiVersion: v1
kind: Service
metadata:
  name: dotnetlinux
spec:
  type: LoadBalancer
  ports:
  - port: 80
  selector:
    app: dotnetlinux
</code></pre>

<p>I am now trying to workout how to call the web api from the MVC project.  I cannot find an explanation online of how to do this.  I was hoping there would be a sample project on GitHub, but I can't find it.</p>

<p>I am using Docker Desktop with Kubernetes enabled and Visual Studio 2019 (Kubernetes/Helm).</p>

w0051977
<p>Just posting my comment as an answer:</p>

<p>To access your POD you need to call your service "dotnetlinux" on port :80, something like <code>dotnetlinux:80/yourAPI</code>.</p>

<p>You can also run <code>kubectl get services</code> to get the IP of the service, then use that. Not a good approach though, as the IP of the service will change every time your service is restarted.</p>

<p>In this <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">documentation page</a> there is a lot of details about Services and the sessions Motivation and Service resources explain why Services are needed, and how they help you in your case.</p>
