Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
50 changes: 47 additions & 3 deletions api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ api_proto_library(
":address",
":base",
":cds",
":config_source",
":grpc_service",
":lds",
":sds",
":stats",
Expand All @@ -64,6 +66,8 @@ go_proto_library(
":address_go_proto",
":base_go_proto",
":cds_go_grpc",
":config_source_go_proto",
":grpc_service_go_proto",
":lds_go_grpc",
":sds_go_grpc",
":stats_go_proto",
Expand Down Expand Up @@ -100,6 +104,7 @@ api_proto_library(
deps = [
":address",
":base",
":config_source",
":discovery",
":health_check",
":protocol",
Expand All @@ -115,6 +120,7 @@ go_grpc_library(
deps = [
":address_go_proto",
":base_go_proto",
":config_source_go_proto",
":discovery_go_grpc",
":health_check_go_proto",
":protocol_go_proto",
Expand All @@ -128,6 +134,29 @@ go_grpc_library(
],
)

api_proto_library(
name = "config_source",
srcs = ["config_source.proto"],
deps = [
":base",
":grpc_service",
],
)

go_proto_library(
name = "config_source_go_proto",
importpath = "github.com/envoyproxy/data-plane-api/api/config_source",
proto = ":config_source",
visibility = ["//visibility:public"],
deps = [
":base_go_proto",
":grpc_service_go_proto",
"@com_github_gogo_protobuf//:gogo_proto_go",
"@com_github_golang_protobuf//ptypes/duration:go_default_library",
"@com_lyft_protoc_gen_validate//validate:go_default_library",
],
)

api_proto_library(
name = "discovery",
srcs = ["discovery.proto"],
Expand Down Expand Up @@ -176,8 +205,21 @@ go_grpc_library(
)

api_proto_library(
name = "grpc_cluster",
srcs = ["grpc_cluster.proto"],
name = "grpc_service",
srcs = ["grpc_service.proto"],
deps = [":base"],
)

go_proto_library(
name = "grpc_service_go_proto",
importpath = "github.com/envoyproxy/data-plane-api/api/grpc_service",
proto = ":grpc_service",
visibility = ["//visibility:public"],
deps = [
":base_go_proto",
"@com_github_golang_protobuf//ptypes/duration:go_default_library",
"@com_lyft_protoc_gen_validate//validate:go_default_library",
],
)

api_proto_library(
Expand Down Expand Up @@ -239,7 +281,7 @@ api_proto_library(
require_py = 0,
deps = [
":base",
":grpc_cluster",
":grpc_service",
"@promotheus_metrics_model//:client_model",
],
)
Expand Down Expand Up @@ -310,6 +352,7 @@ api_proto_library(
has_services = 1,
deps = [
":base",
":config_source",
":discovery",
],
)
Expand All @@ -321,6 +364,7 @@ go_grpc_library(
visibility = ["//visibility:public"],
deps = [
":base_go_proto",
":config_source_go_proto",
":discovery_go_grpc",
"@com_github_golang_protobuf//ptypes/wrappers:go_default_library",
"@com_lyft_protoc_gen_validate//validate:go_default_library",
Expand Down
56 changes: 0 additions & 56 deletions api/base.proto
Original file line number Diff line number Diff line change
Expand Up @@ -173,62 +173,6 @@ message DataSource {
}
}

// API configuration source. This identifies the API type and cluster that Envoy
// will use to fetch an xDS API.
message ApiConfigSource {
// APIs may be fetched via either REST or gRPC.
enum ApiType {
// REST-JSON legacy corresponds to the v1 API.
REST_LEGACY = 0;
// REST-JSON v2 API. The `canonical JSON encoding
// <https://developers.google.com/protocol-buffers/docs/proto3#json>`_ for
// the v2 protos is used.
REST = 1;
// gRPC v2 API.
GRPC = 2;
}
ApiType api_type = 1 [(validate.rules).enum.defined_only = true];
// Multiple cluster names may be provided. If > 1 cluster is defined, clusters
// will be cycled through if any kind of failure occurs.
//
// .. note::
//
// The cluster with name ``cluster_name`` must be statically defined and its
// type must not be ``EDS``.
repeated string cluster_name = 2 [(validate.rules).repeated .min_items = 1];
// For REST APIs, the delay between successive polls.
google.protobuf.Duration refresh_delay = 3 [(gogoproto.stdduration) = true];
}

// Aggregated Discovery Service (ADS) options. This is currently empty, but when
// set in :ref:`ConfigSource <envoy_api_msg_ConfigSource>` can be used to
// specify that ADS is to be used.
message AggregatedConfigSource {
}

// Configuration for :ref:`listeners <config_listeners>`, :ref:`clusters
// <config_cluster_manager_cluster>`, :ref:`routes
// <config_http_conn_man_route_table>`, :ref:`endpoints
// <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.
message ConfigSource {
oneof config_source_specifier {
option (validate.required) = true;
// Path on the filesystem to source and watch for configuration updates.
//
// .. note::
//
// The path to the source must exist at config load time.
string path = 1;
// API configuration source.
ApiConfigSource api_config_source = 2;
// When set, ADS will be used to fetch resources. The ADS API configuration
// source in the bootstrap configuration is used.
AggregatedConfigSource ads = 3;
}
}

// Configuration for transport socket in :ref:`listeners <config_listeners>` and
// :ref:`clusters <config_cluster_manager_cluster>`. If the configuration is
// empty, a default transport socket implementation and configuration will be
Expand Down
22 changes: 18 additions & 4 deletions api/bootstrap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ package envoy.api.v2;

import "api/address.proto";
import "api/base.proto";
import "api/config_source.proto";
import "api/cds.proto";
import "api/grpc_service.proto";
import "api/lds.proto";
import "api/sds.proto";
import "api/stats.proto";
Expand Down Expand Up @@ -208,8 +210,20 @@ message Runtime {

// Rate limit :ref:`configuration overview <config_rate_limit_service>`.
message RateLimitServiceConfig {
// Specifies the cluster manager cluster name that hosts the rate limit
// service. The client will connect to this cluster when it needs to make rate
// limit service requests.
string cluster_name = 1 [(validate.rules).string.min_bytes = 1];
oneof service_specifier {
option (validate.required) = true;

// Specifies the cluster manager cluster name that hosts the rate limit
// service. The client will connect to this cluster when it needs to make
// rate limit service requests. This field is deprecated and `grpc_service`
// should be used instead. The :ref:`Envoy gRPC client
// <envoy_api_field_GrpcService.envoy_grpc>` will be used when this field is
// specified.
string cluster_name = 1 [(validate.rules).string.min_bytes = 1, deprecated = true];

// Specifies the gRPC service that hosts the rate limit service. The client
// will connect to this cluster when it needs to make rate limit service
// requests.
GrpcService grpc_service = 2;
}
}
1 change: 1 addition & 0 deletions api/cds.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package envoy.api.v2;

import "api/address.proto";
import "api/base.proto";
import "api/config_source.proto";
import "api/discovery.proto";
import "api/health_check.proto";
import "api/protocol.proto";
Expand Down
79 changes: 79 additions & 0 deletions api/config_source.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
syntax = "proto3";

package envoy.api.v2;

import "api/grpc_service.proto";

import "google/protobuf/duration.proto";

import "validate/validate.proto";
import "gogoproto/gogo.proto";

// [#protodoc-title: Configuration sources]

// API configuration source. This identifies the API type and cluster that Envoy
// will use to fetch an xDS API.
message ApiConfigSource {
// APIs may be fetched via either REST or gRPC.
enum ApiType {
// REST-JSON legacy corresponds to the v1 API.
REST_LEGACY = 0;
// REST-JSON v2 API. The `canonical JSON encoding
// <https://developers.google.com/protocol-buffers/docs/proto3#json>`_ for
// the v2 protos is used.
REST = 1;
// gRPC v2 API.
GRPC = 2;
}
ApiType api_type = 1 [(validate.rules).enum.defined_only = true];
// Multiple cluster names may be provided for REST_LEGACY/REST. If > 1
// cluster is defined, clusters will be cycled through if any kind of failure
// occurs.
//
// .. note::
//
// The cluster with name ``cluster_name`` must be statically defined and its
// type must not be ``EDS``.
repeated string cluster_names = 2;

// Multiple gRPC services be provided for GRPC. If > 1 cluster is defined,
// services will be cycled through if any kind of failure occurs.
//
// .. note::
//
// If a gRPC service points to a ``cluster_name``, it must be statically
// defined and its type must not be ``EDS``.
repeated GrpcService grpc_services = 4;

// For REST APIs, the delay between successive polls.
google.protobuf.Duration refresh_delay = 3 [(gogoproto.stdduration) = true];
}

// Aggregated Discovery Service (ADS) options. This is currently empty, but when
// set in :ref:`ConfigSource <envoy_api_msg_ConfigSource>` can be used to
// specify that ADS is to be used.
message AggregatedConfigSource {
}

// Configuration for :ref:`listeners <config_listeners>`, :ref:`clusters
// <config_cluster_manager_cluster>`, :ref:`routes
// <config_http_conn_man_route_table>`, :ref:`endpoints
// <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.
message ConfigSource {
oneof config_source_specifier {
option (validate.required) = true;
// Path on the filesystem to source and watch for configuration updates.
//
// .. note::
//
// The path to the source must exist at config load time.
string path = 1;
// API configuration source.
ApiConfigSource api_config_source = 2;
// When set, ADS will be used to fetch resources. The ADS API configuration
// source in the bootstrap configuration is used.
AggregatedConfigSource ads = 3;
}
}
2 changes: 1 addition & 1 deletion api/filter/accesslog/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ api_proto_library(
deps = [
"//api:address",
"//api:base",
"//api:grpc_cluster",
"//api:grpc_service",
],
)
6 changes: 3 additions & 3 deletions api/filter/accesslog/accesslog.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ option go_package = "accesslog";

import "api/address.proto";
import "api/base.proto";
import "api/grpc_cluster.proto";
import "api/grpc_service.proto";

import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
Expand Down Expand Up @@ -432,8 +432,8 @@ message CommonGrpcAccessLogConfig {
// same Envoy.
string log_name = 1 [(validate.rules).string.min_bytes = 1];

// The upstream gRPC cluster that hosts the access log service.
GrpcCluster cluster = 2 [(validate.rules).message.required = true];
// The gRPC service for the access log service.
GrpcService grpc_service = 2 [(validate.rules).message.required = true];
}

// [#proto-status: experimental]
Expand Down
2 changes: 1 addition & 1 deletion api/filter/http/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ api_proto_library(
api_proto_library(
name = "ext_authz",
srcs = ["ext_authz.proto"],
deps = ["//api:grpc_cluster"],
deps = ["//api:grpc_service"],
)
4 changes: 2 additions & 2 deletions api/filter/http/ext_authz.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package envoy.api.v2.filter.http;

import "api/grpc_cluster.proto";
import "api/grpc_service.proto";

import "validate/validate.proto";

Expand All @@ -13,7 +13,7 @@ import "validate/validate.proto";
message ExtAuthz {

// The external authorization gRPC service configuration.
GrpcCluster grpc_cluster = 1;
GrpcService grpc_service = 1;

// The filter's behaviour in case the external authorization service does
// not respond back. If set to true then in case of failure to get a
Expand Down
3 changes: 2 additions & 1 deletion api/filter/network/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ api_proto_library(
srcs = ["http_connection_manager.proto"],
deps = [
"//api:base",
"//api:config_source",
"//api:protocol",
"//api:rds",
"//api/filter/accesslog",
Expand Down Expand Up @@ -48,5 +49,5 @@ api_proto_library(
api_proto_library(
name = "ext_authz",
srcs = ["ext_authz.proto"],
deps = ["//api:grpc_cluster"],
deps = ["//api:grpc_service"],
)
4 changes: 2 additions & 2 deletions api/filter/network/ext_authz.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package envoy.api.v2.filter.network;

import "api/grpc_cluster.proto";
import "api/grpc_service.proto";

import "validate/validate.proto";

Expand All @@ -15,7 +15,7 @@ message ExtAuthz {
string stat_prefix = 1 [(validate.rules).string.min_bytes = 1];

// The external authorization gRPC service configuration.
GrpcCluster grpc_cluster = 2;
GrpcService grpc_service = 2;

// The filter's behaviour in case the external authorization service does
// not respond back. If set to true then in case of failure to get a
Expand Down
1 change: 1 addition & 0 deletions api/filter/network/http_connection_manager.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package envoy.api.v2.filter.network;
option go_package = "network";

import "api/base.proto";
import "api/config_source.proto";
import "api/protocol.proto";
import "api/rds.proto";
import "api/filter/accesslog/accesslog.proto";
Expand Down
Loading