[NET-10952] fix cluster dns lookup family to gracefully handle ipv6 #21703
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When creating an envoy cluster the default DNS Lookup Family defaults to AUTO, for inter-cluster communication this is not an issue but when creating a cluster that access external sources (like we do for
JWTProviders
) this can cause an issue. TheAUTO
setting prefers usingipv6
, so if a user has a cluster that is not setup to handle ipv6 they will get an ipv6 address back for the external source and will be unable to connect.To handle this we will be using the
V4_PREFERRED
lookup family when STRICT_DNS is enabled (STRICT_DNS
will grab all addresses for the target and attempt to make a host for each and load balance between them).When
LOGICAL_DNS is enabled (
LOGICAL_DNS
will grab all the addresses and only use the first when a new connection is needed) we will use theALL
lookup family, which fetches all the ip addresses for a given hostname and cycles through them to find the first one that is reachable using happy eyeballsIf any other DNS Discovery Type is used we fallback to the default of
AUTO
because envoy ignores the Lookup Family for all other cluster types.Testing & Reproduction
Links
PR Checklist