Table of Contents

Inter-service communication between pods in micro service applications.

In Micro-services applications major problem is establishing the communication between one service pod to another service pod across the namespaces.  

How to achieve this issue? Here is the solution.   

If the web service and the app-service are in different namespaces, we cannot communicate as Kubernetes doesn’t communicate across namespaces. We cannot use just service names like web-app-service as they are valid only within the namespace. So, how do we communicate across namespaces? Let’s see.  

Using fully-qualified DNS names  

Kubernetes has the solution for this problem. If we have a cluster DNS service like CoreDNS running, we can use fully qualified DNS names (FQDN). Our web-server is running in namespace test-namespace and has a service web-app-service defined. We can address this using the URL shown below:  

Web-app-service.test-namespace.svc.cluster.local  

Breakdown of the URL  

  1. .cluster.local : This is the root of our cluster DNS; every resource must be accessed from the root.  
  2. .svc : This tells us we are accessing a service resource.  
  3. test-namespace : This is the namespace where our web-app-service is defined.  
  4. web-app-service: This is our service name. 

We can use URLs like http://web-app-service.test-namespace.svc.cluster.local:[portnumber] ignore port if the service is mapping default HTTP port 80)  

So the general format for addressing service in another namespace is to use a fully qualified DNS(FQDN). It is always suitable to use URLs like this as they are universal and can be addressable anywhere throughout the cluster.   

General format of the URL:  
{{service_name}}.{{namespace}}.svc.cluster.local  

This is the solution to communication between pods. 

Read this E-Book to get a pulse on Elasticsearch monitoring.

Are you monitoring your Elasticsearch environment to detect problems like unreliable nodes and out-of-memory errors? Know which metrics to monitor & where to start.

Cloud Engineer

Gabriel Chutuape

A technology enthusiast passionate about automation, Gabriel Chutuape is a Cloud Engineer at ISmile Technologies. He’s part of the ISmile Technologies Cloud enablement team that help customers to design/solution/project engineering, integrating and implementing infrastructure technologies & services.

CLOUD Engineer

Gopi Krishna

I’m working as Cloud DevOps Engineer. Expertise in technologies of Kubernetes, cloud services and cloud-native services, and DevOps technologies in various clouds.

Liked what you read !

Please leave a Feedback

Leave a Reply

Your email address will not be published. Required fields are marked *

Join the sustainability movement

Is your carbon footprint leaving a heavy mark? Learn how to lighten it! ➡️

Register Now

Calculate Your DataOps ROI with Ease!

Simplify your decision-making process with the DataOps ROI Calculator, optimize your data management and analytics capabilities.

Calculator ROI Now!

Related articles you may would like to read

Leveraging IT staff augmentation for effective data management and data architecture
Leveraging IT Staff Augmentation for Effective Data Management and Data Architecture 
How IT Staff Augmentation services flexibility and agility to IT departments
How IT staff augmentation services offer flexibility and agility to IT departments 
Educational Empowerment with IT Staff Augmentation in EdTech Advancements
Educational Empowerment with IT Staff Augmentation in EdTech Advancements 
Proposals

Know the specific resource requirement for completing a specific project with us.

Blog

Keep yourself updated with the latest updates about Cloud technology, our latest offerings, security trends and much more.

Webinar

Gain insights into latest aspects of cloud productivity, security, advanced technologies and more via our Virtual events.

ISmile Technologies delivers business-specific Cloud Solutions and Managed IT Services across all major platforms maximizing your competitive advantage at an unparalleled value.

Request a Consultation