cds: Add "auto_http2" option. (#399)

Currently clusters can not open both HTTP1.1 and HTTP2 upstream
connections at the same time.  When the new cluster option
"auto_http2" is set to "true", the cluster must open an HTTP2 upstream
connection if the downstream connection is HTTP2, and an HTTP1.1
upstream connection if the downstream connection is HTTP1.1. This option
is to have no effect if there is no corresponding downstream
connection.

This functionality removes the need to operate multiple clusters and
routing rules for them when the backends accept both HTTP1.1 and HTTP2
connections, and when the choice of the HTTP protocol is significant,
as with gRPC.

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
pull/408/head
jrajahalme 7 years ago committed by Matt Klein
parent daff1e1514
commit a4b80d6c43
  1. 18
      api/cds.proto

@ -162,9 +162,7 @@ message Cluster {
// verification.
UpstreamTlsContext tls_context = 11;
oneof protocol_options {
// [#not-implemented-hide:]
TcpProtocolOptions tcp_protocol_options = 12;
reserved 12;
// Additional options when handling HTTP1 requests.
Http1ProtocolOptions http_protocol_options = 13;
@ -177,9 +175,7 @@ message Cluster {
// connections to happen over plain text.
Http2ProtocolOptions http2_protocol_options = 14;
// [#not-implemented-hide:]
GrpcProtocolOptions grpc_protocol_options = 15;
}
reserved 15;
// If the DNS refresh rate is specified and the cluster type is either
// :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>`,
@ -418,6 +414,16 @@ message Cluster {
// For instance, if the metadata is intended for the Router filter, the filter
// name should be specified as *envoy.router*.
Metadata metadata = 25;
enum ClusterProtocolSelection {
// Cluster can only operate on one of the possible upstream protocols (HTTP1.1, HTTP2).
// If :ref:`http2_protocol_options <envoy_api_field_Cluster.http2_protocol_options>` are
// present, HTTP2 will be used, otherwise HTTP1.1 will be used.
USE_CONFIGURED_PROTOCOL = 0;
// Use HTTP1.1 or HTTP2, depending on which one is used on the downstream connection.
USE_DOWNSTREAM_PROTOCOL = 1;
}
ClusterProtocolSelection protocol_selection = 26;
}
// An extensible structure containing the address Envoy should bind to when

Loading…
Cancel
Save