Skip to content
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

xds: implement extension config discovery for HCM #11826

Merged
merged 50 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
94a74e6
initial work
kyessenov Jun 26, 2020
618eb78
iteration
kyessenov Jun 29, 2020
63bad69
finish and test
kyessenov Jun 30, 2020
4305ecd
comments
kyessenov Jun 30, 2020
760eba4
reformat and kick ci
kyessenov Jul 1, 2020
98c4048
fix tests
kyessenov Jul 1, 2020
a620c4b
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 1, 2020
600115c
merge upstream
kyessenov Jul 6, 2020
2324038
review
kyessenov Jul 7, 2020
ab7b803
merge fix
kyessenov Jul 8, 2020
c5bcc15
update api definitions
kyessenov Jul 8, 2020
548e27c
generalize
kyessenov Jul 8, 2020
2228e1e
review
kyessenov Jul 8, 2020
d30a05e
update API
kyessenov Jul 10, 2020
87caa16
merge fix
kyessenov Jul 10, 2020
43e83e6
add tests
kyessenov Jul 11, 2020
dc7b327
spell
kyessenov Jul 11, 2020
16a927c
add tests
kyessenov Jul 13, 2020
ec6e42a
add docs
kyessenov Jul 13, 2020
a8be7f8
fix windows build
kyessenov Jul 13, 2020
be291a5
add a set of type URLs constraint
kyessenov Jul 13, 2020
b243006
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 14, 2020
8c981f6
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 14, 2020
bbeb0d0
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 15, 2020
0d806df
validate terminal condition in listener instead
kyessenov Jul 15, 2020
d260667
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 16, 2020
a5e305d
remove debug print of config source (PII) and add a comment why valid…
kyessenov Jul 16, 2020
0e94ac1
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 16, 2020
e546fa1
review
kyessenov Jul 16, 2020
987fe5d
merge fix
kyessenov Jul 16, 2020
29e9c76
update doc
kyessenov Jul 16, 2020
d6009c9
trying to avoid merge conflict
kyessenov Jul 16, 2020
6a1a18d
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 16, 2020
4bbc2dc
merge conflict
kyessenov Jul 16, 2020
04e8e49
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 17, 2020
7e3b2ab
sigh more merge conflicts
kyessenov Jul 17, 2020
b018cac
bad merge fix
kyessenov Jul 17, 2020
35de81e
urghh merge fixing
kyessenov Jul 20, 2020
1357377
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 20, 2020
7946b83
urghh merge fixing
kyessenov Jul 20, 2020
d11a0af
review
kyessenov Jul 20, 2020
7d53b34
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 20, 2020
47a54d9
bad merge again
kyessenov Jul 20, 2020
46addf1
review
kyessenov Jul 21, 2020
b7812b2
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 21, 2020
09492bc
integration test
kyessenov Jul 21, 2020
449e80d
protobuf link hack
kyessenov Jul 22, 2020
7debac1
Merge remote-tracking branch 'upstream/master' into filter_config_dis…
kyessenov Jul 22, 2020
ae4f612
thanks @lambdai for providing the magic stat
kyessenov Jul 23, 2020
67093a1
fix
kyessenov Jul 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ proto_library(
"//envoy/service/discovery/v3:pkg",
"//envoy/service/endpoint/v3:pkg",
"//envoy/service/event_reporting/v3:pkg",
"//envoy/service/extension/v3:pkg",
mattklein123 marked this conversation as resolved.
Show resolved Hide resolved
"//envoy/service/health/v3:pkg",
"//envoy/service/listener/v3:pkg",
"//envoy/service/load_stats/v3:pkg",
Expand Down
1 change: 1 addition & 0 deletions api/envoy/config/accesslog/v3/accesslog.proto
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ message ResponseFlagFilter {
in: "DPE"
in: "UMSDR"
in: "RFCF"
in: "NFCF"
}
}
}];
Expand Down
1 change: 1 addition & 0 deletions api/envoy/config/accesslog/v4alpha/accesslog.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions api/envoy/config/core/v3/extension.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";

package envoy.config.core.v3;

import "envoy/config/core/v3/config_source.proto";

import "google/protobuf/any.proto";

import "udpa/annotations/status.proto";
Expand All @@ -28,3 +30,32 @@ message TypedExtensionConfig {
// <config_overview_extension_configuration>` for further details.
google.protobuf.Any typed_config = 2 [(validate.rules).any = {required: true}];
}

