# How to configure pod to pod communication in Amazon EKS cluster

**URL:** <https://discuss.kubernetes.io/t/how-to-configure-pod-to-pod-communication-in-amazon-eks-cluster/5296>\
**Category:** General Discussions\
**Created:** [March 6, 2019, 12:40pm UTC](https://discuss.kubernetes.io/t/how-to-configure-pod-to-pod-communication-in-amazon-eks-cluster/5296 "2019-03-06T12:40:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![siva1290](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@siva1290](https://discuss.kubernetes.io/u/siva1290)\
**Post date:** [March 6, 2019, 12:40pm UTC](https://discuss.kubernetes.io/t/how-to-configure-pod-to-pod-communication-in-amazon-eks-cluster/5296/1 "2019-03-06T12:40:25Z")

</div>

Hello Team,  
I created an amazon EKS cluster, with 2 nodes. And i created 2 pods of kind deployment and exposed the service for the both pods of type “LoadBalancer”.

POD-1 URL: https://{ALB}:443/custom-build --\> (httpd deployed with htttps)  
POD-2 URL: https://{ALB}:8445/custom-build/swagger-ui.html --\> (wildfly-10 deployed with https)

I am able to access both URL’s from the web browser with [https://LB](https://LB):PORT & https://{node-ip}:exposed-port.

# WORKAROUND:

I am using one configuration file in POD-1 to communicate with POD-2, And i am updating POD-2 node ip address with exposed port in POD-1 configuration file as a workaround.

# Questions

1). Unable to communicate POD-1 to POD-2 if i use Loadbalancer ip in my configuration file, SO please help me out.

2). What happen if my worker node went down, It will create an another worker with different ip, So how do i automatically update the new ip address in POD-1 configuration file.

3). How do we communicate from Front end pod (POD-1) to Backend pod (POD-2) using configuration file in POD-1.

---

<div class="post-metadata">

**Author:** ![macintoshprime](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/macintoshprime/32/7121_2.png) [@macintoshprime](https://discuss.kubernetes.io/u/macintoshprime)\
**Post date:** [March 6, 2019, 1:09pm UTC](https://discuss.kubernetes.io/t/how-to-configure-pod-to-pod-communication-in-amazon-eks-cluster/5296/2 "2019-03-06T13:09:48Z")

</div>

Does POD-2 need to be publicly exposed? If not you can just keep that as a ClusterIP service type.

You should be able to get POD-1 to talk to POD-2 via the service name or the url for the LB.

---

<div class="post-metadata">

**Author:** ![rata](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/rata/32/18244_2.png) [@rata](https://discuss.kubernetes.io/u/rata)\
**Post date:** [March 6, 2019, 11:24pm UTC](https://discuss.kubernetes.io/t/how-to-configure-pod-to-pod-communication-in-amazon-eks-cluster/5296/3 "2019-03-06T23:24:40Z")

</div>

> ![](https://us1.discourse-cdn.com/flex016/uploads/kubernetes/original/2X/a/a7f1a182981d1bc4d8653d9a94065bfee44c7c31.png "siva1290")  
> [siva1290](https://discuss.kubernetes.io/u/siva1290)
> 
> ```
> March 6
> 
> ```
> 
> Hello Team,
> 
> I created an amazon EKS cluster, with 2 nodes. And i created 2 pods of kind deployment and exposed the service for the both pods of type “LoadBalancer”.

> POD-1 URL: https://{ALB}:443/custom-build → (httpd deployed with htttps)
> 
> POD-2 URL: https://{ALB}:8445/custom-build/swagger-ui.html → (wildfly-10 deployed with https)

> I am able to access both URL’s from the web browser with [https://LB](https://LB):PORT & https://{node-ip}:exposed-port.

> # WORKAROUND:
> 
> I am using one configuration file in POD-1 to communicate with POD-2, And i am updating POD-2 node ip address with exposed port in POD-1 configuration file as a workaround.

> # Questions
> 
> 1). Unable to communicate POD-1 to POD-2 if i use Loadbalancer ip in my configuration file, SO please help me out.

See the service documentatio in the website for more details. But service load balancer builds on top of service nodePort that builds on top of cluster IP.

So, you already have a static IP address allocated that you can use to communicate, the cluster IP of the service. You can see it by running kubectl get svc yourname -o yaml.

This IP is static and it will load balance between all ready pods that match the selector specified in the service.

> 2). What happen if my worker node went down, It will create an another worker with different ip, So how do i automatically update the new ip address in POD-1 configuration file.

The service IP (and DNS name) is static. The pod IP may change, but the service IP is static and will load balancer between the live (and ready) pods.

So. You can use the service IP or DNS name 🙂

> 3). How do we communicate from Front end pod (POD-1) to Backend pod (POD-2) using configuration file in POD-1.

Service. Check the docs, there are examples too that might make it very clear 🙂
