Skip to content

Commit

Permalink
api: add filter config discovery (#11571)
Browse files Browse the repository at this point in the history
Define filter config discovery. Add FDS for HTTP filters (HTTP extensions is where the pain is felt the most). Modelled after RDS with a twist of config override for re-use.

Risk Level: low (not implemented)
Testing:
Docs Changes:
Release Notes:

Issue: #7867

Signed-off-by: Kuat Yessenov <kuat@google.com>
  • Loading branch information
kyessenov authored Jun 25, 2020
1 parent a707b46 commit bda15c0
Show file tree
Hide file tree
Showing 9 changed files with 239 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -750,22 +750,52 @@ message ScopedRds {
[(validate.rules).message = {required: true}];
}

// [#next-free-field: 6]
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 to instantiate. The name must match a
// :ref:`supported filter <config_http_filters>`.
// 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.
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;
}
}

Expand Down

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

14 changes: 14 additions & 0 deletions api/envoy/service/filter/v3/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# DO NOT EDIT. This file is generated by tools/proto_sync.py.

load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")

licenses(["notice"]) # Apache 2

api_proto_package(
has_services = True,
deps = [
"//envoy/annotations:pkg",
"//envoy/service/discovery/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
37 changes: 37 additions & 0 deletions api/envoy/service/filter/v3/filter_config_discovery.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";

package envoy.service.filter.v3;

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

import "google/api/annotations.proto";

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_multiple_files = true;
option java_generic_services = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: FilterConfigDS]

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

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

rpc DeltaFilterConfigs(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";
option (google.api.http).body = "*";
}
}
1 change: 1 addition & 0 deletions api/versioning/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,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/health/v3:pkg",
"//envoy/service/listener/v3:pkg",
"//envoy/service/load_stats/v3:pkg",
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.

14 changes: 14 additions & 0 deletions generated_api_shadow/envoy/service/filter/v3/BUILD

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.

0 comments on commit bda15c0

Please sign in to comment.