[ECS Service Connect] [request]: Avoid connection errors in a IPv4-only environment due to unreachable IPv6 endpoint
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
ECS Service Connect uses `/etc/hosts` based DNS resolution to route requests to upstream services. The DNS entries include both a IP V4 and V6 endpoint proactively for dualstack support. In V4-only environments, the V6 endpoint is unreachable and hence the setup relies on client employing happy-eyeballs algorithm to get the request routed via V4 endpoint. This works fine in most cases. However, in client applications like NGINX, this poses a problem where the `/etc/hosts` DNS resolution cannot be made to ignore V6 endpoints and NGINX doesn't retry on the V4 endpoint. This leads to an inability to upstream dependencies when the application container is using NGINX.
**Which service(s) is this request for?**
ECS (Service Connect)
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
Customers using NGINX as their application container as part of a Service Connect setup, cannot seamlessly connect to their upstream dependencies as the V6 endpoint (which is dormant in V4 environments) gets resolved and prevents NGINX from connecting to upstream.
**Are you currently working around this issue?**
There are few options:
* Excessive retrying to make NGINX land on the correct V4 endpoint.
* Using `dnsmasq` as a sidecar where `/etc/hosts` DNS entries can be fed into and V6 endpoints can be subtracted and then NGINX can use dynamic DNS resolution to deterministically resolve V4-only endpoints.
* Using `sed` to alter `/etc/hosts` to remove the V6 endpoint once the Task launches.
Contributor guide
Assessment
This issue has not been assessed yet.