title: In a Kubernetes cluster is it possible to obtain a container/pod IP address from inside a different container
body: <p>Is it possible to determine the neighbour container or pod IP address, e.g. given its name? More specifically, if I have two running containers/pods C1 (ip=1.2.3.4) and C2 (ip=5.6.7.8) and I execute:</p>
  
  <pre><code>  ME$ kubectl exec -it C1 bash
    C1$ magic_command_to_get_ip C2
    5.6.7.8
  </code></pre>
  
  <p>Is there a magic_command_to_get_ip?</p>
  
  <p>I am new to Kubernetes and I used to resolve names to addresses in Docker using <code>getent hosts tasks.$SERVICE</code>, but apparently it does not work with KB. </p>