how to enable communication between services running in the same eks cluster inside same namespace

0

Hi I have two services running in an aws eks cluster say serviceA and serviceB, both services are dependent on each other. My question is can i call serviceA using the name of the service and port number it's exposed on like http://serviceAname:portnum from inside serviceB.

bharath
gefragt vor 8 Monaten989 Aufrufe
2 Antworten
2

Hi,

Yes, you can, but if in a different namespace, you might need to add a namespace as well: http://serviceAname.namespaceName.svc.cluster.local:portnum

Please take a look at this documentation https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/

profile picture
EXPERTE
beantwortet vor 8 Monaten
1
Akzeptierte Antwort

Hi,

Yes, using the service name directly is the most easier way. This is one of the simplest ways of addressing, but it requires cluster DNS to be set-up and working properly. Pods that run inside the Amazon EKS cluster use the CoreDNS service's cluster IP as the default name server for querying internal and external DNS records. If there are issues with the CoreDNS pods, service configuration, or connectivity, then applications can fail DNS resolutions. If you are facing or face any issues with name resolutions you can refer to this post for guidance - https://repost.aws/knowledge-center/eks-dns-failure

AWS
beantwortet vor 8 Monaten
profile picture
EXPERTE
überprüft vor 2 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen