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
질문됨 4달 전141회 조회
1개 답변
0
수락된 답변

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
답변함 4달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