// Configuration source specifier for a late-bound extension configuration. The
// parent resource is warmed until all the initial extension configurations are
// received, unless the flag to apply the default configuration is set.
// Subsequent extension updates are atomic on a per-worker basis. Once an
// extension configuration is applied to a request or a connection, it remains
// constant for the duration of processing. If the initial delivery of the
// extension configuration fails, due to a timeout for example, the optional
// default configuration is applied. Without a default configuration, the
// extension is disabled, until an extension configuration is received. The
// behavior of a disabled extension depends on the context. For example, a
// filter chain with a disabled extension filter rejects all incoming streams.
message ExtensionConfigSource {
ConfigSource config_source = 1 [(validate.rules).any = {required: true}];

// Optional default configuration to use as the initial configuration if
// there is a failure to receive the initial extension configuration or if
// `apply_default_config_without_warming` flag is set.
google.protobuf.Any default_config = 2;

// Use the default config as the initial configuration without warming and
// waiting for the first discovery response. Requires the default configuration
// to be supplied.
bool apply_default_config_without_warming = 3;

// A set of permitted extension type URLs. Extension configuration updates are rejected
// if they do not match any type URL in the set.
repeated string type_urls = 4 [(validate.rules).repeated = {min_items: 1}];
}
34 changes: 34 additions & 0 deletions api/envoy/config/core/v4alpha/extension.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion api/envoy/data/accesslog/v3/accesslog.proto
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ message AccessLogCommon {
}

