-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add a transport socket match in cluster. #8100
Conversation
Signed-off-by: Jianfei Hu <jianfeih@google.com>
I'm generally opposed to using unstructured metadata for this purpose. If we are going to go down this path (see above comment about needing to understand design rationale and motivation), then we need to add an explicit label field to EDS endpoints. |
@incfly FYI, for changes to Envoy's APIs, you should tag @envoyproxy/api-shepherds on any design review. |
So @htuch , how about this:
effectively, we ship a bunch of named TLS contexts to the cluster and then in the EDS, we can ship the TLS context to use for a given endpoint. This has the same effect of using label selectors in the TLS context. |
@rshriram lets iterate on the doc a bit more, I like labels more for its flexibility, a tlscontextmap (or transport socket map) potentially explodes when you have multiple factor to select. (supports mTLS/TLS/cleartext) |
@lizan not sure if I get it. The value of the By |
Signed-off-by: Jianfei Hu <jianfeih@google.com>
@@ -74,6 +80,8 @@ message LbEndpoint { | |||
// to subset the endpoints considered in cluster load balancing. | |||
core.Metadata metadata = 3; | |||
|
|||
repeated Label labels = 6; |
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.
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.
So @htuch / @lizan I have been giving this some thought. I think its better to have a named TLS context rather than a label selector because named TLS contexts refer to exactly one context to use. Label selectors could select multiple contexts and then we would have to define some first match wins semantics which gets clunky.
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'd like to this be first match wins (similar to FCM), the context map couples EDS with CDS too tightly, and the matcher semantics here is more flexible to match a subset has two labels etc.
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.
Yeah, let's just have a string
field here pointing at a specific TLS context. This will be the clearest I reckon.
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 fine with that.
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.
done.
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.
Switching back into this review after some time out, it seems that we still have a label match scheme. If the consensus is heading towards this being necessary, there are two things I'd ask:
- Document a clear use case of why we have this in
endpoint_transport_socket_matchers
comments. - Use the existing
metadata
; I originally pushed back on this as I felt we could just specify a transport socket name here, but now that we are going to a "label" scheme, we already have a source of this information, the endpoint metadata. There should be well-known key name for this,envoy.transport_socket
.
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.
Signed-off-by: Jianfei Hu <jianfeih@google.com>
Signed-off-by: Jianfei Hu <jianfeih@google.com>
Signed-off-by: Jianfei Hu <jianfeih@google.com>
…nsport-socket-matcher Signed-off-by: Jianfei Hu <jianfeih@google.com>
ping. any updates? Its been two weeks. |
Signed-off-by: Jianfei Hu <jianfeih@google.com>
…nsport-socket-matcher Signed-off-by: Jianfei Hu <jianfeih@google.com>
Signed-off-by: Jianfei Hu <jianfeih@google.com>
/retest |
🔨 rebuilding |
Signed-off-by: Jianfei Hu <jianfeih@google.com>
Signed-off-by: Jianfei Hu <jianfeih@google.com>
Signed-off-by: Jianfei Hu <jianfeih@google.com>
Signed-off-by: Jianfei Hu <jianfeih@google.com>
…nsport-socket-matcher Signed-off-by: Jianfei Hu <jianfeih@google.com>
/retest |
🐴 hold your horses - no failures detected, yet. |
All tests passed now, PTAL, thanks. |
api/envoy/api/v2/cds.proto
Outdated
// Optional endpoint metadata match criteria. | ||
// The connection to the endpoint with metadata matching what is set in this field | ||
// will use the transport socket configuration specified here. | ||
// The endpoints metadata entry in *envoy.transport_socket* is used to match |
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 reading well_known_names.h
, and see we already have envoy.transport_sockets.xxx (alts)
for socket name, this makes me think using envoy.transport_socket
to extract endpoint info can cause confusion.
https://github.com/envoyproxy/envoy/blob/master/source/extensions/transport_sockets/well_known_names.h#L17
how about renaming this to envoy.transport_socket_match
or envoy.transport_socket_selector
?
wdty?
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.
Thanks, generally LGTM with a few small comments.
/wait
Signed-off-by: Jianfei Hu <jianfeih@google.com>
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.
Thanks this LGTM. I will defer to others for further review.
Signed-off-by: Jianfei Hu <jianfeih@google.com>
@htuch Could you take a look to see anything else we need to update before merging? |
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.
Thanks, the explanation is now more helpful. LGTM modulo nit and merging master.
Signed-off-by: Jianfei Hu <jianfeih@google.com>
…nsport-socket-matcher Signed-off-by: Jianfei Hu <jianfeih@google.com>
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.
Thanks!
API for envoyproxy#8016 Customers adopting service mesh likes mTLS ability. However, rolling it out without breaking existing traffic is hard. This is because mTLS is configured on per cluster basis. In reality, a service consists of multiple endpoints, mixed with having Envoy sidecar and without-sidecar endpoints. Client envoy can't send mTLS traffic until all server migrated to having Envoy sidecar. This API tries to solve the issue by allowing mTLS/transport socket to configured at finer granularity, e.g. endpoint level. The endpoint has metadata label information, which will be used to decide which transport socket configuration to use from a map specified in the cluster. So the outcome is that, xDS management server is able to configure client envoy talks to endpoints with sidecar in mTLS and plain text to endpoints without sidecar, for a single cluster. Description: Risk Level: N/A (API change only) Release Notes: Cluster API change to use different transport socket based on endpoint label. Signed-off-by: Jianfei Hu <jianfeih@google.com>
envoyproxy#8309 and envoyproxy#8100 collided Risk Level: Low (cleanup) Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Jianfei Hu jianfeih@google.com
API for #8016
Context
Customers adopting service mesh likes mTLS ability. However, rolling it out without breaking existing traffic is hard. This is because mTLS is configured on per cluster basis. In reality, a service consists of multiple endpoints, mixed with having Envoy sidecar and without-sidecar endpoints. Client envoy can't send mTLS traffic until all server migrated to having Envoy sidecar.
This API tries to solve the issue by allowing mTLS/transport socket to configured at finer granularity, e.g. endpoint level. The endpoint has metadata label information, which will be used to decide which transport socket configuration to use from a map specified in the cluster.
So the outcome is that, xDS management server is able to configure client envoy talks to endpoints with sidecar in mTLS and plain text to endpoints without sidecar, for a single cluster.
Description:
Risk Level: N/A (API change only)
Release Notes: Cluster API change to use different transport socket based on endpoint label.