Kubernetes Services Discovery - Cross Namespace Kubernetes Services Discovery - Cross Namespace kubernetes kubernetes

Kubernetes Services Discovery - Cross Namespace


If you are trying to simply look up a service IP by service name through Kubernetes API than it should not really matter if you're doing it through kubectl or a Java client, the options you pass to the API are the same.

The thing that matters however is whether the service name would be looked up in the same namespace only or in all namespaces. Accessing a service from a different namespace can be done by specifying its name along with the namespace - instead of my-service they would need to write my-service.some-namespace.

Services without selectors are also an option to expose a service from one namespace to another so that the namespace would be specified in Kubernetes objects and not in app code.

Please let me know if that helps.