<p>I have a pod running in namespace X under Service A.
I have a pod running a REST API in namespace Y under Service B.</p>

<p>How do i set up this communication?</p>

<p>Thank you.</p>

<p>Simply use the full name of the service.  </p>

<p><code>&lt;TARGET_SERVICE_NAME&gt;.&lt;TARGET_NAMESPACE_NAME&gt;.svc.cluster.local</code></p>

<p>Now using your example :</p>

<pre><code>curl B.Y.svc.cluster.local

RESPONSE FROM THE SERVICE B IN NAMESPACE Y
</code></pre>

<p>It will work from anywhere in the cluster but is dependent to the namespace.</p>

<hr>

<p>You can also use <strong><a href="https://akomljen.com/kubernetes-tips-part-1/" rel="nofollow noreferrer">external name</a></strong> which is a bit more complicated but should deal with your problem too.</p>
