<p>I would like to perform a call to my echo-server but I can not figure out what's the hostname of my service:</p>
<pre><code>orion:webanalytics papaburger$ kubectl get services -n web-analytics
NAME                   TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)      AGE
echo-server            ClusterIP   10.100.92.251    &lt;none&gt;        80/TCP       87m
web-api                ClusterIP   10.100.92.250    &lt;none&gt;        8080/TCP     87m
</code></pre>
<p>I have tried to reach using <code>kubectl exec -it curl-curl0 -- curl http://web-analytics.echo-server.svc.cluster.local/heythere</code> but it fails:</p>
<pre><code>curl: (6) Couldn't resolve host 'web-analytics.echo-server.svc.cluster.local'
</code></pre>
<p>If I change <code>web-analytics.echo-server.svc.cluster.local</code> to cluster ip, it works.</p>
<p>How can I make my pods (web-api) reach the echo server?</p>
<p>edit:</p>
<pre><code>orion:webanalytics papaburger$ kubectl get ep -n web-analytics
NAME                   ENDPOINTS             AGE
echo-server            172.16.187.247:80     95m
web-api                172.16.184.217:8080   95m
</code></pre>

<p>it should be like this</p>
<p>the service name is always like this</p>
<p><code>&lt;service-name&gt;.&lt;namespace-name&gt;.svc.cluster.local</code></p>
<pre><code>kubectl exec -it curl-curl0 -- curl http://echo-servcer.web-analytics.svc.cluster.local/heythere
</code></pre>
<p>or alternative way would be you can directly curl the <code>POD_IP:80</code></p>
