<p>Example, I deployed an ASP.NET Core web api "mydotnetservice1". I tried calling the API using <a href="http://mydotnetservice1:5000" rel="nofollow noreferrer">http://mydotnetservice1:5000</a> but it does not seem to work, is this the correct address? </p>

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

<p>-</p>

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

001
<p>dns name of the service is in the below format</p>

<pre><code>servicename.namespace.svc.cluster.local
</code></pre>

<p>service is virtual. you can use port as 80 in service definition. that way, port can be avoided. in your case, port number is given as 5000. you need to include port number as well to call the service from other pods</p>
