I have a k8 cluster where API A (k8 service manifest exist) needs to be able to talk to API B (no k8 service manifest exists since I want it internal). Using the Docker Compose we can specify the API by name in the URL ie.
If the name of the service in the Docker Compose is api-b then we can use
http://api-b:8080/
I have done some research and it seems we have to use a different format for k8 and that’s the following
http://api-b.default.svc.cluster.local:8080/
api-b
is what is defined in the deployment manifest as the “name”
This approach doesn’t seem to work and I get an error like
Name or service not known (api-b.default.svc.cluster.local:8080)
I am aware when the cluster is deployed, the name of the Pod is api-b-6f699f6fd9
(as hash appended to the end). Does this impact it? If not, anyone got an idea of something I can try?