Skip to content

Commit da27d8b

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

9 files changed

Lines changed: 235 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: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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/struct.proto";
9+
import "google/protobuf/timestamp.proto";
10+
import "google/rpc/status.proto";
11+
12+
import "udpa/annotations/status.proto";
13+
import "validate/validate.proto";
14+
15+
option java_package = "io.envoyproxy.envoy.extensions.reverse_tunnel_reporters.v3alpha.clients.grpc_client";
16+
option java_outer_classname = "StreamReverseTunnelsProto";
17+
option java_multiple_files = true;
18+
option go_package = "github.com/envoyproxy/go-control-plane/contrib/envoy/extensions/reverse_tunnel_reporters/v3alpha/clients/grpc_client";
19+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
20+
21+
// [#protodoc-title: Reverse Tunnel Reporting Service]
22+
23+
// ReverseTunnelReportingService allows Envoy instances to report reverse tunnel
24+
// connection state changes to a management server for monitoring and coordination.
25+
service ReverseTunnelReportingService {
26+
// Bidirectional stream for reporting reverse tunnel connection state changes.
27+
// The management server can control reporting intervals and acknowledge received reports.
28+
rpc StreamReverseTunnels(stream StreamReverseTunnelsRequest)
29+
returns (stream StreamReverseTunnelsResponse) {
30+
}
31+
}
32+
33+
// Request message sent by Envoy to report reverse tunnel state changes.
34+
// [#next-free-field: 7]
35+
message StreamReverseTunnelsRequest {
36+
// Node identifier for the reporting Envoy instance.
37+
// This identifies which Envoy instance is sending the report.
38+
config.core.v3.Node node = 1 [(validate.rules).message = {required: true}];
39+
40+
// List of reverse tunnels that were established since the last report.
41+
// Each tunnel represents a new connection from a downstream Envoy.
42+
repeated ReverseTunnel added_tunnels = 2;
43+
44+
// List of tunnel names that were disconnected since the last report.
45+
// Only the tunnel name is needed for removal notifications.
46+
repeated string removed_tunnel_names = 3
47+
[(validate.rules).repeated = {items {string {min_len: 1}}}];
48+
49+
// Optional metadata for additional context or debugging information.
50+
// Can include deployment information, version details, etc.
51+
google.protobuf.Struct metadata = 4;
52+
53+
// Indicates whether this report contains all active tunnels (true) or
54+
// only changes since the last report (false). Usually invoked only on server disconnects.
55+
bool full_push = 5;
56+
57+
// Unique nonce for this request to enable proper ACK/NACK handling.
58+
// Must be non-negative and should increment for each request.
59+
// This can also be modified to be used for checksum and tracking in the future.a
60+
int64 nonce = 6 [(validate.rules).int64 = {gte: 0}];
61+
}
62+
63+
// Response message sent by the management server to control reporting behavior.
64+
message StreamReverseTunnelsResponse {
65+
// Node identifier acknowledging which Envoy instance this response is for.
66+
// Should match the node from the corresponding request.
67+
config.core.v3.Node node = 1;
68+
69+
// Interval at which Envoy should send tunnel state reports.
70+
// This is used to change the reporting_interval -> no need to repeat the same value.
71+
google.protobuf.Duration report_interval = 2 [(validate.rules).duration = {lte {seconds: 3600}}];
72+
73+
// Nonce from the request being acknowledged or rejected.
74+
// Must match the nonce from the corresponding request.
75+
int64 request_nonce = 3 [(validate.rules).int64 = {gte: 0}];
76+
77+
// Error details if the previous request failed processing.
78+
// If populated, indicates the request was rejected (NACK).
79+
// If empty, indicates successful processing (ACK).
80+
// NACK will terminate the connection -> useful for logging rather than just some disconnect.
81+
// So basically -> NACK then terminate.
82+
google.rpc.Status error_detail = 4;
83+
}
84+
85+
// Represents a single reverse tunnel connection with its metadata.
86+
message ReverseTunnel {
87+
// Unique name to identify this tunnel connection.
88+
// Typically formatted as "{node_id}|{cluster_id}" or similar.
89+
// Must be unique within the reporting Envoy instance.
90+
// This is also used for the reporting the disconnection with the associated tunnel initiator.
91+
string name = 1 [(validate.rules).string = {min_len: 1}];
92+
93+
// Detailed information about the tunnel connection.
94+
ReverseTunnelInfo tunnel_info = 2 [(validate.rules).message = {required: true}];
95+
}
96+
97+
// Detailed information about a reverse tunnel connection.
98+
message ReverseTunnelInfo {
99+
// Identity information of the tunnel initiator (downstream Envoy).
100+
// Contains node_id, cluster_id, and tenant_id for proper identification.
101+
TunnelInitiatorIdentity identity = 1 [(validate.rules).message = {required: true}];
102+
103+
// Timestamp when this tunnel connection was created.
104+
// Used for ordering events and debugging connection timing issues.
105+
google.protobuf.Timestamp created_at = 2 [(validate.rules).timestamp = {required: true}];
106+
}
107+
108+
message TunnelInitiatorIdentity {
109+
// Required: Tenant identifier of the initiating Envoy instance.
110+
string tenant_id = 1 [(validate.rules).string = {min_len: 1 max_len: 128}];
111+
112+
// Required: Cluster identifier of the initiating Envoy instance.
113+
string cluster_id = 2 [(validate.rules).string = {min_len: 1 max_len: 128}];
114+
115+
// Required: Node identifier of the initiating Envoy instance.
116+
string node_id = 3 [(validate.rules).string = {min_len: 1 max_len: 128}];
117+
}
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",

docs/root/api-v3/config/contrib/contrib.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ Contrib extensions
2121
tap_sinks/tap_sinks
2222
load_balancing_policies/peak_ewma/peak_ewma
2323
istio/istio
24+
reverse_tunnel_reporter/reverse_tunnel_reporter
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Reverse tunnel reporter
2+
=======================
3+
4+
.. toctree::
5+
:glob:
6+
:maxdepth: 2
7+
8+
../../../extensions/reverse_tunnel_reporters/v3alpha/clients/grpc_client/*
9+
../../../extensions/reverse_tunnel_reporters/v3alpha/reporters/*

0 commit comments

Comments
 (0)