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.
How do i set up this communication?
Thank you.
Simply use the full name of the service.
<TARGET_SERVICE_NAME>.<TARGET_NAMESPACE_NAME>.svc.cluster.local
Now using your example :
curl B.Y.svc.cluster.local
RESPONSE FROM THE SERVICE B IN NAMESPACE Y
It will work from anywhere in the cluster but is dependent to the namespace.
You can also use external name which is a bit more complicated but should deal with your problem too.