config: reworking HTTP upstream config (#14079)
Replacing the http-protocol-specific fields in the cluster config with a new plugin Risk Level: medium Testing: updated tests to use the new config Docs Changes: updated docs to use the new config Release Notes: deprecation notes in the PR Deprecated: all http-specific cluster config. Signed-off-by: Alyssa Wilk <alyssar@chromium.org> Mirrored from https://github.com/envoyproxy/envoy @ 7554d61bccf136638bdfb383c10d049dc8bd3790pull/623/head
parent
01656478f8
commit
ffdd5ee6fe
8 changed files with 273 additions and 31 deletions
@ -0,0 +1,12 @@ |
||||
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. |
||||
|
||||
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") |
||||
|
||||
licenses(["notice"]) # Apache 2 |
||||
|
||||
api_proto_package( |
||||
deps = [ |
||||
"//envoy/config/core/v3:pkg", |
||||
"@com_github_cncf_udpa//udpa/annotations:pkg", |
||||
], |
||||
) |
@ -0,0 +1,95 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.extensions.upstreams.http.v3; |
||||
|
||||
import "envoy/config/core/v3/protocol.proto"; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.extensions.upstreams.http.v3"; |
||||
option java_outer_classname = "HttpProtocolOptionsProto"; |
||||
option java_multiple_files = true; |
||||
option (udpa.annotations.file_status).package_version_status = ACTIVE; |
||||
|
||||
// [#protodoc-title: HTTP Protocol Options] |
||||
// [#extension: envoy.upstreams.http.http_protocol_options] |
||||
|
||||
// HttpProtocolOptions specifies Http upstream protocol options. This object |
||||
// is used in |
||||
// :ref:`typed_extension_protocol_options<envoy_api_field_config.cluster.v3.Cluster.typed_extension_protocol_options>`, |
||||
// keyed by the name `envoy.extensions.upstreams.http.v3.HttpProtocolOptions`. |
||||
// |
||||
// This controls what protocol(s) should be used for upstream and how said protocol(s) are configured. |
||||
// |
||||
// This replaces the prior pattern of explicit protocol configuration directly |
||||
// in the cluster. So a configuration like this, explicitly configuring the use of HTTP/2 upstream: |
||||
// |
||||
// .. code:: |
||||
// |
||||
// clusters: |
||||
// - name: some_service |
||||
// connect_timeout: 5s |
||||
// upstream_http_protocol_options: |
||||
// auto_sni: true |
||||
// common_http_protocol_options: |
||||
// idle_timeout: 1s |
||||
// http2_protocol_options: |
||||
// max_concurrent_streams: 100 |
||||
// .... [further cluster config] |
||||
// |
||||
// Would now look like this: |
||||
// |
||||
// .. code:: |
||||
// |
||||
// clusters: |
||||
// - name: some_service |
||||
// connect_timeout: 5s |
||||
// typed_extension_protocol_options: |
||||
// envoy.extensions.upstreams.http.v3.HttpProtocolOptions: |
||||
// "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions |
||||
// upstream_http_protocol_options: |
||||
// auto_sni: true |
||||
// common_http_protocol_options: |
||||
// idle_timeout: 1s |
||||
// explicit_http_config: |
||||
// http2_protocol_options: |
||||
// max_concurrent_streams: 100 |
||||
// .... [further cluster config] |
||||
message HttpProtocolOptions { |
||||
// If this is used, the cluster will only operate on one of the possible upstream protocols (HTTP/1.1, HTTP/2). |
||||
// If :ref:`http2_protocol_options <envoy_api_field_config.cluster.v3.Cluster.http2_protocol_options>` are |
||||
// present, HTTP2 will be used, otherwise HTTP1.1 will be used. |
||||
message ExplicitHttpConfig { |
||||
oneof protocol_config { |
||||
config.core.v3.Http1ProtocolOptions http_protocol_options = 1; |
||||
|
||||
config.core.v3.Http2ProtocolOptions http2_protocol_options = 2; |
||||
} |
||||
} |
||||
|
||||
// If this is used, the cluster can use either of the configured protocols, and |
||||
// will use whichever protocol was used by the downstream connection. |
||||
message UseDownstreamHttpConfig { |
||||
config.core.v3.Http1ProtocolOptions http_protocol_options = 1; |
||||
|
||||
config.core.v3.Http2ProtocolOptions http2_protocol_options = 2; |
||||
} |
||||
|
||||
// This contains options common across HTTP/1 and HTTP/2 |
||||
config.core.v3.HttpProtocolOptions common_http_protocol_options = 1; |
||||
|
||||
// This contains common protocol options which are only applied upstream. |
||||
config.core.v3.UpstreamHttpProtocolOptions upstream_http_protocol_options = 2; |
||||
|
||||
// This controls the actual protocol to be used upstream. |
||||
// If none of the *upstream_protocol_options* are chosen, the default is *explicit_http_config*. |
||||
oneof upstream_protocol_options { |
||||
// To explicitly configure either HTTP/1 or HTTP/2 (but not both!) use *explicit_http_config*. |
||||
// If the *explicit_http_config* is empty, HTTP/1.1 is used. |
||||
ExplicitHttpConfig explicit_http_config = 3; |
||||
|
||||
// This allows switching on protocol based on what protocol the downstream |
||||
// connection used. |
||||
UseDownstreamHttpConfig use_downstream_protocol_config = 4; |
||||
} |
||||
} |
@ -0,0 +1,13 @@ |
||||
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. |
||||
|
||||
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") |
||||
|
||||
licenses(["notice"]) # Apache 2 |
||||
|
||||
api_proto_package( |
||||
deps = [ |
||||
"//envoy/config/core/v4alpha:pkg", |
||||
"//envoy/extensions/upstreams/http/v3:pkg", |
||||
"@com_github_cncf_udpa//udpa/annotations:pkg", |
||||
], |
||||
) |
@ -0,0 +1,105 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.extensions.upstreams.http.v4alpha; |
||||
|
||||
import "envoy/config/core/v4alpha/protocol.proto"; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
import "udpa/annotations/versioning.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.extensions.upstreams.http.v4alpha"; |
||||
option java_outer_classname = "HttpProtocolOptionsProto"; |
||||
option java_multiple_files = true; |
||||
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; |
||||
|
||||
// [#protodoc-title: HTTP Protocol Options] |
||||
// [#extension: envoy.upstreams.http.http_protocol_options] |
||||
|
||||
// HttpProtocolOptions specifies Http upstream protocol options. This object |
||||
// is used in |
||||
// :ref:`typed_extension_protocol_options<envoy_api_field_config.cluster.v4alpha.Cluster.typed_extension_protocol_options>`, |
||||
// keyed by the name `envoy.extensions.upstreams.http.v3.HttpProtocolOptions`. |
||||
// |
||||
// This controls what protocol(s) should be used for upstream and how said protocol(s) are configured. |
||||
// |
||||
// This replaces the prior pattern of explicit protocol configuration directly |
||||
// in the cluster. So a configuration like this, explicitly configuring the use of HTTP/2 upstream: |
||||
// |
||||
// .. code:: |
||||
// |
||||
// clusters: |
||||
// - name: some_service |
||||
// connect_timeout: 5s |
||||
// upstream_http_protocol_options: |
||||
// auto_sni: true |
||||
// common_http_protocol_options: |
||||
// idle_timeout: 1s |
||||
// http2_protocol_options: |
||||
// max_concurrent_streams: 100 |
||||
// .... [further cluster config] |
||||
// |
||||
// Would now look like this: |
||||
// |
||||
// .. code:: |
||||
// |
||||
// clusters: |
||||
// - name: some_service |
||||
// connect_timeout: 5s |
||||
// typed_extension_protocol_options: |
||||
// envoy.extensions.upstreams.http.v3.HttpProtocolOptions: |
||||
// "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions |
||||
// upstream_http_protocol_options: |
||||
// auto_sni: true |
||||
// common_http_protocol_options: |
||||
// idle_timeout: 1s |
||||
// explicit_http_config: |
||||
// http2_protocol_options: |
||||
// max_concurrent_streams: 100 |
||||
// .... [further cluster config] |
||||
message HttpProtocolOptions { |
||||
option (udpa.annotations.versioning).previous_message_type = |
||||
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions"; |
||||
|
||||
// If this is used, the cluster will only operate on one of the possible upstream protocols (HTTP/1.1, HTTP/2). |
||||
// If :ref:`http2_protocol_options <envoy_api_field_config.cluster.v4alpha.Cluster.http2_protocol_options>` are |
||||
// present, HTTP2 will be used, otherwise HTTP1.1 will be used. |
||||
message ExplicitHttpConfig { |
||||
option (udpa.annotations.versioning).previous_message_type = |
||||
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions.ExplicitHttpConfig"; |
||||
|
||||
oneof protocol_config { |
||||
config.core.v4alpha.Http1ProtocolOptions http_protocol_options = 1; |
||||
|
||||
config.core.v4alpha.Http2ProtocolOptions http2_protocol_options = 2; |
||||
} |
||||
} |
||||
|
||||
// If this is used, the cluster can use either of the configured protocols, and |
||||
// will use whichever protocol was used by the downstream connection. |
||||
message UseDownstreamHttpConfig { |
||||
option (udpa.annotations.versioning).previous_message_type = |
||||
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions.UseDownstreamHttpConfig"; |
||||
|
||||
config.core.v4alpha.Http1ProtocolOptions http_protocol_options = 1; |
||||
|
||||
config.core.v4alpha.Http2ProtocolOptions http2_protocol_options = 2; |
||||
} |
||||
|
||||
// This contains options common across HTTP/1 and HTTP/2 |
||||
config.core.v4alpha.HttpProtocolOptions common_http_protocol_options = 1; |
||||
|
||||
// This contains common protocol options which are only applied upstream. |
||||
config.core.v4alpha.UpstreamHttpProtocolOptions upstream_http_protocol_options = 2; |
||||
|
||||
// This controls the actual protocol to be used upstream. |
||||
// If none of the *upstream_protocol_options* are chosen, the default is *explicit_http_config*. |
||||
oneof upstream_protocol_options { |
||||
// To explicitly configure either HTTP/1 or HTTP/2 (but not both!) use *explicit_http_config*. |
||||
// If the *explicit_http_config* is empty, HTTP/1.1 is used. |
||||
ExplicitHttpConfig explicit_http_config = 3; |
||||
|
||||
// This allows switching on protocol based on what protocol the downstream |
||||
// connection used. |
||||
UseDownstreamHttpConfig use_downstream_protocol_config = 4; |
||||
} |
||||
} |
Loading…
Reference in new issue