<p>I am deploying a 5 docker containers topology into Kubernetes, one of the containers is RabbitMQ container X, and every other container has a link to that container. After setting up a link between Y and X(rabbit), Y has a new DNS record in hosts file in order to reach that container by name. Now that I am migrating to Kubernetes, is it possible to reach (ping) other container by name? am I missing something?</p>

<p>You probably want to create a <code>Service</code> object for your deployment of RabbitMQ. It will be accessible by name in the DNS from within the cluster.</p>

<blockquote>
  <p>If you have a Service called "my-service" in Kubernetes Namespace "my-ns" a DNS record for "my-service.my-ns" is created. Pods which exist in the "my-ns" Namespace should be able to find it by simply doing a name lookup for "my-service"</p>
</blockquote>

<p>For more information see the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#dns" rel="nofollow noreferrer">docs</a>.</p>
