How to configure pod to pod communication in Amazon EKS cluster

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: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.

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.


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: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 :slight_smile:

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 :slight_smile:

1 Like