<p>I have local kubernetes cluster. I have deployed my application and exposed as a <code>ClusterIP</code> service.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp 
  template:
    metadata:
      labels:
        app: myapp
        version: v1 
    spec:
      containers:
      - name: myapp
        image: myrepo:5000/myapp
        imagePullPolicy: Always
        ports:
        - containerPort: 8088
      imagePullSecrets:
      - name: regcred
</code></pre>
<p>My service</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: myapp
  namespace: default
  labels:
    app: myapp
spec:
  selector:
    app: myapp 
  ports:
  - protocol: TCP
    port: 8088
    targetPort: 8088
</code></pre>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: myapp
spec:
  host: myapp
</code></pre>
<p><code>kubectl get svc</code> gives :</p>
<pre><code>myapp      ClusterIP      10.233.41.178   &lt;none&gt;     8088/TCP    13m
</code></pre>
<p>I can <code>curl</code> to my services using <code>ClusterIP</code> address, but when I try <code>curl http://myapp:8088/api</code>, it gives. (ran from my master node)</p>
<blockquote>
<p>curl: (7) Failed to connect to myapp port 8088: Connection refused</p>
</blockquote>
<p>I use <code>istio</code> service-mesh. What am I missing here?</p>
<p>I had tried following threads :</p>
<p><a href="https://stackoverflow.com/questions/59824890/not-able-to-access-service-by-service-name-on-kubernetes">unable to access services</a></p>
<p><a href="https://stackoverflow.com/questions/50813767/kubernetes-cannot-access-exposed-services">can not access to exposed services</a></p>

Sachith Muhandiram
<p>This is normal. I can achive the same status with kind and 1 deployment of nginx and one service of type clusterIP.</p>
<pre><code>➜  github_api k get svc
NAME            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
dev-my-nginx    ClusterIP   10.96.235.85    &lt;none&gt;        80/TCP     3d
kubernetes      ClusterIP   10.96.0.1       &lt;none&gt;        443/TCP    3d2h
mysql           ClusterIP   10.97.143.150   &lt;none&gt;        3306/TCP   2d23h
prod-my-nginx   ClusterIP   10.101.89.124   &lt;none&gt;        80/TCP     3d
➜  github_api docker exec -it 212f25f5f073  bash
root@kind-control-plane:/# curl 10.96.235.85
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Welcome to nginx!&lt;/title&gt;
&lt;style&gt;
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;
&lt;p&gt;If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.&lt;/p&gt;

&lt;p&gt;For online documentation and support please refer to
&lt;a href=&quot;http://nginx.org/&quot;&gt;nginx.org&lt;/a&gt;.&lt;br/&gt;
Commercial support is available at
&lt;a href=&quot;http://nginx.com/&quot;&gt;nginx.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;/em&gt;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
root@kind-control-plane:/# curl dev-my-nginx:80
curl: (6) Could not resolve host: dev-my-nginx
root@kind-control-plane:/#
</code></pre>
<p>the service name is only resolved when inside the cluster because coreDNS(most likely) only works there. If you want to get to that service from each worker node use service of type NodePort.</p>
<p>PS. I am not 100% sure. Will double-check if there is another option and update this comment.</p>
<p>PS2 You can do something like :</p>
<pre><code>k port-forward svc/dev-my-nginx :80
</code></pre>
<p>and you can then curl from the node that is port-forwarding</p>
