<p>We have 2 namespaces, say namespace1 and namespace2.</p>
<p>The following are the services in namespace1 and the services exposed.</p>
<pre><code>[root@console ~]# oc get svc
NAME                       TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
config-server              ClusterIP   172.30.8.152    &lt;none&gt;        8888/TCP   3h
eureka-server              ClusterIP   172.30.120.74   &lt;none&gt;        8761/TCP   3h
expedia-rapidapi-service   ClusterIP   172.30.236.3    &lt;none&gt;        8233/TCP   3h
travelcodes-service        ClusterIP   172.30.14.36    &lt;none&gt;        8084/TCP   3h
tti-service                ClusterIP   172.30.46.212   &lt;none&gt;        8245/TCP   2h
</code></pre>
<p>I can use nslookup lookup the cluster IP in any pod to the service &quot;travelcodes-service&quot;</p>
<pre><code>/ $ nslookup travelcodes-service.contents.svc.cluster.local
Name:      travelcodes-service.contents.svc.cluster.local
Address 1: 172.30.14.36 travelcodes-service.contents.svc.cluster.local
</code></pre>
<p>However, I can only use curl to access travelcodes-service if the pod is in namespace1 but not namespace2</p>
<pre><code>curl 172.30.14.36:8084/ping
</code></pre>
<p>Is there anything I need to expose in order to let a pod in namespace2 to access &quot;travelcodes-service&quot; in namespace1?</p>

Christopher Cheng
<p>You can access the service  in  with</p>
<pre><code>&lt;service1&gt;.&lt;namespace1&gt;
</code></pre>
<p>For example you can use this url:</p>
<pre><code>http://&lt;service1&gt;.&lt;namespace1&gt;.svc.cluster.local
</code></pre>
<p>More on that: <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#services" rel="nofollow noreferrer">DNS for Services and Pods</a></p>
<p>To get a list of all your namespaces:</p>
<pre><code>oc get ns
</code></pre>
<p>And for a list of services in one namespace:</p>
<pre><code>oc get services -n &lt;namespace-name&gt;
</code></pre>
