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

udpa: plumb udpa:// resource names/locators. #11810

Merged
merged 5 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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/envoy/config/bootstrap/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ api_proto_package(
"//envoy/config/trace/v3:pkg",
"//envoy/extensions/transport_sockets/tls/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@com_github_cncf_udpa//udpa/core/v1:pkg",
],
)
44 changes: 42 additions & 2 deletions api/envoy/config/bootstrap/v3/bootstrap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";

import "udpa/core/v1/resource_locator.proto";

import "envoy/annotations/deprecation.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/security.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
Expand All @@ -36,7 +39,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// <config_overview_bootstrap>` for more detail.

// Bootstrap :ref:`configuration overview <config_overview_bootstrap>`.
// [#next-free-field: 22]
// [#next-free-field: 24]
message Bootstrap {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.bootstrap.v2.Bootstrap";
Expand All @@ -62,6 +65,7 @@ message Bootstrap {
repeated envoy.extensions.transport_sockets.tls.v3.Secret secrets = 3;
}

// [#next-free-field: 7]
message DynamicResources {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.bootstrap.v2.Bootstrap.DynamicResources";
Expand All @@ -72,11 +76,19 @@ message Bootstrap {
// :ref:`LDS <arch_overview_dynamic_config_lds>` configuration source.
core.v3.ConfigSource lds_config = 1;

// Resource locator for listener collection.
// [#not-implemented-hide:]
udpa.core.v1.ResourceLocator lds_resources_locator = 5;
htuch marked this conversation as resolved.
Show resolved Hide resolved

// All post-bootstrap :ref:`Cluster <envoy_api_msg_config.cluster.v3.Cluster>` definitions are
// provided by a single :ref:`CDS <arch_overview_dynamic_config_cds>`
// configuration source.
core.v3.ConfigSource cds_config = 2;

// Resource locator for cluster collection.
// [#not-implemented-hide:]
udpa.core.v1.ResourceLocator cds_resources_locator = 6;

// A single :ref:`ADS <config_overview_ads>` source may be optionally
// specified. This must have :ref:`api_type
// <envoy_api_field_config.core.v3.ApiConfigSource.api_type>` :ref:`GRPC
Expand Down Expand Up @@ -186,6 +198,29 @@ message Bootstrap {
// Specifies optional bootstrap extensions to be instantiated at startup time.
// Each item contains extension specific configuration.
repeated core.v3.TypedExtensionConfig bootstrap_extensions = 21;

// Configuration sources that will participate in
// *udpa.core.v1.ResourceLocator* authority resolution. The algorithm is as
// follows:
// 1. The authority field is taken from the *udpa.core.v1.ResourceLocator*, call
// this *resource_authority*.
// 2. *resource_authority* is compared against the authorities in any peer
// *ConfigSource*. The peer *ConfigSource* is the configuration source
// message which would have been used unconditionally for resolution
// with opaque resource names. If there is a match with an authority, the
// peer *ConfigSource* message is used.
htuch marked this conversation as resolved.
Show resolved Hide resolved
// 3. *resource_authority* is compared sequentially with the authorities in
// each configuration source in *config_sources*. The first *ConfigSource*
// to match wins.
// 4. As a fallback, if no configuration source matches, then
// *default_configuration_source* is used.
// [#not-implemented-hide:]
repeated core.v3.ConfigSource config_sources = 22;

// Default configuration source for *udpa.core.v1.ResourceLocator* if all
// other resolution fails.
// [#not-implemented-hide:]
core.v3.ConfigSource default_config_source = 23;
htuch marked this conversation as resolved.
Show resolved Hide resolved
}

// Administration interface :ref:`operations documentation
Expand Down Expand Up @@ -353,7 +388,12 @@ message RuntimeLayer {
"envoy.config.bootstrap.v2.RuntimeLayer.RtdsLayer";

// Resource to subscribe to at *rtds_config* for the RTDS layer.
string name = 1;
string name = 1 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];

// Resource locator for RTDS layer. This is mutually exclusive to *name*.
// [#not-implemented-hide:]
udpa.core.v1.ResourceLocator rtds_resource_locator = 3
[(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];

// RTDS configuration source.
core.v3.ConfigSource rtds_config = 2;
Expand Down
1 change: 1 addition & 0 deletions api/envoy/config/bootstrap/v4alpha/BUILD

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

46 changes: 43 additions & 3 deletions api/envoy/config/bootstrap/v4alpha/bootstrap.proto

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

1 change: 1 addition & 0 deletions api/envoy/config/cluster/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ api_proto_package(
"//envoy/config/endpoint/v3:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@com_github_cncf_udpa//udpa/core/v1:pkg",
],
)
17 changes: 16 additions & 1 deletion api/envoy/config/cluster/v3/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";

import "udpa/core/v1/collection_entry.proto";
import "udpa/core/v1/resource_locator.proto";

import "envoy/annotations/deprecation.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/security.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
Expand All @@ -32,6 +36,12 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Cluster configuration]

// Cluster list collections. Entries are *Cluster* resources or references.
// [#not-implemented-hide:]
message ClusterCollection {
udpa.core.v1.CollectionEntry entries = 1;
}

// Configuration for a single upstream cluster.
// [#next-free-field: 49]
message Cluster {
Expand Down Expand Up @@ -178,7 +188,12 @@ message Cluster {
// Optional alternative to cluster name to present to EDS. This does not
// have the same restrictions as cluster name, i.e. it may be arbitrary
// length.
string service_name = 2;
string service_name = 2 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];

// Resource locator for EDS. This is mutually exclusive to *service_name*.
// [#not-implemented-hide:]
udpa.core.v1.ResourceLocator eds_resource_locator = 3
[(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want this field to replace both the service_name field and the eds_config field? In other words, I think we want either this new field or both eds_config and service_name.

Maybe the right thing to do here is to leave the EdsClusterConfig message alone and move this new field into a top-level field in the Cluster message. Then the oneof can contain this new field and the EdsClusterConfig field.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, as per the resolution algorithm in the bootstrap, I think it's fine to have "peer config sources". This get checked first, then the bootstrap. It provides a more gradual path to adoption for folks who don't already provide config sources for everything in bootstrap.

}

// Optionally divide the endpoints in this cluster into subsets defined by
Expand Down
1 change: 1 addition & 0 deletions api/envoy/config/cluster/v4alpha/BUILD

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

26 changes: 22 additions & 4 deletions api/envoy/config/cluster/v4alpha/cluster.proto

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

1 change: 1 addition & 0 deletions api/envoy/config/core/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ api_proto_package(
"//envoy/type/matcher/v3:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@com_github_cncf_udpa//udpa/core/v1:pkg",
],
)
23 changes: 21 additions & 2 deletions api/envoy/config/core/v3/config_source.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import "envoy/config/core/v3/grpc_service.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";

import "udpa/core/v1/authority.proto";

import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
Expand Down Expand Up @@ -52,13 +54,23 @@ message ApiConfigSource {
// the v2 protos is used.
REST = 1;

// gRPC v2 API.
// SotW gRPC service.
GRPC = 2;

// Using the delta xDS gRPC service, i.e. DeltaDiscovery{Request,Response}
// rather than Discovery{Request,Response}. Rather than sending Envoy the entire state
// with every update, the xDS server only sends what has changed since the last update.
DELTA_GRPC = 3;

// SotW xDS gRPC with ADS. All resources which resolve to this configuration source will be
// multiplexed on a single connection to an ADS endpoint.
// [#not-implemented-hide:]
AGGREGATED_GRPC = 5;

// Delta xDS gRPC with ADS. All resources which resolve to this configuration source will be
// multiplexed on a single connection to an ADS endpoint.
// [#not-implemented-hide:]
AGGREGATED_DELTA_GRPC = 6;
}

// API type (gRPC, REST, delta gRPC)
Expand Down Expand Up @@ -136,10 +148,17 @@ message RateLimitSettings {
// <arch_overview_service_discovery>` etc. may either be sourced from the
// filesystem or from an xDS API source. Filesystem configs are watched with
// inotify for updates.
// [#next-free-field: 7]
// [#next-free-field: 8]
message ConfigSource {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.ConfigSource";

// Authorities that this config source may be used for. An authority specified
// in a *udpa.core.v1.ResourceLocator* is resolved to a *ConfigSource* prior
// to configuration fetch. This field provides the association between
// authority name and configuration source.
// [#not-implemented-hide:]
repeated udpa.core.v1.Authority authorities = 7;

oneof config_source_specifier {
option (validate.required) = true;

Expand Down
1 change: 1 addition & 0 deletions api/envoy/config/core/v4alpha/BUILD

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

Loading