rtds: Runtime Discovery Service implementation. (#7251)

Fixes #6708.

Risk level: Low
Testing: Unit and integration tests added.

Signed-off-by: Harvey Tuch <htuch@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 07da3346bee84a7762052d9ce9f343a009ae994f
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 2e0c33f3b4
commit 8e32c3eab6
  1. 1
      docs/BUILD
  2. 28
      envoy/config/bootstrap/v2/bootstrap.proto
  3. 8
      envoy/service/discovery/v2/BUILD
  4. 22
      envoy/service/discovery/v2/rtds.proto
  5. 2
      test/build/BUILD
  6. 1
      xds_protocol.rst

@ -89,6 +89,7 @@ proto_library(
"//envoy/service/auth/v2:attribute_context",
"//envoy/service/auth/v2:external_auth",
"//envoy/service/discovery/v2:ads",
"//envoy/service/discovery/v2:rtds",
"//envoy/service/load_stats/v2:lrs",
"//envoy/service/metrics/v2:metrics_service",
"//envoy/service/ratelimit/v2:rls",

@ -237,13 +237,6 @@ message Runtime {
}
message RuntimeLayer {
// :ref:`Static runtime <config_runtime_bootstrap>` layer.
message StaticLayer {
// This follows the :ref:`runtime protobuf JSON representation encoding
// <config_runtime_proto_json>`.
google.protobuf.Struct value = 1;
}
// :ref:`Disk runtime <config_runtime_local_disk>` layer.
message DiskLayer {
// The implementation assumes that the file system tree is accessed via a
@ -264,27 +257,28 @@ message RuntimeLayer {
message AdminLayer {
}
// [#not-implemented-hide:]
message TdsLayer {
// Resource to subscribe to at *tds_config* for the TDS layer.
// :ref:`Runtime Discovery Service (RTDS) <config_runtime_rtds>` layer.
message RtdsLayer {
// Resource to subscribe to at *rtds_config* for the RTDS layer.
string name = 1;
// TDS configuration source.
envoy.api.v2.core.ConfigSource tds_config = 2;
// RTDS configuration source.
envoy.api.v2.core.ConfigSource rtds_config = 2;
}
// Descriptive name for the runtime layer. This is only used for the runtime
// :http:get:`/runtime` output.
string name = 1;
string name = 1 [(validate.rules).string.min_bytes = 1];
oneof layer_specifier {
// Unlike static xDS resources, this static layer is overridable by later
// layers in the runtime virtual filesystem.
// :ref:`Static runtime <config_runtime_bootstrap>` layer.
// This follows the :ref:`runtime protobuf JSON representation encoding
// <config_runtime_proto_json>`. Unlike static xDS resources, this static
// layer is overridable by later layers in the runtime virtual filesystem.
google.protobuf.Struct static_layer = 2;
DiskLayer disk_layer = 3;
AdminLayer admin_layer = 4;
// [#not-implemented-hide:]
TdsLayer tds_layer = 5;
RtdsLayer rtds_layer = 5;
}
}

@ -58,8 +58,8 @@ api_go_grpc_library(
)
api_proto_library_internal(
name = "tds",
srcs = ["tds.proto"],
name = "rtds",
srcs = ["rtds.proto"],
has_services = 1,
deps = [
"//envoy/api/v2:discovery",
@ -67,8 +67,8 @@ api_proto_library_internal(
)
api_go_grpc_library(
name = "tds",
proto = ":tds",
name = "rtds",
proto = ":rtds",
deps = [
"//envoy/api/v2:discovery_go_proto",
],

@ -2,7 +2,7 @@ syntax = "proto3";
package envoy.service.discovery.v2;
option java_outer_classname = "TdsProto";
option java_outer_classname = "RtdsProto";
option java_multiple_files = true;
option java_package = "io.envoyproxy.envoy.service.discovery.v2";
option java_generic_services = true;
@ -12,18 +12,26 @@ import "envoy/api/v2/discovery.proto";
import "google/api/annotations.proto";
import "google/protobuf/struct.proto";
import "validate/validate.proto";
// [#protodoc-title: runTime Discovery Service (RTDS)]
// RTDS :ref:`configuration overview <config_runtime_rtds>`
// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing
// services: https://github.com/google/protobuf/issues/4221
message TdsDummy {
message RtdsDummy {
}
// Discovery service for Runtime resources.
// [#not-implemented-hide:]
service RuntimeDiscoveryService {
rpc StreamRuntime(stream envoy.api.v2.DiscoveryRequest)
returns (stream envoy.api.v2.DiscoveryResponse) {
}
rpc DeltaRuntime(stream envoy.api.v2.DeltaDiscoveryRequest)
returns (stream envoy.api.v2.DeltaDiscoveryResponse) {
}
rpc FetchRuntime(envoy.api.v2.DiscoveryRequest) returns (envoy.api.v2.DiscoveryResponse) {
option (google.api.http) = {
post: "/v2/discovery:runtime"
@ -32,8 +40,10 @@ service RuntimeDiscoveryService {
}
}
// TDS resource type. This describes a layer in the runtime virtual filesystem.
// [#not-implemented-hide:]
// RTDS resource type. This describes a layer in the runtime virtual filesystem.
message Runtime {
google.protobuf.Struct layer = 1;
// Runtime resource name. This makes the Runtime a self-describing xDS
// resource.
string name = 1 [(validate.rules).string.min_bytes = 1];
google.protobuf.Struct layer = 2;
}

@ -13,7 +13,7 @@ api_cc_test(
"//envoy/service/accesslog/v2:als",
"//envoy/service/discovery/v2:ads",
"//envoy/service/discovery/v2:hds",
"//envoy/service/discovery/v2:tds",
"//envoy/service/discovery/v2:rtds",
"//envoy/service/metrics/v2:metrics_service",
"//envoy/service/ratelimit/v2:rls",
],

@ -60,6 +60,7 @@ correspondence between an xDS API and a resource type. That is:
- CDS: :ref:`envoy.api.v2.Cluster <envoy_api_msg_Cluster>`
- EDS: :ref:`envoy.api.v2.ClusterLoadAssignment <envoy_api_msg_ClusterLoadAssignment>`
- SDS: :ref:`envoy.api.v2.Auth.Secret <envoy_api_msg_Auth.Secret>`
- RTDS: :ref:`envoy.service.discovery.v2.Runtime <envoy_api_msg_service.discovery.v2.Runtime>`
The concept of `type URLs <https://developers.google.com/protocol-buffers/docs/proto3#any>`_ appears below, and takes the form
`type.googleapis.com/<resource type>`, e.g.

Loading…
Cancel
Save