Skip to content

Extend DestinationRule with tunneling settings #2283

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

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

jewertow
Copy link
Member

@jewertow jewertow commented Mar 15, 2022

Signed-off-by: Jacek Ewertowski jewertow@redhat.com

Background context

This change aims to enable tunneling outbound traffic. I described the idea in detail in this RFC.

The API in this pull request differs slightly from that described in the document, but I decided to make it as close to Envoy API as possible. What's more, I didn't mention about field destination_port in the RFC, because I forgot that port matching is optional in a VirtualService configuration, so without explicitly defined destination port it might be not possible to configure TcpProxy.tunneling_config.hostname in some cases.

This API change is related to this pull request: istio/istio#37968.

@istio-policy-bot
Copy link

😊 Welcome @jewertow! This is either your first contribution to the Istio api repo, or it's been
awhile since you've been here.

You can learn more about the Istio working groups, code of conduct, and contributing guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@istio-testing istio-testing added needs-rebase Indicates a PR needs to be rebased before being merged size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test labels Mar 15, 2022
@istio-testing
Copy link
Collaborator

Hi @jewertow. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jewertow jewertow force-pushed the destination-rule-tunneling-api branch from cf83a1f to d7d8f5e Compare March 15, 2022 21:14
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Mar 15, 2022
@ericvn
Copy link

ericvn commented Mar 16, 2022

/ok-to-test

@istio-testing istio-testing added ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-ok-to-test size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 16, 2022
}

// Configuration for tunneling TCP over HTTP.
TunnelingSettings tunneling = 6;
Copy link
Member

@hzxuzhonghu hzxuzhonghu Mar 17, 2022

Choose a reason for hiding this comment

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

same question :

IUUC, hosts will be used as tunneling_config.hostname

  1. Then what if this is wildcard hosts?
  2. What's the expected behavior if dr has subsets

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. That's one of the limitations that I mentioned in the RFC. Tunneling cannot be applied when a hostname contains a wildcard, because it's not possible to determine what hostname should be set in the tunneling_config.hostname. I started to work on setting tunneling_config.hostname automatically based on SNI, but it might work only for TLS connections. It's also important to note that the same limitation applies to virtual services with multiple hostnames. In such a case, it's also not possible to determine which hostname to choose, so the destination rule must be ignored.
  2. Subsets with tunneling settings are handled like any other traffic policy for a subset.

Copy link

Choose a reason for hiding this comment

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

@jewertow should there be some validation defined in DR analyzer to ensure all these limitations? Seems to me this can people into trouble quite easily, it will be super nice to reflect the logic/limitation in a specific filter analyzer.

Copy link
Member Author

Choose a reason for hiding this comment

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

I included relevant validations in Istio. Should it be done somehow in the API repository? Could you share an example of such a validation?

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Mar 18, 2022
Comment on lines 290 to 350
// Specifies whether to use CONNECT or POST http method for the upstream tunnel request.
// If set to true, then POST is used, otherwise CONNECT.
bool use_post = 2;
Copy link
Member

Choose a reason for hiding this comment

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

Not a big fan of use_post as a boolean. What is the default? CONNECT?

I think i prefer a simple method string with CONNECT as the default.

Copy link
Member Author

@jewertow jewertow Mar 21, 2022

Choose a reason for hiding this comment

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

Thank you for your feedback.

At the beginning I assumed that it will be method = CONNECT/POST, but then I thought that probably CONNECT is the most common case, so if it would be a default setting then the tunneling configuration might be less verbose.
What's more, I was considering to make this API as similar to Envoy API as possible, but it seems that it was not the right idea.

What is the default? CONNECT?

Yes, the CONNECT method is used by default.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe not expose to users

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe not expose to users

Since CONNECT is probably the most common use case, it sounds reasonable. We might not expose this setting for now and consider enabling it in the future if necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

@howardjohn @costinm could you share your opinions?

Copy link
Contributor

Choose a reason for hiding this comment

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

string "protocol" ( but we already have that in the Service, so not clear why would we need it in DR as well ).

