Skip to content

tcp: proxying TCP over HTTP/2 to upstreams#10162

Merged
alyssawilk merged 7 commits intoenvoyproxy:masterfrom
alyssawilk:shinkansen_tcp
Mar 16, 2020
Merged

tcp: proxying TCP over HTTP/2 to upstreams#10162
alyssawilk merged 7 commits intoenvoyproxy:masterfrom
alyssawilk:shinkansen_tcp

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk commented Feb 25, 2020

The first half of proxying TCP over HTTP/1, sending the TCP over an HTTP connection.

Risk Level: Low (new code config guarded, minor TCP proxy refactors)
Testing: new integration tests, unit tests
Docs Changes: n/a (will land docs when the other half makes it usable)
Release Notes: n/a
Part of #1630

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #10162 was opened by alyssawilk.

see: more, trace.

@zuercher
Copy link
Copy Markdown
Member

That seems like the right shape to me.

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk
Copy link
Copy Markdown
Contributor Author

ping!

Copy link
Copy Markdown
Member

@zuercher zuercher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One little thing, but otherwise looks great.

auto* filter_chain = listener->add_filter_chains();
auto* filter = filter_chain->add_filters();
filter->mutable_typed_config()->PackFrom(proxy_config);
filter->set_name("envoy.tcp_proxy");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the new name: envoy.filters.network.tcp_proxy.

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk
Copy link
Copy Markdown
Contributor Author

@mattklein123 can you take a look, esp for API sign off?
per earlier discussion I think that proxy proto config could slide right into tunneling config once I get to that bit.

@mattklein123
Copy link
Copy Markdown
Member

Yup will do today.

zuercher
zuercher previously approved these changes Mar 11, 2020
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! I just reviewed the API and skimmed the rest of it. Just a few small API comments. Thank you!

/wait

Comment on lines +111 to +113
// Configuration for tunneling TCP over other transports or application layers.
// Currently, only HTTP/2 is supported. When other options exist, HTTP/2 will
// remain the default.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we future proof this by having a oneof that specifies a required protocol type, with the only type currently supported being something like Http2TunnelConfig or something like that? Then hostname can be embedded in that message. This will future proof adding additional protocols in the future if needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTP/1.1 and HTTP/3 would both benefit from a configured as well, so I think it's orthogonal of transports for the forseeable future and the current structure makes sense. Happy to move if you have thoughts of other things we want to tunnel over

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's up to you, but if you think there will be non-HTTP transports in the future, you might still consider the structure I suggested, and just call the current option HttpTunnelConfig.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know of any, so I'd prefer to avoid the layer of indirection and risk the deprecation dance if you're OK either way. If you have a preference it's not like it'll take more than 2 minutes though, so just let me know :-)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, what I'm suggesting will avoid deprecation in the future, at the expense of a layer of indirection. I don't feel strongly about it so up to you.

// limited to 1.
repeated type.HashPolicy hash_policy = 11 [(validate.rules).repeated = {max_items: 1}];

TunnelingConfig tunneling_config = 12;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add docs here, mainly saying what the default is if nothing is specified?

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM unless you want to change the API structure per comments.

@alyssawilk alyssawilk merged commit 213d09d into envoyproxy:master Mar 16, 2020
@alyssawilk alyssawilk deleted the shinkansen_tcp branch August 27, 2020 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants