New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xds: only try to create an ipv6 expose checks listener if ipv6 is supported by the kernel #9765
Conversation
…ported by the kernel
🤔 Double check that this PR does not require a changelog entry in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
&envoycore.CidrRange{AddressPrefix: advertise, PrefixLen: &wrappers.UInt32Value{Value: uint32(advertiseLen)}}, | ||
) | ||
|
||
if ok, err := kernelSupportsIPv6(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rboyer and I had a chat about testing; it's kind of thorny. Mocking this gets us into trouble with parallel unit tests, as we risk changing an invariant under other tests noses.
checks = [ | ||
{ | ||
name = "http" | ||
http = "http://127.0.0.1:8181/debug" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fake workloads are usually copies of fortio
which has a webserver builtin. One of the pages is /debug
so that'll 200, hence why it's used here as the healthcheck standin.
|
||
function get_envoy_expose_checks_listener_once { | ||
local HOSTPORT=$1 | ||
run curl -s -f $HOSTPORT/config_dump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Captured output from a run:
{
"configs": [
{
"@type": "type.googleapis.com/envoy.admin.v3.BootstrapConfigDump",
...snip...
},
{
"@type": "type.googleapis.com/envoy.admin.v3.ClustersConfigDump",
...snip...
},
{
"@type": "type.googleapis.com/envoy.admin.v3.ListenersConfigDump",
"version_info": "00000001",
"dynamic_listeners": [
{
"name": "public_listener:0.0.0.0:21001",
...snip...
},
{
"name": "exposed_path_debug:0.0.0.0:21500",
"active_state": {
"version_info": "00000001",
"listener": {
"@type": "type.googleapis.com/envoy.api.v2.Listener",
"name": "exposed_path_debug:0.0.0.0:21500",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 21500
}
},
"filter_chains": [
{
"filter_chain_match": {
"source_prefix_ranges": [
{
"address_prefix": "127.0.0.1",
"prefix_len": 8
},
{
"address_prefix": "127.0.0.1",
"prefix_len": 32
},
{
"address_prefix": "::1",
"prefix_len": 128
}
]
},
"filters": [
{
"name": "envoy.http_connection_manager",
"config": {
"http_filters": [
{
"name": "envoy.router"
}
],
"stat_prefix": "exposed_path_filter_debug_21500",
"route_config": {
"name": "exposed_path_filter_debug_21500",
"virtual_hosts": [
{
"routes": [
{
"route": {
"cluster": "local_app"
},
"match": {
"path": "/debug"
}
}
],
"domains": [
"*"
],
"name": "exposed_path_filter_debug_21500"
}
]
},
"tracing": {
"random_sampling": {}
}
}
}
]
}
]
},
"last_updated": "2021-02-17T19:32:31.547Z"
}
}
]
},
{
"@type": "type.googleapis.com/envoy.admin.v3.ScopedRoutesConfigDump"
},
{
"@type": "type.googleapis.com/envoy.admin.v3.RoutesConfigDump",
...snip...
},
{
"@type": "type.googleapis.com/envoy.admin.v3.SecretsConfigDump"
}
]
}
05fea06
to
564eb23
Compare
🍒 If backport labels were added before merging, cherry-picking will start automatically. To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/329704. |
🍒✅ Cherry pick of commit 39effd6 onto |
…ported by the kernel 1.8.x backport of #9765 Conflicts: - agent/xds/listeners_test.go - test/integration/connect/envoy/helpers.bash - agent/xds/testdata (different envoy versions)
…ported by the kernel 1.7.x backport of #9765 (based on the 1.8.x backport) Conflicts: - agent/xds/listeners_test.go - test/integration/connect/envoy/helpers.bash - agent/xds/testdata (different envoy versions than even the 1.8.x backport)
Fixes #9311
This only fails if the kernel has ipv6 hard-disabled. It is not sufficient to merely not provide an ipv6 address for a network interface. For local testing I disabled it in grub on an ubuntu linux VM first.
Then register a service with connect locally with a config file like:
Then try launching the sidecar and grep the envoy logs for the word
expose
TODO