And we should define some protocol names - I think "hbone" can be the normal CONNECT and the default, and we can use hbone-post and other variants.

I think it is pretty clear that tunneling will not be a boolean, but we may need to support multiple protocols and modes. MASQUE and related standards, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

but we already have that in the Service, so not clear why would we need it in DR as well

In my opinion it would be unclear how to route traffic to a service which has specified a tunnel protocol. Let's say you define a service entry with protocol hbone. Which route type do you use in a virtual service? TCP or TLS? How to determine which one should be matched. I think it's tricky and we can't find an intuitive solution.

I think "hbone" can be the normal CONNECT and the default, and we can use hbone-post and other variants.

In my opinion "hbone" might be confusing and users might have problems to understand what is it and how does it work, because I found only one section in Istio docs with this term, but it's not explained there. I also searched in Google the following terms: "hbone", "hbone connect", "hbone protocol" and I didn't get any related article.
On the other hand, even if we will document in detail what hbone is, we still can't assume that users will find what they need, because it's a new term and I guess that users will search in Google terms like "Istio connect support" or "Istio tunneling" rather than "Istio hbone".

Copy link
Member Author

@jewertow jewertow Mar 31, 2022

Choose a reason for hiding this comment

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

I see another important problem. Relying only on the service protocol would make it possible to tunnel traffic only directly from a sidecar proxy to the forward proxy, and tunneling traffic through a gateway would be impossible, because it requires to route traffic to a gateway and then to the forward proxy. So there are two steps of routing. With the destination rule we are able to choose on which stage to apply tunneling config. On the other hand, when you only have a service protocol, it's not possible to determine when exactly to enable tunneling.

I was investigating how it might be implemented only with service protocol, but there is more problems to identify and discuss. In my opinion it's much more difficult to implement and much less flexible.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about 'h2-connect', 'h2-post' ? BTW, 'hbone' and 'better transport' proposals are inspired from https://datatracker.ietf.org/wg/masque/about/ - we could use 'h2-masque'.

Why would be impossible to tunnel through a gateway ? The same would work, we would set the protocol on the gateway port that supports CONNECT. Same for traffic to another app with a sidecar.

We already rely a lot on Service port identifying the protocol - grpc, tls, h2, http, https, etc.

I was thinking about this a bit more - extending DR with a 'protocol' setting that would override the Service is not
a bad thing, there are cases where the port name/protocol in Service can't be modified ( existing apps installed from helm), or needs to be overridden.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why would be impossible to tunnel through a gateway ?

I assumed that intermediate tunneling between sidecar and egress gateway is undesired, so I didn't consider it. Maybe API would be simpler, but on the other hand the underlying implementation would be unnecessarily complicated.

bool use_post = 2;
}

// Configuration for tunneling TCP over HTTP.
Copy link
Member

Choose a reason for hiding this comment

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

