Does Service Connect Creates its own Local Network with localhost ip structure instead of using the private ip from vpc cidr?

0

Request Flow: Client to Public ALB to Private Broker Service to Private Helper Service!

I expected that Service Connect would utilize the private IP from the VPC CIDR block, but it consistently follows its own pattern of using 127... every time.

In my application, there's a route like this: http://router-2017814625.ca-central-1.elb.amazonaws.com/cat

It displays the /etc/hosts file of my broker service:

127.0.0.1 localhost

172.31.56.50 ip-172-31-56-50.ca-central-1.compute.internal

127.255.0.1 broker

2600:f0f0:0:0:0:0:0:1 broker

127.255.0.2 helper

2600:f0f0:0:0:0:0:0:2 helper

Here, all DNS resolutions are mapped to IP addresses starting with 127.255, while my CIDR block is in the range of 172.31.... So, what is actually happening here? Is Service Connect creating its own virtual network like a VPC?

Because pinging the helper microservice also works from those unknown IPs:

http://router-2017814625.ca-central-1.elb.amazonaws.com/ping/helper

As there are two tasks under the helper service, it toggles between:

Response: <h1 style='text-align:center'>Passport: CYsjIx0zMvQk3Vg5BKt9wBYabrSnfj7RG8Kq8y6sWjHHs6irP1</h1> &

Response: <h1 style='text-align:center'>Passport: I9xlXUVpKHu2oWipby3hlohNgeWXhNNc7EiEU3tni6EXgYk4RV</h1>

And here comes the second doubt! In the /etc/hosts of the broker, only one IP is being shown for IPv4, and I have only one task under the broker service. Then how is it reaching or accessing both tasks inside the helper service and providing automatic load balancing to us?

Rahat
asked 3 months ago134 views
1 Answer
0
Accepted Answer

My Bad! I Just forgot about the envoy proxy !

So just leaving the answer here in case it's useful for someone:

Ans1: the /etc/host is mapping the way to the envoy proxy and for each service a entry to /etc/host is created mapping by loop back technique!As the envoy is in the same task!

Ans2: It's the envoy which then communincates and resolves the ip receving the request from the application container! So having only one ip mapping to envoy proxy container makes sense!

Rahat
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions