fix: listener on IPv6 first cluster#4573
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4573 +/- ##
==========================================
+ Coverage 65.50% 65.54% +0.04%
==========================================
Files 211 212 +1
Lines 31945 31988 +43
==========================================
+ Hits 20925 20967 +42
- Misses 9774 9777 +3
+ Partials 1246 1244 -2 ☔ View full report in Codecov by Sentry. |
00e8a5c to
c266511
Compare
There was a problem hiding this comment.
this may not right, what about change it to localhost? cc @arkodg @zhaohuabing
There was a problem hiding this comment.
+1 localhost make things easier
internal/utils/net/ip.go
Outdated
There was a problem hiding this comment.
To align with the IPFamily API docs, EG should default to IPv4.
// IPFamily specifies the IP family for the EnvoyProxy fleet.
// This setting only affects the Gateway listener port and does not impact
// other aspects of the Envoy proxy configuration.
// If not specified, the system will operate as follows:
// - It defaults to IPv4 only.
// - IPv6 and dual-stack environments are not supported in this default configuration.
// Note: To enable IPv6 or dual-stack functionality, explicit configuration is required.
// +kubebuilder:validation:Enum=IPv4;IPv6;DualStack
// +optional
IPFamily *IPFamily `json:"ipFamily,omitempty"`
Or do we want to change to:
Default to the IP family of the POD IP of the Envoy Proxy/Envoy Gateway?
This would have EG attempt to infer user's intented IP Family for the listening port of the Envoy proxy, which might not always be accurate.
Should we always default to IPv4 and require users to explicitly specify IPv6 if desired? It will make the IPFamily choice more explicit.
There was a problem hiding this comment.
Should we always default to IPv4 and require users to explicitly specify IPv6 if desired? It will make the IPFamily choice more explicit.
this will make it's hard to use on IPv6 first cluster.
There was a problem hiding this comment.
Yes, this approach requires one more IPFamily setting for users who want to use IPv6.
But if we make it implicit, "Default to the IP family of the POD IP of the Envoy Proxy/Envoy Gateway" may be challenging to clearly explain in the EG doc.
internal/xds/translator/listener.go
Outdated
There was a problem hiding this comment.
why does this function need to change ?
There was a problem hiding this comment.
Before this function change socketAddress and return additionalAddress in the same time.
internal/xds/bootstrap/bootstrap.go
Outdated
There was a problem hiding this comment.
return error malformed IP address: localhost
internal/xds/bootstrap/bootstrap.go
Outdated
There was a problem hiding this comment.
imo just the changes in this file should be enough to support pure IPv6 case as well as dual stack case, wdyt
There was a problem hiding this comment.
need changes around dynamic istener for IPv6 first/pure cluster.
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
fix: #4565
xref: #4572
Separate from : #4550
::instead of0.0.0.0when IPv6 first.