can we add this is for the host configured in the DR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, of course.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@jewertow jewertow force-pushed the destination-rule-tunneling-api branch from 2d3616f to 366b826 Compare March 28, 2022 17:30
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Mar 28, 2022
@@ -340,6 +340,18 @@ message TrafficPolicy {
// overridden by port-level settings, i.e. default values will be applied
// to fields omitted in port-level traffic policies.
repeated PortTrafficPolicy port_level_settings = 5;

message TunnelingSettings {
Copy link
Member

Choose a reason for hiding this comment

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

I definitely agree with the high level goal of improving/enabling tunneling in Istio. However, I want to make sure this aligns with our intentions to use HTTP/2 CONNECT ('bts' or 'hbone') as base line transport protocol in Istio, as well as general plans to improve Egress traffic in Istio. Can you sync up with @lambdai (the first topic) and @costinm (second topic) to make sure these are aligned?

Additionally, it could be useful to compare initiating the tunnel in Envoy vs in the app; most users that are going to use an egress proxy probably already have it when they adopt Istio, so their apps already have HTTP(s)_PROXY configured. AFAIK this is broken with Istio today.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there any RFC about "bts" or "hbone"? I need to know more context and plans for the future to figure out how tunneling fits these plans. I found only this package and this repository, but still don't know how Istio will use these things.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, there is a doc describing "Better Transport Security" - we have been slowly working toward it, the support for CONNECT in Envoy and other changes are in part based on that design.

Support for POST as a fallback is IMO a strong requirement, but I don't think it should be exposed in the API, but be implemented at discovery level, like auto MTLS.

Copy link
Contributor

@costinm costinm left a comment

Choose a reason for hiding this comment

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

I commented on the istio PR as well - I personally don't think we should add this to DestinationRule at all, in particular in context of the BTS/Hbone proposal to have all in-mesh TCP streams use CONNECT.

We already have Auto-MTLS as an example - and we know the UX is far easier and better than
before, user not having to manually configure this each time.

The Service already has protocol - and we use that across Istio to determine how to connect
(h2, grpc, https, etc), it is IMO much better UX to just use discovery information and auto-configure the protocol used to tunnel.

@costinm
Copy link
Contributor

costinm commented Mar 29, 2022

I am also not completely opposed to have something in DestinationRule - if we find some strong use cases where using discovery info is not possible. But I can't think of a use case where we need DR and can't use the Service protocol name.

@jewertow jewertow requested review from linsun and costinm March 31, 2022 13:44
@@ -340,6 +340,19 @@ message TrafficPolicy {
// overridden by port-level settings, i.e. default values will be applied
// to fields omitted in port-level traffic policies.
repeated PortTrafficPolicy port_level_settings = 5;

message TunnelSettings {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we flatten it out ? I don't know if this is exclusive to 'tunnels' - what we would do is use the specified protocol and destination_port to override what the service normally define. It is not specific to egress gateways.

Also not sure if 'which HTTP method' is right - we may want in future to extend this to MASQUE ( over QUIC ), or support HAProxy prefix, or tunnel over WS.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also 'protocol' is typically lowercase, and we may need to be more precise - h2-connect, h2-post, http-connect (http-post is not possible since http/1.1 POST is not bi-directional in most implementations).

Copy link
Member Author

Choose a reason for hiding this comment

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

Used HTTP version depends on the protocol defined in the ServiceEntry configured for a given proxy, so "h2-" and "http-" prefixes can't be used to choose the protocol.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can we flatten it out ? I don't know if this is exclusive to 'tunnels'

If you see other potential use cases for these fields, I'm okay with that.

Copy link
Member Author

@jewertow jewertow Apr 4, 2022

Choose a reason for hiding this comment

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

I was trying to document these fields without the TunnelingSettings wrapper, but then it becomes difficult to specify requirements and semantics clearly. Then configuration lacks the context and validation will be tricky. So after consideration I think it's not worth to flattening these properties.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also not sure if 'which HTTP method' is right - we may want in future to extend this to MASQUE ( over QUIC ), or support HAProxy prefix, or tunnel over WS.

But why to document something that is not implemented? It could be document as well once it's implemented.

@hzxuzhonghu
Copy link
Member

Yes, envoy only supports tunnel config under tcp proxy now.

@hzxuzhonghu
Copy link
Member

cc @lambdai is an expert on this aspect.

@costinm
Copy link
Contributor

costinm commented Apr 8, 2022

Right - and CONNECT is only meant for TCP, plain text HTTP is not supposed to use CONNECT, the proxies will get confused and send it as plain text.

We need to document ( and ensure ) that tunnel DR is only used for TCP ( including HTTPS/TLS), at least until envoy has support for proper HTTP_PROXY.

@jewertow
Copy link
Member Author

jewertow commented Apr 8, 2022

I think we need to figure out what to do about HTTP - because that's clearly going to be broken.

Why? What is going to be broken?

We can't treat HTTP as TCP.

Why? HTTP is built on top of TCP, so what's wrong with it? If you suggest to not support HTTP, because it's not encrypted, we should not support any other non-TLS traffic, but it doesn't make sense, because for plain traffic users can apply TLS origination.

Right - and CONNECT is only meant for TCP, plain text HTTP is not supposed to use CONNECT, the proxies will get confused and send it as plain text.

HTTP is TCP as well, so CONNECT proxy don't care what is this traffic. It accepts HTTP CONNECT, establishes connection and send bytes back and forth. Proxies will not get confused, because it's responsibility is only to forward traffic to a target socket. The whole point of such proxies is to not understand the traffic. So there is no difference in tunneling HTTP or HTTPS.

I really don't understand why to complicate so simple feature. I want to keep it as simple as possible and don't see any benefit in restricting which application protocols might be tunneled. As far as a protocol is TCP, it should be allowed to be tunneled. Restrictions will complicate semantics, implementation and debugging.

@costinm
Copy link
Contributor

costinm commented Apr 8, 2022 via email

@jewertow
Copy link
Member Author

jewertow commented Apr 8, 2022

It seems that I didn't understand what you mean by treating HTTP as TCP and we talk about different things.
I didn't wanted to say that HTTP proxy should be treated as TCP. I was thinking that you mean that outbound HTTP traffic can't be treat as TCP. HTTP proxy obviously shouldn't be treated as TCP service. To avoid misunderstanding please take a look at this pull request: istio/istio#37968. There are examples in the directory tests/integration/pilot/tunneling.

@costinm
Copy link
Contributor

costinm commented Apr 8, 2022 via email

@@ -340,6 +340,26 @@ message TrafficPolicy {
// overridden by port-level settings, i.e. default values will be applied
// to fields omitted in port-level traffic policies.
repeated PortTrafficPolicy port_level_settings = 5;

Copy link
Member

Choose a reason for hiding this comment

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

I mentioned this in the WG meeting but will reiterate it here. I think it's critical we have a strategy planned out for how this relates to user initiated CONNECT; not suggesting implementing that is a blocker but i would like to see some discussion of the long term plans around that so we can guide users, or docs, and our future plans.

Copy link
Member Author

Choose a reason for hiding this comment

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

We (at RedHat) have no other plans related to tunneling or initiating CONNECT requests. I proposed the simplest API I can see. I know that you had other ideas similar to auto-mtls or service protocol, but both have flaws which I explained above. As far as Envoy is not going to provide nor extend its tunneling capabilities, I can't see alternative solutions.

It's important to note that this API does not block you to provide other approach for this problem in the future - as is in case of mTLS which can be applied both with DestinationRule and PeerAuthentication.

@jewertow
Copy link
Member Author

jewertow commented Apr 8, 2022

The examples seem to configure port 8080 as TCP - so a tcp proxy is
created. That's wrong IMO, it means http telemetry and any RBAC in the
egress proxy
that uses http attributes will be gone. It may pass the test, since it's
not including this.

Yes, but for TLS traffic you also can't apply HTTP telemetry, so it's not a matter of whether the traffic is encrypted or not.

On the other hand why do we have to assume that CONNECT proxies must reject not encrypted traffic? It's not the problem of Istio. I don't care how users configure external components.

so a tcp proxy is created. That's wrong IMO

It's not wrong. It's absolutely intentional configuration, because only TcpProxy enables tunneling, so HttpConnectionManager can't be used.

@costinm
Copy link
Contributor

costinm commented Apr 8, 2022 via email

@ramaraochavali
Copy link
Contributor

Copy link
Member

@nrjpoddar nrjpoddar left a comment

Choose a reason for hiding this comment

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

Adding this to DR has few confusing semantics i.e. can you specify all other settings in the TrafficPollcy if you want to use the Tunnel protocol? Settings like TLS, connection level settings and load balancer settings?

Since the tunneling happens over HTTP the VS associated with this should be an HTTP block and the service port prefix of the upstream should be http*, is that correct?

// connect - uses HTTP CONNECT;
// post - uses HTTP POST.
// HTTP version for upstream requests is determined by the service protocol defined for the proxy.
string protocol = 1 [(google.api.field_behavior) = REQUIRED];
Copy link
Member

Choose a reason for hiding this comment

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

Tunneling protocols are much more bounded than application protocols so it made sense to me keep service protocol as string so that we don't change our APIs often. If we expect new tunneling protocols to be supported by Envoy very frequently then I can understand keeping this as string else I would prefer a ENUM here.

@costinm
Copy link
Contributor

costinm commented Apr 11, 2022 via email

@jewertow
Copy link
Member Author

Adding this to DR has few confusing semantics i.e. can you specify all other settings in the TrafficPollcy if you want to use the Tunnel protocol? Settings like TLS, connection level settings and load balancer settings?

@nrjpoddar I don't know what's confusing in your opinion. tunnel is just another field like the others.

Since the tunneling happens over HTTP the VS associated with this should be an HTTP block and the service port prefix of the upstream should be http*, is that correct?

There is tcp block, because it's tunneling TCP over HTTP, so TcpProxy is needed.

@jewertow
Copy link
Member Author

We need to stop inventing weird protocols and follow the standards.

I don't know what's weird for you. It's as simple as possible. If you don't agree to support plain TCP traffic, let's support at least TLS traffic.

The main purpose of this PR is to provide API which enable users to eliminate configuring HTTP proxies in their apps by setting envs like HTTP_PROXY or properties like java -Dhttps.proxyHost=host -Dhttps.proxyPort=port.
If "tunneling API" is too broad topic and you have other plans that conflict with this use case and submitted API, what do you think to change it to HttpsProxy and keep it simple and support only TLS?

@costinm
Copy link
Contributor

costinm commented Apr 11, 2022 via email

@jewertow
Copy link
Member Author

But setting HTTP_PROXY is NOT using CONNECT, and all HTTP proxies implement the RFC

I tested multiple commonly used HTTP tools and libraries (Java, NodeJS, curl...) and all of them use HTTP CONNECT when HTTP proxy is configured, so I don't understand why you still say that it's weird protocol and why you suggest that proxies does not support it. I also inspected the traffic with Wireshark and it works as expected.

Could you share the RFC which you are referring to?
I read the following RFCs:

and I can't see there any information about absolute URL which you talk about. Both these RFCs says that tunnel should be established with the following request

     CONNECT server.example.com:80 HTTP/1.1
     Host: server.example.com:80

and it makes sense, because the absolute URL that you want connect to will be sent once the connection is established.

@costinm
Copy link
Contributor

costinm commented Apr 12, 2022 via email

@jewertow
Copy link
Member Author

Ok, now I understand what you mean and you're right that setting HTTP or HTTPS proxies in most clients don't use HTTP CONNECT for HTTP connection initiated by a client, but for TLS connections proxies use HTTP CONNECT.
I misunderstood your comment and I thought you mean that setting HTTP/HTTPS proxies in clients does not use CONNECT at all.

I think we look at this feature from completely different perspectives.
You are focused on that this is supposed to be a typical web/HTTP proxy (in the RFC called "proxy"). In that case your thoughts about forwarding HTTP would be absolutely correct and reasonable.
But this PR aims to enable integration with tunnel proxies (in the RFC called "tunnel").
Look at section "2.3. Intermediaries":

   A "tunnel" acts as a blind relay between two connections without
   changing the messages.  Once active, a tunnel is not considered a
   party to the HTTP communication, though the tunnel might have been
   initiated by an HTTP request.

and then at section "2.6. Protocol Versioning":

   Intermediaries that process HTTP messages (i.e., all intermediaries
   other than those acting as tunnels) MUST send their own HTTP-version
   in forwarded messages.

As you can see there is no information how tunnel proxies have to treat HTTP requests, because their purpose is to be blind, to not process received messages and just establish TCP connection between a client and an origin server.
So I think that this PR is compatible with the RFC you are referring to.

As far as this API is named TunnelSettings there should be no confusion why the connection is not initiated as typical HTTP clients which support HTTP_PROXY (or similar) settings.
I would like to cancel the previous idea to name it HttpProxy or HttpsProxy - it was not well thought out.

@costinm
Copy link
Contributor

costinm commented Apr 13, 2022 via email

@jewertow
Copy link
Member Author

jewertow commented Apr 15, 2022

we find some non-Istio proxies that support this and don't get confused

Do you mean to ensure which proxies would it work with? I was testing it mostly with Envoy and there are no restrictions. I was also using squid and nginx with proxy_connect module. I could also test it with apache http.

It's definitely possible to support HTTP port without changing anything in Envoy, but it's much more complex solution. I was testing redirecting traffic from HttpConnectionManager to a TcpProxy listening on unix domain socket and it worked fine.

So what do you think to start with support only for TLS traffic and then investigate support for plain TCP and HTTP in another pull request? Tunneling TLS is the most important case and I don't want to block it with discussions about plain HTTP.

Edit:
I want to note that the current implementation supports HTTP telemetry for HTTP routes with TLS origination, so I think that there is no reason to block support for plain HTTP. The only case that is not cover yet is tunneling plain HTTP traffic to an HTTP port, but it might be done in the future. I don't want to block this feature just because of just one case which might be implemented later.

I also want to remember once again why both target_host and target_port are necessary:

  • without target_host we couldn't apply the destination rule to a virtual service which has more than one host or a host including a wildcard, because then we couldn't determine the target host;
  • without target_port we couldn't apply the destination rule to a virtual service which has no matching rule for a port.

So at the first glance it might seem that specifying these properties is redundant, but because of them there are no limitations for a related virtual service.

@costinm
Copy link
Contributor

costinm commented Apr 18, 2022 via email


// Configuration of tunneling TCP over other transport or application layers
// for the host configured in the DestinationRule.
// Tunnel settings can be applied to TCP or TLS routes and can't be applied to HTTP routes.
Copy link
Member Author

Choose a reason for hiding this comment

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

I will remove this note once I submit support for HTTP routes.

@jewertow jewertow force-pushed the destination-rule-tunneling-api branch from 47c5a20 to 362698b Compare April 19, 2022 13:32
string target_host = 2 [(google.api.field_behavior) = REQUIRED];

// Specifies a port to which the downstream connection is tunneled.
uint32 target_port = 3 [(google.api.field_behavior) = REQUIRED];
Copy link
Contributor

Choose a reason for hiding this comment

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

I know we traditionally have done things this way, but virtually everyone is using hostnames:port or URLs, there is no need to be so verbose and ask the user to act as a URL parser. Why not:

// Specify the host to which connection is tunneled, as host:port or host or URL
string target

HTTPS_PROXY is a host:port.

I know using URL is controversial in Istio for some reason, so treat this as a rant, not blocking.

Copy link
Member Author

Choose a reason for hiding this comment

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

To be honest, it completely doesn't matter for me. So I would like to know the opinion of API maintainers.
What do you think @linsun?

Copy link
Member

@linsun linsun Apr 20, 2022

Choose a reason for hiding this comment

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

I think targetHost and targetPort is pretty simple for user to use, i could be convinced to use below but also felt targetHost and targetPort offers more clarity.

target: {host:port}

string protocol = 1 [(google.api.field_behavior) = REQUIRED];

// Specifies a host to which the downstream connection is tunneled.
// Target host must be an FQDN.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not IP ? HTTPS_PROXY does allow this, and it is common to not have a DNS name for proxies (many times
they are used over VPN or hosts where the DNS resolver is hard to change, since setting the proxy can be done by non-root users).

Copy link
Member Author

Choose a reason for hiding this comment

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

That's true, thanks. I just forgot to mention about it. I added this information and pushed new commit.

TunnelSettings enables tunneling TCP traffic over other transport or application layers.
Istio will initially support tunneling TCP over HTTP or H2 using CONNECT or POST methods,
but the supported protocols list might be extended in the future.
At the beginning tunnel settings will be applicable to TCP or TLS routes only,
but support for HTTP routes is also on the roadmap.

Signed-off-by: Jacek Ewertowski <jewertow@redhat.com>
@jewertow jewertow force-pushed the destination-rule-tunneling-api branch from 362698b to 793b356 Compare April 19, 2022 15:48
Copy link
Member

@linsun linsun left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you @jewertow for your hard work on this!

@istio-testing istio-testing merged commit b6a03a9 into istio:master Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.