<p>I have a proxy service that wraps 3 pods (say pod A, pod B, pod C). Some container inside pod A needs to get virtual IPs of other two pods. How can I do this?</p>

<p>Two options:</p>

<ol>
<li>Talk to the Kubernetes API to get the endpoints for the service. (either with <code>kubectl get endpoints SVCNAME</code> or by GETing the <code>/api/v1/namespaces/{namespace}/endpoints/{svcname}</code> path on the apiserver)</li>
<li>Less likely to be of use, but if you <a href="https://github.com/kubernetes/kubernetes/blob/master/docs/user-guide/services.md#headless-services" rel="nofollow">create a service without a cluster IP</a>, the DNS for that service will return a list of the IP addresses of the backing pods rather than a virtual IP address.</li>
</ol>

<p>The IPs returned in either case are the IP addresses of all the pods backing the service.</p>
