I am trying to communicate with two pods with two different namespace and different service?
CodePudding user response:
Two pods in different namespaces communicate via the domain name of the service. In your case if pod A (service A) wants to connect to pod B (service B) in namespace blue, it would need to connect to b-service.blue
or the full name of
b-service.blue.svc.cluster.local
CodePudding user response:
As long as you have created a service
to front the pods (NodePort
, ClusterIP
or LoadBalancer
), you can access the pods using the format
{name of service}.{namespace}.svc.cluster.local
So if the service you are trying to access resides in the namespace redis
and is called redis-standlone
, you would access it like this:
redis-standalone.redis.svc.cluster.local