-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Labels
area/clusterenhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.stalestalebot believes this issue/PR has not been touched recentlystalebot believes this issue/PR has not been touched recently
Description
As @mattklein123 said at #16123 (comment) the issue #16123 can be separated into two parts: upstream and downstream.
The downstream part is about Support multiple addresses in the listener
#11184, and it is under review.
So it is time to look at the upstream part.
A little background here:
With multiple addresses in listener
, it gets rid of the duplicated listeners. but since people want to choose endpoint smartly (ipv4 request choose ipv4 endpoint, ipv6 request choose ipv6 endpoint), still have to add duplicated config.
- One way is using two duplicated filter chains to choose two duplicated clusters.
- Another way is using the endpoint metadata to get rid of the duplicated clusters, it is a little improved but still, has two duplicated filter chains. The example config can be referenced here listener: support multiple addresses #19367 (comment)
So I'm thinking there need three things to reach the final goal:
- Choose a correct endpoint
This still can base on the endpoint metadata, but it needs to set the different metadata based on the downstream connection's IP version automatically. We can extend the HTTPSet-Metadata filter
https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/set_metadata/v3/set_metadata.proto to support converting some variables (the variables like this https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/headers#custom-request-response-headers) to the metadata. Like a new%IPVERSION%
variable, then convert that variable to specific metadata. (maybe add a network filter also to support the TCP use case) - Choose a correct upstream local address
Since Istio using theupstream_bind_config
in Cluster (https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#envoy-v3-api-msg-config-core-v3-bindconfig) to set the upstream local address as 127.0.0.6 for the connection to the App, it will do the same thing for the IPv6 also. So we also need a way to choose the correct upstream local address. We can implement this by adding a new policy to theupstream_bind_config
, allowing the binding of different local addresses based on the IP version. - Choose a correct endpoint for the dynamic proxy case or use the DNS name for the endpoint address.
I think this can be done by theHappyEyeballConnection
. Thedns_lookup_family
will be set asALL
as theHappyEyeballConnection
requirement https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto#envoy-v3-api-enum-config-cluster-v3-cluster-dnslookupfamily
TheHappyEyeballConnection
will get both ipv4 and ipv6 addresses from the DNS, then we can add a new policy to allow it to choose the address based on the downstream IP version.
And this PR is on my radar Add a connection provider to happy eyeball connection implementation and split it into a new class for broader use cases #21539, we can a new connection provider for it.
Appreciate any feedback and comments on this, let me know whether those proposals are enough for this use-case and correct for this usecase!
Metadata
Metadata
Assignees
Labels
area/clusterenhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.stalestalebot believes this issue/PR has not been touched recentlystalebot believes this issue/PR has not been touched recently