// Flags indicating occurrences during request/response processing.
// [#next-free-field: 22]
// [#next-free-field: 23]
message ResponseFlags {
option (udpa.annotations.versioning).previous_message_type =
"envoy.data.accesslog.v2.ResponseFlags";
Expand Down Expand Up @@ -269,6 +269,9 @@ message ResponseFlags {

// Indicates the response was served from a cache filter.
bool response_from_cache_filter = 21;

// Indicates that a filter configuration is not available.
bool no_filter_config_found = 22;
}

// Properties of a negotiated TLS connection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package envoy.extensions.filters.network.http_connection_manager.v3;
import "envoy/config/accesslog/v3/accesslog.proto";
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/config_source.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/protocol.proto";
import "envoy/config/core/v3/substitution_format_string.proto";
import "envoy/config/route/v3/route.proto";
Expand Down Expand Up @@ -797,47 +798,24 @@ message HttpFilter {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.network.http_connection_manager.v2.HttpFilter";

// [#not-implemented-hide:] Configuration source specifier for the late-bound
// filter configuration. The HTTP Listener is warmed until all the initial
// filter configurations are received, unless the flag to apply the default
// configuration is set. Subsequent filter updates are atomic on a per-worker
// basis, and apply to new streams while the active streams continue using
// the older filter configurations. If the initial delivery of the filter
// configuration fails, due to a timeout for example, the optional default
// configuration is applied. Without a default configuration, the filter is
// disabled, and the HTTP listener responds with 500 immediately. After the
// failure, the listener continues subscribing to the subsequent filter
// configurations.
message HttpFilterConfigSource {
config.core.v3.ConfigSource config_source = 1;

// Optional default configuration to use as the initial configuration if
// there is a failure to receive the initial filter configuration or if
// `apply_default_config_without_warming` flag is set.
google.protobuf.Any default_config = 2;

// Use the default config as the initial configuration without warming and
// waiting for the first xDS response. Requires the default configuration
// to be supplied.
bool apply_default_config_without_warming = 3;
}

reserved 3, 2;

reserved "config";

// The name of the filter configuration. The name is used as a fallback to
// select an extension if the type of the configuration proto is not
// sufficient. It also serves as a resource name in FilterConfigDS.
// sufficient. It also serves as a resource name in ExtensionConfigDS.
string name = 1 [(validate.rules).string = {min_bytes: 1}];

// Filter specific configuration which depends on the filter being instantiated. See the supported
// filters for further documentation.
oneof config_type {
google.protobuf.Any typed_config = 4;

// [#not-implemented-hide:] Configuration source specifier for FilterConfigDS.
HttpFilterConfigSource filter_config_ds = 5;
// Configuration source specifier for an extension configuration discovery service.
// In case of a failure and without the default configuration, the HTTP listener responds with 500.
// Extension configs delivered through this mechanism are not expected to require warming (see https://github.com/envoyproxy/envoy/issues/12061).
config.core.v3.ExtensionConfigSource config_discovery = 5;
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package envoy.service.filter.v3;
package envoy.service.extension.v3;

import "envoy/service/discovery/v3/discovery.proto";

Expand All @@ -10,28 +10,29 @@ import "envoy/annotations/resource.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";

option java_package = "io.envoyproxy.envoy.service.filter.v3";
option java_outer_classname = "FilterConfigDiscoveryProto";
option java_package = "io.envoyproxy.envoy.service.extension.v3";
option java_outer_classname = "ConfigDiscoveryProto";
option java_multiple_files = true;
option java_generic_services = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: FilterConfigDS]
// [#protodoc-title: ExtensionConfigDS]

// Return filter configurations.
service FilterConfigDiscoveryService {
// Return extension configurations.
service ExtensionConfigDiscoveryService {
option (envoy.annotations.resource).type = "envoy.config.core.v3.TypedExtensionConfig";

rpc StreamFilterConfigs(stream discovery.v3.DiscoveryRequest)
rpc StreamExtensionConfigs(stream discovery.v3.DiscoveryRequest)
returns (stream discovery.v3.DiscoveryResponse) {
}

rpc DeltaFilterConfigs(stream discovery.v3.DeltaDiscoveryRequest)
rpc DeltaExtensionConfigs(stream discovery.v3.DeltaDiscoveryRequest)
returns (stream discovery.v3.DeltaDiscoveryResponse) {
}

rpc FetchFilterConfigs(discovery.v3.DiscoveryRequest) returns (discovery.v3.DiscoveryResponse) {
option (google.api.http).post = "/v3/discovery:filter_configs";
rpc FetchExtensionConfigs(discovery.v3.DiscoveryRequest)
returns (discovery.v3.DiscoveryResponse) {
option (google.api.http).post = "/v3/discovery:extension_configs";
option (google.api.http).body = "*";
}
}
2 changes: 1 addition & 1 deletion api/versioning/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ proto_library(
"//envoy/service/discovery/v3:pkg",
"//envoy/service/endpoint/v3:pkg",
"//envoy/service/event_reporting/v3:pkg",
"//envoy/service/filter/v3:pkg",
"//envoy/service/extension/v3:pkg",
"//envoy/service/health/v3:pkg",
"//envoy/service/listener/v3:pkg",
"//envoy/service/load_stats/v3:pkg",
Expand Down
1 change: 1 addition & 0 deletions docs/root/api-v3/service/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ Services
tap/v3/*
../config/tap/v3/*
trace/v3/*
extension/v3/*
22 changes: 22 additions & 0 deletions docs/root/configuration/overview/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,25 @@ follows:
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
type_url: type.googleapis.com/envoy.extensions.filters.http.router.v3Router
Discovery service
^^^^^^^^^^^^^^^^^

Extension configuration can be supplied dynamically from a :ref:`an xDS
management server<xds_protocol>` using :ref:`ExtensionConfiguration discovery
service<envoy_v3_api_file_envoy/service/extension/v3/config_discovery.proto>`.
The name field in the extension configuration acts as the resource identifier.
For example, HTTP connection manager supports :ref:`dynamic filter
re-configuration<envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpFilter.config_discovery>`
for HTTP filters.

Extension config discovery service has a :ref:`statistics
<subscription_statistics>` tree rooted at
*<stat_prefix>.extension_config_discovery.<extension_config_name>.*. In addition
to the common subscription statistics, it also provides the following:

.. csv-table::
:header: Name, Type, Description
:widths: 1, 1, 2

config_reload, Counter, Total number of successful configuration updates
config_fail, Counter, Total number of failed configuration updates
2 changes: 2 additions & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ New Features
* stats: added optional histograms to :ref:`cluster stats <config_cluster_manager_cluster_stats_request_response_sizes>`
that track headers and body sizes of requests and responses.
* tap: added :ref:`generic body matcher<envoy_v3_api_msg_config.tap.v3.HttpGenericBodyMatch>` to scan http requests and responses for text or hex patterns.
* tcp: switched the TCP connection pool to the new "shared" connection pool, sharing a common code base with HTTP and HTTP/2. Any unexpected behavioral changes can be temporarily reverted by setting `envoy.reloadable_features.new_tcp_connection_pool` to false.
* xds: added :ref:`extension config discovery<envoy_v3_api_msg_config.core.v3.ExtensionConfigSource>` support for HTTP filters.

Deprecated
----------
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading