Skip to content

Commit

Permalink
[release/v1.2] Cherry pick IPv6 support to v1.2.3 (#4819)
Browse files Browse the repository at this point in the history
* xds: use IPv4Compat on ready server (#4798)

Signed-off-by: zirain <[email protected]>
(cherry picked from commit 9f9de74)
Signed-off-by: Huabing Zhao <[email protected]>

* xds: use `::1`  if IPFamily is IPv6 on admin server (#4801)

xds: use  if IPFamily is IPv6

Signed-off-by: zirain <[email protected]>
(cherry picked from commit 17e932c)
Signed-off-by: Huabing Zhao <[email protected]>

* listen on ipv4 addresses by default (#4817)

* listen on `::` if the listener IPFamily is `IPv6` or `DualStack`
* Set `ipv4_compat` to `true` if `IPFamily` is `DualStack`

Signed-off-by: Arko Dasgupta <[email protected]>
(cherry picked from commit d1a8c47)
Signed-off-by: Huabing Zhao <[email protected]>

---------

Signed-off-by: zirain <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Arko Dasgupta <[email protected]>
Co-authored-by: zirain <[email protected]>
Co-authored-by: Arko Dasgupta <[email protected]>
  • Loading branch information
3 people authored Nov 30, 2024
1 parent 2493f6a commit 276fd20
Show file tree
Hide file tree
Showing 511 changed files with 1,567 additions and 741 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ envoyProxyForGatewayClass:
- name: envoy-gateway-proxy-ready-0.0.0.0-19001
address:
socket_address:
address: 0.0.0.0
address: '0.0.0.0'
port_value: 19001
protocol: TCP
filter_chains:
Expand Down Expand Up @@ -891,8 +891,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 10080
defaultFilterChain:
filters:
Expand Down Expand Up @@ -951,8 +950,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 8080
defaultFilterChain:
filters:
Expand Down Expand Up @@ -1019,8 +1017,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 1234
filterChains:
- filters:
Expand Down Expand Up @@ -1059,8 +1056,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 8443
filterChains:
- filterChainMatch:
Expand Down Expand Up @@ -1106,8 +1102,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 1234
protocol: UDP
listenerFilters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,7 @@
],
"address": {
"socketAddress": {
"address": "::",
"ipv4Compat": true,
"address": "0.0.0.0",
"portValue": 10080
}
},
Expand Down Expand Up @@ -729,8 +728,7 @@
],
"address": {
"socketAddress": {
"address": "::",
"ipv4Compat": true,
"address": "0.0.0.0",
"portValue": 8080
}
},
Expand Down Expand Up @@ -835,8 +833,7 @@
],
"address": {
"socketAddress": {
"address": "::",
"ipv4Compat": true,
"address": "0.0.0.0",
"portValue": 1234
}
},
Expand Down Expand Up @@ -901,8 +898,7 @@
],
"address": {
"socketAddress": {
"address": "::",
"ipv4Compat": true,
"address": "0.0.0.0",
"portValue": 8443
}
},
Expand Down Expand Up @@ -980,8 +976,7 @@
],
"address": {
"socketAddress": {
"address": "::",
"ipv4Compat": true,
"address": "0.0.0.0",
"portValue": 1234,
"protocol": "UDP"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 10080
defaultFilterChain:
filters:
Expand Down Expand Up @@ -430,8 +429,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 8080
defaultFilterChain:
filters:
Expand Down Expand Up @@ -498,8 +496,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 1234
filterChains:
- filters:
Expand Down Expand Up @@ -538,8 +535,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 8443
filterChains:
- filterChainMatch:
Expand Down Expand Up @@ -585,8 +581,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 1234
protocol: UDP
listenerFilters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 10080
defaultFilterChain:
filters:
Expand Down Expand Up @@ -80,8 +79,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 8080
defaultFilterChain:
filters:
Expand Down Expand Up @@ -148,8 +146,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 1234
filterChains:
- filters:
Expand Down Expand Up @@ -188,8 +185,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 8443
filterChains:
- filterChainMatch:
Expand Down Expand Up @@ -235,8 +231,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 1234
protocol: UDP
listenerFilters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,7 @@
],
"address": {
"socketAddress": {
"address": "::",
"ipv4Compat": true,
"address": "0.0.0.0",
"portValue": 10080
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 10080
defaultFilterChain:
filters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 10080
defaultFilterChain:
filters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ xds:
path: /dev/stdout
address:
socketAddress:
address: '::'
ipv4Compat: true
address: 0.0.0.0
portValue: 10080
defaultFilterChain:
filters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
2 changes: 1 addition & 1 deletion internal/gatewayapi/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ func getIPFamily(envoyProxy *egv1a1.EnvoyProxy) *ir.IPFamily {
case egv1a1.IPv6:
result = ir.IPv6
case egv1a1.DualStack:
result = ir.Dualstack
result = ir.DualStack
default:
return nil
}
Expand Down
7 changes: 5 additions & 2 deletions internal/gatewayapi/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ func (t *Translator) ProcessListeners(gateways []*GatewayContext, xdsIR resource
continue
}

// EG always use `::` and set ipv4_compact with true to support both IPv4 and IPv6
address := net.IPv6ListenerAddress
address := net.IPv4ListenerAddress
ipFamily := getIPFamily(gateway.envoyProxy)
if ipFamily != nil && (*ipFamily == ir.IPv6 || *ipFamily == ir.DualStack) {
address = net.IPv6ListenerAddress
}

// Add the listener to the Xds IR
servicePort := &protocolPort{protocol: listener.Protocol, port: int32(listener.Port)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down Expand Up @@ -323,7 +323,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: true
Expand Down Expand Up @@ -292,7 +292,7 @@ xdsIR:
text:
- path: /dev/stdout
http:
- address: '::'
- address: 0.0.0.0
hostnames:
- '*'
isHTTP2: false
Expand Down
Loading

0 comments on commit 276fd20

Please sign in to comment.