-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Consul Connect over IPv6 (except tproxy) #24203
Conversation
specifically service.connect.sidecar_proxy.config.bind_address so that "::" can be passed in, for example, for ipv6, or "" to allow consul proxy-defaults to set it to anything else.
"bind_port": 42, | ||
"envoy_stats_tags": []string{"nomad.alloc_id=test_alloc1b"}, | ||
}, connectProxyConfig(map[string]interface{}{ | ||
"bind_address": "anything", |
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.
This kind of invalid input just blows up downstream, right?
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.
Yes, with this "anything" for example, the sidecar logs will show envoy squawking like
[2024-10-14 20:36:19.901][1][warning][config] [source/extensions/config_subscription/grpc/delta_subscription_state.cc:269] delta config for type.googleapis.com/envoy.config.listener.v3.Listener rejected: Error adding/updating listener(s) public_listener:anything:28417: malformed IP address: anything
[2024-10-14 20:36:19.901][1][warning][config] [source/extensions/config_subscription/grpc/grpc_subscription_impl.cc:138] gRPC config for type.googleapis.com/envoy.config.listener.v3.Listener rejected: Error adding/updating listener(s) public_listener:anything:28417: malformed IP address: anything
It will continue running, but the "Connect Sidecar Listening" health check fails.
So maybe it doesn't quite "blow up" but it's not too hard to track down.
Mostly resolves #7905 -- #23882 introduced IPv6 support to Nomad's "bridge" network mode, and this extends that to Consul Connect (which also requires "bridge" mode). I say "mostly" because Transparent Proxy still does not work (the Consul CNI plugin does not do any
ip6tables
at the moment for its extra functionality).Along the way, I found that since we were always setting Connect/Envoy's
bind_address
to"0.0.0.0"
, the user couldn't pick anything else (like I had tried"::"
). In particular, even with this PR auto-detecting IPv6, I imagine a user might like to set it to""
(empty), so that Consulproxy-defaults
config can come into play. I did not add a config option for the client along these lines, but an individual job could set it like so:Or set it to whatever they may like.
My preferred way to replicate the behavior is (on a host/network with ipv6 support), enable ipv6 on the Nomad bridge and prefer ipv6 for services on a client (per #23388):
Consul can run in dev mode.
consul agent -dev
Then use the basic countdash example:
example.nomad.hcl
The alloc and service addresses will be ipv6, health checks pass, and the counter counts.