Kubernetes communication between pods using REST Kubernetes communication between pods using REST kubernetes kubernetes

Kubernetes communication between pods using REST


You need to call Service B by it's Kubernetes DNS name and it should connect directly without going through the ingress.

To clarify Service A doesn't talk to Service B, but rather Pod A talks to Service B and Pod B talks to Service A. So, long all pods and services are in the same Kubernetes namespace, you can communicate with the service with the service name as the hostname and that will resolve to the internal IP address of the service and then forward the traffic to the pod.

If the pods happen to be in different namespaces you would connect with the namespace name added to the service: <service-name>.<namespace-name> or with <service-name>.<namespace-name>.svc.cluster.local

Hope it helps.