<p>I want to use the dns system of Google Kubernetes to make one pod (a web-backend) connect to another pod and service (in this case Redis).</p>
<p>When I check the DNS in the cluster, I get this:</p>
<pre><code>[ root@curl:/ ]$ nslookup redis-service
Server:    10.40.0.10
Address 1: 10.40.0.10 kube-dns.kube-system.svc.cluster.local

Name:      redis-service
Address 1: 10.40.2.59 redis-service.default.svc.cluster.local
[ root@curl:/ ]$ 
</code></pre>
<p>In my application, I would set the REDIS_HOST url to <code>redis-service.default.svc.cluster.local</code>.</p>
<p>Unfortunatedly, the logs say it cannot connect:
<a href="https://i.stack.imgur.com/kGd3V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kGd3V.png" alt="enter image description here" /></a>
(also with http:// in front).</p>
<p>Do I miss a setting to make these pods able to communicate using this address? This address is predicable, that is why.</p>
<p><a href="https://i.stack.imgur.com/dEGpF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dEGpF.png" alt="enter image description here" /></a></p>

Riël
<p>I found 2 things that work:</p>
<ul>
<li>Change the service to ClusterIP instead of NodePort.</li>
<li>@harshmanvar in the comments mentioned, when just using the servicename it also works.</li>
</ul>
<p>I am not exactly sure why, would like to understand this behaviour.</p>
