Skip to content

Commit 31f9a7b

Browse files
committed
Add protos for contrib reverse tunnel reporting service
Signed-off-by: aakugan <aakashganapathy2@gmail.com>
1 parent 471992d commit 31f9a7b

7 files changed

Lines changed: 213 additions & 0 deletions

File tree

api/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ proto_library(
104104
"//contrib/envoy/extensions/private_key_providers/kae/v3alpha:pkg",
105105
"//contrib/envoy/extensions/private_key_providers/qat/v3alpha:pkg",
106106
"//contrib/envoy/extensions/regex_engines/hyperscan/v3alpha:pkg",
107+
"//contrib/envoy/extensions/reverse_tunnel_reporters/v3alpha/clients/grpc_client:pkg",
108+
"//contrib/envoy/extensions/reverse_tunnel_reporters/v3alpha/reporters:pkg",
107109
"//contrib/envoy/extensions/router/cluster_specifier/golang/v3alpha:pkg",
108110
"//contrib/envoy/extensions/stat_sinks/kafka/v3:pkg",
109111
"//contrib/envoy/extensions/tap_sinks/udp_sink/v3alpha:pkg",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py.
2+
3+
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
4+
5+
licenses(["notice"]) # Apache 2
6+
7+
api_proto_package(
8+
has_services = True,
9+
deps = [
10+
"//envoy/config/core/v3:pkg",
11+
"@xds//udpa/annotations:pkg",
12+
],
13+
)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
syntax = "proto3";
2+
3+
package envoy.extensions.reverse_tunnel_reporters.v3alpha.clients.grpc_client;
4+
5+
import "google/protobuf/duration.proto";
6+
7+
import "udpa/annotations/status.proto";
8+
import "validate/validate.proto";
9+
10+
option java_package = "io.envoyproxy.envoy.extensions.reverse_tunnel_reporters.v3alpha.clients.grpc_client";
11+
option java_outer_classname = "GrpcClientProto";
12+
option java_multiple_files = true;
13+
option go_package = "github.com/envoyproxy/go-control-plane/contrib/envoy/extensions/reverse_tunnel_reporters/v3alpha/clients/grpc_client";
14+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
15+
16+
// Configuration for gRPC push-based connection event client.
17+
// Actively pushes connection events to a cluster using grpc using some internal timing.
18+
// [#next-free-field: 7]
19+
message GrpcClientConfig {
20+
// Stat prefix for this client's metrics.
21+
string stat_prefix = 1;
22+
23+
// Name of the cluster to send gRPC requests to.
24+
// It must be present in the config otherwise the setup will throw error in the onServerInitialized.
25+
string cluster = 2 [(validate.rules).string = {min_len: 1}];
26+
27+
// Default interval between sending batched connection events.
28+
// Default is 5s.
29+
google.protobuf.Duration default_send_interval = 3 [(validate.rules).duration = {
30+
lte {seconds: 3600}
31+
gte {nanos: 25000000}
32+
}];
33+
34+
// Interval between connection retry attempts to the gRPC service.
35+
// Connect timeouts are provided at the cluster level and will be handled by the http/2 client.
36+
// How much time to wait after a failed connect before retrying. Default is 5s.
37+
google.protobuf.Duration connect_retry_interval = 4 [(validate.rules).duration = {
38+
lte {seconds: 3600}
39+
gte {nanos: 25000000}
40+
}];
41+
42+
// Maximum number of retry attempts for failed gRPC sends.
43+
// Basically the cluster will have default_send_interval * max_retries time to respond.
44+
// Default is 5. After this we will disconnect and try to connect again.
45+
uint32 max_retries = 5;
46+
47+
// Maximum events to buffer at any given time
48+
// Default is 1,000,000.
49+
uint32 max_buffer = 6;
50+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
syntax = "proto3";
2+
3+
package envoy.extensions.reverse_tunnel_reporters.v3alpha.clients.grpc_client;
4+
5+
import "envoy/config/core/v3/base.proto";
6+
7+
import "google/protobuf/duration.proto";
8+
import "google/protobuf/timestamp.proto";
9+
import "google/rpc/status.proto";
10+
11+
import "udpa/annotations/status.proto";
12+
import "validate/validate.proto";
13+
14+
option java_package = "io.envoyproxy.envoy.extensions.reverse_tunnel_reporters.v3alpha.clients.grpc_client";
15+
option java_outer_classname = "StreamReverseTunnelsProto";
16+
option java_multiple_files = true;
17+
option go_package = "github.com/envoyproxy/go-control-plane/contrib/envoy/extensions/reverse_tunnel_reporters/v3alpha/clients/grpc_client";
18+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
19+
20+
// [#protodoc-title: Reverse Tunnel Reporting Service]
21+
22+
// ReverseTunnelReportingService allows Envoy instances to report reverse tunnel
23+
// connection state changes to a management server for monitoring and coordination.
24+
service ReverseTunnelReportingService {
25+
// Bidirectional stream for reporting reverse tunnel connection state changes.
26+
// The management server can control reporting intervals and acknowledge received reports.
27+
rpc StreamReverseTunnels(stream StreamReverseTunnelsRequest)
28+
returns (stream StreamReverseTunnelsResponse) {
29+
}
30+
}
31+
32+
// Request message sent by Envoy to report reverse tunnel state changes.
33+
// [#next-free-field: 6]
34+
message StreamReverseTunnelsRequest {
35+
// Node identifier for the reporting Envoy instance.
36+
// This identifies which Envoy instance is sending the report.
37+
config.core.v3.Node node = 1 [(validate.rules).message = {required: true}];
38+
39+
// List of reverse tunnels that were established since the last report.
40+
// Each tunnel represents a new connection from a downstream Envoy.
41+
repeated ReverseTunnel added_tunnels = 2;
42+
43+
// List of tunnel names that were disconnected since the last report.
44+
// Only the tunnel name is needed for removal notifications.
45+
repeated string removed_tunnel_names = 3
46+
[(validate.rules).repeated = {items {string {min_len: 1}}}];
47+
48+
// Indicates whether this report contains all active tunnels (true) or
49+
// only changes since the last report (false). Usually invoked only on server disconnects.
50+
bool full_push = 4;
51+
52+
// Unique nonce for this request to enable proper ACK/NACK handling.
53+
// Must be non-negative and should increment for each request.
54+
// This can also be modified to be used for checksum and tracking in the future.
55+
int64 nonce = 5 [(validate.rules).int64 = {gte: 0}];
56+
}
57+
58+
// Response message sent by the management server to control reporting behavior.
59+
message StreamReverseTunnelsResponse {
60+
// Node identifier acknowledging which Envoy instance this response is for.
61+
// Should match the node from the corresponding request.
62+
string node_id = 1;
63+
64+
// Interval at which Envoy should send tunnel state reports.
65+
// This is used to change the reporting_interval -> no need to repeat the same value.
66+
google.protobuf.Duration report_interval = 2 [(validate.rules).duration = {lte {seconds: 3600}}];
67+
68+
// Nonce from the request being acknowledged or rejected.
69+
// Must match the nonce from the corresponding request.
70+
int64 request_nonce = 3 [(validate.rules).int64 = {gte: 0}];
71+
72+
// Error details if the previous request failed processing.
73+
// If populated, indicates the request was rejected (NACK).
74+
// If empty, indicates successful processing (ACK).
75+
// NACK will terminate the connection -> useful for logging rather than just some disconnect.
76+
// So basically -> NACK then terminate.
77+
google.rpc.Status error_detail = 4;
78+
}
79+
80+
// Represents a single reverse tunnel connection with its metadata.
81+
message ReverseTunnel {
82+
// Unique name to identify this tunnel connection.
83+
// Must be unique within the reporting Envoy instance.
84+
// This is also used for the reporting the disconnection with the associated tunnel initiator.
85+
string name = 1 [(validate.rules).string = {min_len: 1}];
86+
87+
// Identity information of the tunnel initiator (downstream Envoy).
88+
// Contains ``node_id``, ``cluster_id``, and ``tenant_id`` for proper identification.
89+
TunnelInitiatorIdentity identity = 2 [(validate.rules).message = {required: true}];
90+
91+
// Timestamp when this tunnel connection was created.
92+
// Used for ordering events and debugging connection timing issues.
93+
google.protobuf.Timestamp created_at = 3 [(validate.rules).timestamp = {required: true}];
94+
}
95+
96+
message TunnelInitiatorIdentity {
97+
// Required: Tenant identifier of the initiating Envoy instance.
98+
string tenant_id = 1 [(validate.rules).string = {min_len: 1 max_len: 128}];
99+
100+
// Required: Cluster identifier of the initiating Envoy instance.
101+
string cluster_id = 2 [(validate.rules).string = {min_len: 1 max_len: 128}];
102+
103+
// Required: Node identifier of the initiating Envoy instance.
104+
string node_id = 3 [(validate.rules).string = {min_len: 1 max_len: 128}];
105+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py.
2+
3+
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
4+
5+
licenses(["notice"]) # Apache 2
6+
7+
api_proto_package(
8+
deps = ["@xds//udpa/annotations:pkg"],
9+
)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
syntax = "proto3";
2+
3+
package envoy.extensions.reverse_tunnel_reporters.v3alpha.reporters;
4+
5+
import "google/protobuf/any.proto";
6+
7+
import "udpa/annotations/status.proto";
8+
import "validate/validate.proto";
9+
10+
option java_package = "io.envoyproxy.envoy.extensions.reverse_tunnel_reporters.v3alpha.reporters";
11+
option java_outer_classname = "EventReporterProto";
12+
option java_multiple_files = true;
13+
option go_package = "github.com/envoyproxy/go-control-plane/contrib/envoy/extensions/reverse_tunnel_reporters/v3alpha/reporters";
14+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
15+
16+
message ReverseConnectionReporterClient {
17+
// Name to use to pick out the client should match the one reported by the factory.
18+
string name = 1 [(validate.rules).string = {min_len: 1}];
19+
20+
// Typed config for the client
21+
google.protobuf.Any typed_config = 2 [(validate.rules).any = {required: true}];
22+
}
23+
24+
// Configuration for the connection event reporter.
25+
message EventReporterConfig {
26+
// Stat prefix for this reporter's metrics.
27+
// Metrics will be emitted as ``{stat_prefix}.events_pushed``, etc.
28+
string stat_prefix = 1;
29+
30+
// List of clients to report to.
31+
repeated ReverseConnectionReporterClient clients = 2 [(validate.rules).repeated = {min_items: 1}];
32+
}

api/versioning/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ proto_library(
4343
"//contrib/envoy/extensions/private_key_providers/kae/v3alpha:pkg",
4444
"//contrib/envoy/extensions/private_key_providers/qat/v3alpha:pkg",
4545
"//contrib/envoy/extensions/regex_engines/hyperscan/v3alpha:pkg",
46+
"//contrib/envoy/extensions/reverse_tunnel_reporters/v3alpha/clients/grpc_client:pkg",
47+
"//contrib/envoy/extensions/reverse_tunnel_reporters/v3alpha/reporters:pkg",
4648
"//contrib/envoy/extensions/router/cluster_specifier/golang/v3alpha:pkg",
4749
"//contrib/envoy/extensions/stat_sinks/kafka/v3:pkg",
4850
"//contrib/envoy/extensions/tap_sinks/udp_sink/v3alpha:pkg",

0 commit comments

Comments
 (0)