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

Add Client Status Discovery Service (CSDS) API definition #9383

Merged
merged 51 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2691086
Add proto definition for CSDS.
fuqianggao Dec 17, 2019
825a020
Add CSDS to spelling_dictionary.txt.
fuqianggao Dec 17, 2019
ddb16d5
Fix typos.
fuqianggao Dec 17, 2019
91dfab2
Fix csds.proto.
fuqianggao Dec 17, 2019
1b264a1
Add more comments.
fuqianggao Dec 17, 2019
1df6184
Fix BUILD file.
fuqianggao Dec 18, 2019
ba5a647
Re-format csds.proto.
fuqianggao Dec 18, 2019
c66b01b
Add auto-generated v3alpha version of CSDS.
fuqianggao Dec 18, 2019
0917d31
Add more comments in csds.proto.
fuqianggao Dec 20, 2019
902e1cd
Update comment about CSDS.
fuqianggao Jan 2, 2020
8fb1ad7
Fix typo.
fuqianggao Jan 2, 2020
1c23e84
Update v3 version of csds.
fuqianggao Jan 2, 2020
231d0e2
Merge remote-tracking branch 'upstream/master'
fuqianggao Jan 7, 2020
01658f5
Add csds proto under service/status
fuqianggao Jan 7, 2020
eca74ce
Add build file.
fuqianggao Jan 7, 2020
16e1b9f
More changes to csds.
fuqianggao Jan 7, 2020
776cd4d
Fix v2 csds.
fuqianggao Jan 7, 2020
2f2dc9c
Fix build file.
fuqianggao Jan 8, 2020
a6f2d09
Fix v3alpha csds.proto.
fuqianggao Jan 8, 2020
70ff342
Add resource annotations.
fuqianggao Jan 8, 2020
92e168d
Run proto_format.py.
fuqianggao Jan 8, 2020
53edeb3
Update generated_api_shadow/envoy/service/status.
fuqianggao Jan 8, 2020
d98029c
Use node id instead of Node as identifier in request and response.
fuqianggao Jan 9, 2020
a0d9669
Remove */core dependency.
fuqianggao Jan 9, 2020
82f39d4
Update generated_api_shadow.
fuqianggao Jan 9, 2020
2c0c5bc
Change node_id to Node in CSDS response.
fuqianggao Jan 10, 2020
dc5aa98
Add NodeMatcher in CSDS Request.
fuqianggao Jan 14, 2020
f1d7efa
Patch v3alpha.
fuqianggao Jan 14, 2020
00e4f64
Fix comments.
fuqianggao Jan 14, 2020
f55b67f
Address comments.
fuqianggao Jan 14, 2020
888e83a
Add service/status/v2/* to doc tree.
fuqianggao Jan 15, 2020
ac709f0
Merge remote-tracking branch 'upstream/master'
fuqianggao Jan 16, 2020
1e75a0d
Change status/v3alpha to status/v3.
fuqianggao Jan 16, 2020
1ba7ef4
Update comment on csds.
fuqianggao Jan 16, 2020
a4ddf48
Update generated_api_shadow
fuqianggao Jan 16, 2020
98ead00
Kick CI
fuqianggao Jan 16, 2020
0a5b307
Change service name to ClientStatusDiscoveryService
fuqianggao Jan 17, 2020
7ca2ebe
Create separate NodeMatcher.
fuqianggao Jan 17, 2020
9ddf83a
Format node.proto.
fuqianggao Jan 17, 2020
5935355
Formatting
fuqianggao Jan 17, 2020
76440cc
Update generated_api_shadow
fuqianggao Jan 17, 2020
9733ff9
Add node.proto to docs rst.
fuqianggao Jan 17, 2020
b9ea675
Make MetadataMatcher repeated.
fuqianggao Jan 18, 2020
8cef120
Merge remote-tracking branch 'upstream/master'
fuqianggao Jan 21, 2020
a6a8bde
Address comments.
fuqianggao Jan 21, 2020
12eb167
Fix build file.
fuqianggao Jan 21, 2020
836b2e2
Add status to v3 doc.
fuqianggao Jan 21, 2020
e6f6716
Add protodoc-title in csds.proto.
fuqianggao Jan 21, 2020
540a0e5
Add node.proto to api-v3 doc tree.
fuqianggao Jan 21, 2020
b405e1c
Fix protodoc-title for all the proto under type/matcher
fuqianggao Jan 21, 2020
d5528f1
Updated generated api.
fuqianggao Jan 21, 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
2 changes: 2 additions & 0 deletions api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ proto_library(
"//envoy/service/load_stats/v2:pkg",
"//envoy/service/metrics/v2:pkg",
"//envoy/service/ratelimit/v2:pkg",
"//envoy/service/status/v2:pkg",
"//envoy/service/tap/v2alpha:pkg",
"//envoy/service/trace/v2:pkg",
"//envoy/type:pkg",
Expand Down Expand Up @@ -219,6 +220,7 @@ proto_library(
"//envoy/service/route/v3:pkg",
"//envoy/service/runtime/v3:pkg",
"//envoy/service/secret/v3:pkg",
"//envoy/service/status/v3:pkg",
"//envoy/service/tap/v3:pkg",
"//envoy/service/trace/v3:pkg",
"//envoy/type/matcher/v3:pkg",
Expand Down
1 change: 1 addition & 0 deletions api/docs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ proto_library(
"//envoy/service/load_stats/v2:pkg",
"//envoy/service/metrics/v2:pkg",
"//envoy/service/ratelimit/v2:pkg",
"//envoy/service/status/v2:pkg",
"//envoy/service/tap/v2alpha:pkg",
"//envoy/service/trace/v2:pkg",
"//envoy/type:pkg",
Expand Down
14 changes: 14 additions & 0 deletions api/envoy/service/status/v2/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/admin/v2alpha:pkg",
"//envoy/api/v2/core:pkg",
"//envoy/type/matcher:pkg",
],
)
86 changes: 86 additions & 0 deletions api/envoy/service/status/v2/csds.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
syntax = "proto3";

package envoy.service.status.v2;
htuch marked this conversation as resolved.
Show resolved Hide resolved

import "envoy/admin/v2alpha/config_dump.proto";
import "envoy/api/v2/core/base.proto";
import "envoy/type/matcher/node.proto";

import "google/api/annotations.proto";
import "google/protobuf/struct.proto";

option java_package = "io.envoyproxy.envoy.service.status.v2";
option java_outer_classname = "CsdsProto";
option java_multiple_files = true;
option java_generic_services = true;

// [#protodoc-title: Client Status Discovery Service (CSDS)]

// CSDS is Client Status Discovery Service. It can be used to get the status of
// an xDS-compliant client from the management server's point of view. In the
// future, it can potentially be used as an interface to get the current
// state directly from the client.
service ClientStatusDiscoveryService {
rpc StreamClientStatus(stream ClientStatusRequest) returns (stream ClientStatusResponse) {
}

rpc FetchClientStatus(ClientStatusRequest) returns (ClientStatusResponse) {
option (google.api.http).post = "/v2/discovery:client_status";
option (google.api.http).body = "*";
}
}

// Status of a config.
enum ConfigStatus {
// Status info is not available/unknown.
UNKNOWN = 0;

// Management server has sent the config to client and received ACK.
SYNCED = 1;

// Config is not sent.
NOT_SENT = 2;

// Management server has sent the config to client but hasn’t received
// ACK/NACK.
STALE = 3;

// Management server has sent the config to client but received NACK.
ERROR = 4;
}

// Request for client status of clients identified by a list of NodeMatchers.
message ClientStatusRequest {
// Management server can use these match criteria to identify clients.
// The match follows OR semantics.
repeated type.matcher.NodeMatcher node_matchers = 1;
}

// Detailed config (per xDS) with status.
// [#next-free-field: 6]
message PerXdsConfig {
ConfigStatus status = 1;

oneof per_xds_config {
admin.v2alpha.ListenersConfigDump listener_config = 2;

admin.v2alpha.ClustersConfigDump cluster_config = 3;

admin.v2alpha.RoutesConfigDump route_config = 4;

admin.v2alpha.ScopedRoutesConfigDump scoped_route_config = 5;
htuch marked this conversation as resolved.
Show resolved Hide resolved
}
}

// All xds configs for a particular client.
message ClientConfig {
// Node for a particular client.
api.v2.core.Node node = 1;

repeated PerXdsConfig xds_config = 2;
}

message ClientStatusResponse {
// Client configs for the clients specified in the ClientStatusRequest.
repeated ClientConfig config = 1;
}
16 changes: 16 additions & 0 deletions api/envoy/service/status/v3/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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/admin/v3:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/service/status/v2:pkg",
"//envoy/type/matcher/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
100 changes: 100 additions & 0 deletions api/envoy/service/status/v3/csds.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
syntax = "proto3";

package envoy.service.status.v3;

import "envoy/admin/v3/config_dump.proto";
import "envoy/config/core/v3/base.proto";
import "envoy/type/matcher/v3/node.proto";

import "google/api/annotations.proto";
import "google/protobuf/struct.proto";

import "udpa/annotations/versioning.proto";

option java_package = "io.envoyproxy.envoy.service.status.v3";
option java_outer_classname = "CsdsProto";
option java_multiple_files = true;
option java_generic_services = true;

// [#protodoc-title: Client Status Discovery Service (CSDS)]

// CSDS is Client Status Discovery Service. It can be used to get the status of
// an xDS-compliant client from the management server's point of view. In the
// future, it can potentially be used as an interface to get the current
// state directly from the client.
service ClientStatusDiscoveryService {
rpc StreamClientStatus(stream ClientStatusRequest) returns (stream ClientStatusResponse) {
}

rpc FetchClientStatus(ClientStatusRequest) returns (ClientStatusResponse) {
option (google.api.http).post = "/v3/discovery:client_status";
option (google.api.http).body = "*";
}
}

// Status of a config.
enum ConfigStatus {
// Status info is not available/unknown.
UNKNOWN = 0;

// Management server has sent the config to client and received ACK.
SYNCED = 1;

// Config is not sent.
NOT_SENT = 2;

// Management server has sent the config to client but hasn’t received
// ACK/NACK.
STALE = 3;

// Management server has sent the config to client but received NACK.
ERROR = 4;
}

// Request for client status of clients identified by a list of NodeMatchers.
message ClientStatusRequest {
option (udpa.annotations.versioning).previous_message_type =
"envoy.service.status.v2.ClientStatusRequest";

// Management server can use these match criteria to identify clients.
// The match follows OR semantics.
repeated type.matcher.v3.NodeMatcher node_matchers = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Do we need multiple of these if NodeMatcher is sufficiently expressive?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see how we could achieve requesting client status for multiple unique node ids with only a single NodeMatcher. For example, if I want to request client status for "client-abc", and "client-123", it's hard to come up with a match that will only select this two.

Copy link
Member

Choose a reason for hiding this comment

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

So this is an OR match, right? Can you clarify this in the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}

// Detailed config (per xDS) with status.
// [#next-free-field: 6]
message PerXdsConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.service.status.v2.PerXdsConfig";

ConfigStatus status = 1;

oneof per_xds_config {
admin.v3.ListenersConfigDump listener_config = 2;

admin.v3.ClustersConfigDump cluster_config = 3;

admin.v3.RoutesConfigDump route_config = 4;

admin.v3.ScopedRoutesConfigDump scoped_route_config = 5;
}
}

// All xds configs for a particular client.
message ClientConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.service.status.v2.ClientConfig";

// Node for a particular client.
config.core.v3.Node node = 1;

repeated PerXdsConfig xds_config = 2;
}

message ClientStatusResponse {
option (udpa.annotations.versioning).previous_message_type =
"envoy.service.status.v2.ClientStatusResponse";

// Client configs for the clients specified in the ClientStatusRequest.
repeated ClientConfig config = 1;
}
2 changes: 1 addition & 1 deletion api/envoy/type/matcher/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ option java_package = "io.envoyproxy.envoy.type.matcher";
option java_outer_classname = "MetadataProto";
option java_multiple_files = true;

// [#protodoc-title: MetadataMatcher]
// [#protodoc-title: Metadata matcher]

// MetadataMatcher provides a general interface to check if a given value is matched in
// :ref:`Metadata <envoy_api_msg_core.Metadata>`. It uses `filter` and `path` to retrieve the value
Expand Down
22 changes: 22 additions & 0 deletions api/envoy/type/matcher/node.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax = "proto3";

package envoy.type.matcher;

import "envoy/type/matcher/metadata.proto";
import "envoy/type/matcher/string.proto";

option java_package = "io.envoyproxy.envoy.type.matcher";
option java_outer_classname = "NodeProto";
option java_multiple_files = true;

// [#protodoc-title: Node matcher]

// Specifies the way to match a Node.
// The match follows AND semantics.
message NodeMatcher {
// Specifies match criteria on the node id.
StringMatcher node_id = 1;

// Specifies match criteria on the node metadata.
repeated MetadataMatcher node_metadatas = 2;
}
2 changes: 1 addition & 1 deletion api/envoy/type/matcher/number.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ option java_package = "io.envoyproxy.envoy.type.matcher";
option java_outer_classname = "NumberProto";
option java_multiple_files = true;

// [#protodoc-title: NumberMatcher]
// [#protodoc-title: Number matcher]

// Specifies the way to match a double value.
message DoubleMatcher {
Expand Down
2 changes: 1 addition & 1 deletion api/envoy/type/matcher/regex.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ option java_package = "io.envoyproxy.envoy.type.matcher";
option java_outer_classname = "RegexProto";
option java_multiple_files = true;

// [#protodoc-title: RegexMatcher]
// [#protodoc-title: Regex matcher]

// A regex matcher designed for safety when used with untrusted input.
message RegexMatcher {
Expand Down
2 changes: 1 addition & 1 deletion api/envoy/type/matcher/string.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ option java_package = "io.envoyproxy.envoy.type.matcher";
option java_outer_classname = "StringProto";
option java_multiple_files = true;

// [#protodoc-title: StringMatcher]
// [#protodoc-title: String matcher]

// Specifies the way to match a string.
// [#next-free-field: 6]
Expand Down
2 changes: 1 addition & 1 deletion api/envoy/type/matcher/v3/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ option java_package = "io.envoyproxy.envoy.type.matcher.v3";
option java_outer_classname = "MetadataProto";
option java_multiple_files = true;

// [#protodoc-title: MetadataMatcher]
// [#protodoc-title: Metadata matcher]

// MetadataMatcher provides a general interface to check if a given value is matched in
// :ref:`Metadata <envoy_api_msg_config.core.v3.Metadata>`. It uses `filter` and `path` to retrieve the value
Expand Down
26 changes: 26 additions & 0 deletions api/envoy/type/matcher/v3/node.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "proto3";

package envoy.type.matcher.v3;

import "envoy/type/matcher/v3/metadata.proto";
import "envoy/type/matcher/v3/string.proto";

import "udpa/annotations/versioning.proto";

option java_package = "io.envoyproxy.envoy.type.matcher.v3";
option java_outer_classname = "NodeProto";
option java_multiple_files = true;

// [#protodoc-title: Node matcher]

// Specifies the way to match a Node.
// The match follows AND semantics.
message NodeMatcher {
option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.NodeMatcher";

// Specifies match criteria on the node id.
StringMatcher node_id = 1;

// Specifies match criteria on the node metadata.
repeated MetadataMatcher node_metadatas = 2;
Copy link
Member

Choose a reason for hiding this comment

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

Is this AND semantics? Might it be the case that someone one day wants OR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is intended to be AND. If OR is needed, one can have repeated NodeMatcher, and only include either node_id or node_metadatas in them.

Copy link
Member

Choose a reason for hiding this comment

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

Can you clarify this in the docs per my other comment both here and there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thank you.

}
2 changes: 1 addition & 1 deletion api/envoy/type/matcher/v3/number.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ option java_package = "io.envoyproxy.envoy.type.matcher.v3";
option java_outer_classname = "NumberProto";
option java_multiple_files = true;

// [#protodoc-title: NumberMatcher]
// [#protodoc-title: Number matcher]

// Specifies the way to match a double value.
message DoubleMatcher {
Expand Down
2 changes: 1 addition & 1 deletion api/envoy/type/matcher/v3/regex.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ option java_package = "io.envoyproxy.envoy.type.matcher.v3";
option java_outer_classname = "RegexProto";
option java_multiple_files = true;

// [#protodoc-title: RegexMatcher]
// [#protodoc-title: Regex matcher]

// A regex matcher designed for safety when used with untrusted input.
message RegexMatcher {
Expand Down
2 changes: 1 addition & 1 deletion api/envoy/type/matcher/v3/string.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ option java_package = "io.envoyproxy.envoy.type.matcher.v3";
option java_outer_classname = "StringProto";
option java_multiple_files = true;

// [#protodoc-title: StringMatcher]
// [#protodoc-title: String matcher]

// Specifies the way to match a string.
// [#next-free-field: 6]
Expand Down
2 changes: 1 addition & 1 deletion api/envoy/type/matcher/v3/value.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ option java_package = "io.envoyproxy.envoy.type.matcher.v3";
option java_outer_classname = "ValueProto";
option java_multiple_files = true;

// [#protodoc-title: ValueMatcher]
// [#protodoc-title: Value matcher]

// Specifies the way to match a ProtobufWkt::Value. Primitive values and ListValue are supported.
// StructValue is not supported and is always not matched.
Expand Down
2 changes: 1 addition & 1 deletion api/envoy/type/matcher/value.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ option java_package = "io.envoyproxy.envoy.type.matcher";
option java_outer_classname = "ValueProto";
option java_multiple_files = true;

// [#protodoc-title: ValueMatcher]
// [#protodoc-title: Value matcher]

// Specifies the way to match a ProtobufWkt::Value. Primitive values and ListValue are supported.
// StructValue is not supported and is always not matched.
Expand Down
1 change: 1 addition & 0 deletions docs/root/api-v2/service/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ Services
discovery/v2/*
metrics/v2/*
ratelimit/v2/*
status/v2/*
tap/v2alpha/*
trace/v2/*
1 change: 1 addition & 0 deletions docs/root/api-v2/types/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Types
../type/semantic_version.proto
../type/token_bucket.proto
../type/matcher/metadata.proto
../type/matcher/node.proto
../type/matcher/number.proto
../type/matcher/regex.proto
../type/matcher/string.proto
Expand Down
Loading