api: add cluster_specifier_plugin to RouteAction (#16944)

This is a new extension point that will allow for dynamic cluster selection.
The plugin configured by it will be responsible for returning a cluster to
Envoy through its API (to be defined).  Since the cluster returned is dynamic,
a new field is added to Route to list all the clusters it may return.  This
allows for proxy implementations that are not using wildcard CDS queries to
pre-fetch clusters.

This feature may ultimately replace the FilterAction mechanism, as it provides
the same functionality for known use cases, but is simpler to implement and
use.

Signed-off-by: Doug Fawley <dfawley@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 6dc4092fc161b8fcb5f25a972e4783116692d53c
pull/624/head
data-plane-api(Azure Pipelines) 4 years ago
parent deaa4389e9
commit b0282daa86
  1. 15
      envoy/config/route/v3/route.proto
  2. 10
      envoy/config/route/v3/route_components.proto
  3. 18
      envoy/config/route/v4alpha/route.proto
  4. 10
      envoy/config/route/v4alpha/route_components.proto

@ -4,6 +4,7 @@ package envoy.config.route.v3;
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/route/v3/route_components.proto";
import "google/protobuf/wrappers.proto";
@ -21,7 +22,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// * Routing :ref:`architecture overview <arch_overview_http_routing>`
// * HTTP :ref:`router filter <config_http_filters_router>`
// [#next-free-field: 12]
// [#next-free-field: 13]
message RouteConfiguration {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.RouteConfiguration";
@ -119,6 +120,18 @@ message RouteConfiguration {
// is not subject to data plane buffering controls.
//
google.protobuf.UInt32Value max_direct_response_body_size_bytes = 11;
// [#not-implemented-hide:]
// A list of plugins and their configurations which may be used by a
// :ref:`envoy_v3_api_field_config.route.v3.RouteAction.cluster_specifier_plugin`
// within the route. All *extension.name* fields in this list must be unique.
repeated ClusterSpecifierPlugin cluster_specifier_plugins = 12;
}
// Configuration for a cluster specifier plugin.
message ClusterSpecifierPlugin {
// The name of the plugin and its opaque configuration.
core.v3.TypedExtensionConfig extension = 1;
}
message Vhds {

@ -570,7 +570,7 @@ message CorsPolicy {
core.v3.RuntimeFractionalPercent shadow_enabled = 10;
}
// [#next-free-field: 37]
// [#next-free-field: 38]
message RouteAction {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.RouteAction";
@ -846,6 +846,14 @@ message RouteAction {
// :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>`
// for additional documentation.
WeightedCluster weighted_clusters = 3;
// [#not-implemented-hide:]
// Name of the cluster specifier plugin to use to determine the cluster for
// requests on this route. The plugin name must be defined in the associated
// :ref:`envoy_v3_api_field_config.route.v3.RouteConfiguration.cluster_specifier_plugins`
// in the
// :ref:`envoy_v3_api_field_config.core.v3.TypedExtensionConfig.name` field.
string cluster_specifier_plugin = 37;
}
// The HTTP status code to use when configured cluster is not found.

@ -4,6 +4,7 @@ package envoy.config.route.v4alpha;
import "envoy/config/core/v4alpha/base.proto";
import "envoy/config/core/v4alpha/config_source.proto";
import "envoy/config/core/v4alpha/extension.proto";
import "envoy/config/route/v4alpha/route_components.proto";
import "google/protobuf/wrappers.proto";
@ -21,7 +22,7 @@ option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSIO
// * Routing :ref:`architecture overview <arch_overview_http_routing>`
// * HTTP :ref:`router filter <config_http_filters_router>`
// [#next-free-field: 12]
// [#next-free-field: 13]
message RouteConfiguration {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.route.v3.RouteConfiguration";
@ -120,6 +121,21 @@ message RouteConfiguration {
// is not subject to data plane buffering controls.
//
google.protobuf.UInt32Value max_direct_response_body_size_bytes = 11;
// [#not-implemented-hide:]
// A list of plugins and their configurations which may be used by a
// :ref:`envoy_v3_api_field_config.route.v3.RouteAction.cluster_specifier_plugin`
// within the route. All *extension.name* fields in this list must be unique.
repeated ClusterSpecifierPlugin cluster_specifier_plugins = 12;
}
// Configuration for a cluster specifier plugin.
message ClusterSpecifierPlugin {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.route.v3.ClusterSpecifierPlugin";
// The name of the plugin and its opaque configuration.
core.v4alpha.TypedExtensionConfig extension = 1;
}
message Vhds {

@ -571,7 +571,7 @@ message CorsPolicy {
core.v4alpha.RuntimeFractionalPercent shadow_enabled = 10;
}
// [#next-free-field: 37]
// [#next-free-field: 38]
message RouteAction {
option (udpa.annotations.versioning).previous_message_type = "envoy.config.route.v3.RouteAction";
@ -845,6 +845,14 @@ message RouteAction {
// :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>`
// for additional documentation.
WeightedCluster weighted_clusters = 3;
// [#not-implemented-hide:]
// Name of the cluster specifier plugin to use to determine the cluster for
// requests on this route. The plugin name must be defined in the associated
// :ref:`envoy_v3_api_field_config.route.v3.RouteConfiguration.cluster_specifier_plugins`
// in the
// :ref:`envoy_v3_api_field_config.core.v3.TypedExtensionConfig.name` field.
string cluster_specifier_plugin = 37;
}
// The HTTP status code to use when configured cluster is not found.

Loading…
Cancel
Save