<p>I am running <strong>kubernetes single node on coreos</strong>. </p>

<p>I have created a pod running a python application and exposing an http endpoint.</p>

<p>I have created a kubernetes service that exposes the HTTP endpoint. I have exposed this service using NodePort and can call it successfully from outside the cluster.</p>

<p>What I am then trying is to call the HTTP service from a docker container. To test I am just using the same running container and using curl.  </p>

<p>I can <code>docker exec</code> into the docker container running my service.
nslookup for 'my-service' resolves to an IP address. So I am happy that <strong>DNS service registration is working correctly</strong>. (I have also checked that the ENV variables for the service exist - and they do and are the same as the value returned from <code>nslookup</code>) </p>

<p>However, if I then try:</p>

<pre><code>curl http://my-service:9042/status
</code></pre>

<p>It just hangs with no response. (Port 9042 is the correct port and status is a valid resource)</p>

<p>I'm assuming that I'm missing something really obvious. Any suggestions warmly received.</p>

<p>Update: </p>

<p>The response of curl -v is:</p>

<pre><code>root@lake-cluster-manager:/# curl -v http://lake-service:9042/status
* Hostname was NOT found in DNS cache
*   Trying 10.3.0.128...
</code></pre>

<p>The output from nslookup is:</p>

<pre><code>root@lake-cluster-manager:/# nslookup lake-service   
Server:     10.3.0.10
Address:    10.3.0.10#53

Name:   lake-service.default.svc.cluster.local
Address: 10.3.0.128
</code></pre>

<p>since Kubernetes v1.10 <code>kubectl port-forward</code> allows using resource name, such as a service name, to select a matching pod to port forward 
With this connection in place you can use your local workstation to debug the application that is running in the pod.</p>

<p>capture your pod PORT NUMBER </p>

<pre><code>kubectl get pods [YOUR_PODE_NAME] --template='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}'
</code></pre>

<p>let's say we got PORT NUMBER 8080</p>

<pre><code>kubectl port-forward [YOUR_PODE_NAME] 8080:8080
</code></pre>

<p>Now Navigate to <a href="http://localhost:8080/" rel="nofollow noreferrer">http://localhost:8080/</a> on your local machine to see your application running </p>
