-
Notifications
You must be signed in to change notification settings - Fork 687
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
[v3.0] add downstream support for HTTP/3 #4246
Conversation
266c19f
to
2c1bcd3
Compare
@AliceProxy @LukeShu - This PR is based off from #4241 so you can ignore the first commits because they are being reviewed as part of that PR. You can start your review at commit: 2c1bcd3 I will rebase on the upgrade once merged, update the |
1acd6a3
to
fbe7848
Compare
Whoops, good catch. I was rebasing it off from |
6dd6f59
to
03a6936
Compare
03a6936
to
d957785
Compare
d957785
to
ddb6883
Compare
6ea9839
to
425f67b
Compare
4bd822d
to
f92fd05
Compare
f92fd05
to
b976480
Compare
That protocol stack doesn't make sense to me. Shouldn't that be Edit: Nope, |
I'm not sure how I feel about magically associating 2 listeners together if they have matching |
PS: e2e tests would be good too, since this is a very integration-y problem space. |
On the other hand, I do think that I like having a 2nd listener better than packing 2 ports in to 1 listener. |
You know what, I'm prepared to call any weird listener-host binding behavior at this point a bug. So fine for v0, and we can break it later because it was always a bug. |
python/ambassador/ir/ir.py
Outdated
@@ -271,8 +271,6 @@ def __init__(self, aconf: Config, | |||
self.groups = {} | |||
self.grpc_services = {} | |||
self.hosts = {} | |||
# self.invalidate_groups_for is handled above. | |||
# self.k8s_status_updates is handled below. |
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.
Why?
python/ambassador/ir/ir.py
Outdated
self.post_error("Duplicate listener %s on %s:%d; keeping definition from %s" % | ||
(listener.name, listener.bind_address, listener.port, extant_listener.location)) | ||
err_msg = f"Duplicate listener {listener.name} on {listener.socket_protocol.lower()}://{listener.bind_address}:{listener.port};" \ | ||
f"; keeping definition from {extant_listener.location}" |
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 duplicates the ;
in the error message, doesn't it?
"udp_listener_config": {}, | ||
"filter_chains": self._filter_chains, | ||
"traffic_direction": self.traffic_direction | ||
} | ||
|
||
if self.isProtocolUDP(): | ||
listener['udp_listener_config'] = { | ||
'quic_options': {}, | ||
'downstream_socket_config': { 'prefer_gro': True } | ||
} | ||
else: | ||
del(listener['udp_listener_config']) | ||
|
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.
I'm not sure what's to like with this pattern of "initialize with a bogus value, then either overwrite with a valid value or remove it". Why not drop the initial value and drop the else
case?
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.
agree that is cleaner
Oh! This needs a releaseNotes entry. |
The initial implemenation of HTTP/3 support provides downstream connectivity between client (browser, curl, langs) and Emissary-Ingress. - adds default `alt-svc` to TCP connection if bound address and port are shared between TCP and UDP. - ensures UDP Listener is only created when a TLS Context or fallback context is provided Two things that are not supported with this change: - raw UDP support is NOT added and will be an error - upstream (emissary-ingress and service) HTTP/3 support is NOT added Adds unit test coverage for the following scenarios: - valid http3 listener - TCP/UDP listener bound to same address:port and auto-inject http/3 bits into TCP Listener - drop udp listener missing required TLS Context for http/3 Signed-off-by: Lance Austin <[email protected]>
b976480
to
6e6f71b
Compare
Description
This PR adds downstream support for HTTP/3 and is able to take advantage of the current developer experience by using the
protocolStack
field of theListener
CRD.HTTP/2 and HTTP/1 traffic will continue to be served using a TCP Listener configured for HTTP and now a second Listener configured for HTTP/3 can be done by setting the
protocalStack: [ "TLS", "HTTP", "UDP"]
on a Listener and binding to the same address:port as the TCP ListenerWhen a TCP Listener binds to the same address and port as the UDP Listener then it will inject the
alt-svc
header into the responses returned on the TCP Listener. This header advertises HTTP/3 support to the client and tells the client how to upgrade itself to http/3.NOTE - the alt-svc header is not configurable for the initial release but in the future we should make it available to the user
Related Issues
None
Testing
Deployed to multiple clusters and tested setting up in AKS, EKS and GKE.
Checklist
CHANGELOG.md
.It is a new feature and most of the heavy lifting is done in Envoy. Also, fallback to http/2 and http/1.1 is still possible. One potential thing we will need to keep an eye is that the routes are duplicated on both the TCP and UDP listeners. The UDP listener was able to exclude the http (non-tls) redirect routes due to QUIC requiring TLS so its not an exact duplication.
DEVELOPING.md