<p>I have created a local ubuntu Kubernetes cluster,  having 1 master and 2 slave nodes.</p>

<p>I deployed 2 applications in 2 pods and created service for both of the pods, it's working fine.
I entered inside pod by typing this command ,</p>

<pre><code>$ kubectl exec -it firstpod /bin/bash
# apt-get update
</code></pre>

<p>Unable to make update and I'm getting an error:</p>

<pre><code>Err http://security.debian.org jessie/updates InRelease

Err http://deb.debian.org jessie InRelease

Err http://deb.debian.org jessie-updates InRelease

Err http://security.debian.org jessie/updates Release.gpg   Temporary failure resolving 'security.debian.org' Err http://deb.debian.org jessie-backports InRelease

Err http://deb.debian.org jessie Release.gpg   Temporary failure resolving 'deb.debian.org' Err http://deb.debian.org jessie-updates Release.gpg   Temporary failure resolving 'deb.debian.org' Err http://deb.debian.org jessie-backports Release.gpg   Temporary failure resolving 'deb.debian.org' Reading package lists... Done W: Failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease

W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/InRelease

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg  Temporary failure resolving 'security.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg  Temporary failure resolving 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/Release.gpg  Temporary failure resolving 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/Release.gpg  Temporary failure resolving 'deb.debian.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.
</code></pre>

<p>I'm trying to ping my second pod service:</p>

<pre><code># ping secondservice (This is the service name of secondpod)
PING secondservice.default.svc.cluster.local (10.100.190.196): 56 data bytes
unable to ping.
</code></pre>

<p>How can I ping/call the second service from the first node?</p>

<p>There are two (unrelated) questions I see there. I'm going to focus on the second one since the first is unclear to me (what is the ask?).</p>

<p>So, you wonder why the following doesn't work:</p>

<pre><code># ping secondservice 
</code></pre>

<p>This is not a bug or unexpected (actually, I wrote about it <a href="https://blog.openshift.com/kubernetes-services-by-example/" rel="nofollow noreferrer">here</a>). In short: the FQDN <code>secondservice.default.svc.cluster.local</code> gets resolved via the DNS plugin to a virtual IP (<a href="https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies" rel="nofollow noreferrer">VIP</a>), the very essence of this VIP is that it is virtual, that is, it's not attached to a network interface, it's just a bunch of iptables rules. Hence, the ICMP-based ping has nothing to work against, since it's not a 'real' IP. You can <code>curl</code> the service, though. Assuming the service runs on port 9876, the following should work:</p>

<pre><code># curl secondservice:9876
</code></pre>
