<p>I'm currently working on a kubernetes cluster. Cluster is working properly.
I need to establish communication between services without using proxy.
For example I have services below:</p>

<ol>
<li>worker</li>
<li>app1</li>
<li>app2</li>
<li>app3</li>
</ol>

<p>Worker needs to login to app containers directly via SSH and do some commands.
In docker-compose file it was easy by using links and then ssh app1, ssh app2.
How to do it in Kubernetes ?</p>

<p>You'll want to create a <a href="https://kubernetes.io/docs/concepts/services-networking/service#headless-services" rel="nofollow noreferrer">headless Service</a> (<code>spec.clusterIP: None</code>) selecting your app Pods. This will create a DNS entry (something like <code>my-svc.my-namespace.svc.cluster.local</code>) that will resolve to the set of IPs of the Pods selected by your Service. You can then loop through the returned list of Pod IPs and ssh into each.</p>

<p>More details can be found <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service#services" rel="nofollow noreferrer">here</a>.</p>
