1// Copyright 2020 The gRPC Authors 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15// Local copy of Envoy xDS proto file, used for testing only. 16 17syntax = "proto3"; 18 19package envoy.config.core.v3; 20 21import "src/proto/grpc/testing/xds/v3/percent.proto"; 22 23import "google/protobuf/any.proto"; 24import "google/protobuf/struct.proto"; 25 26// Identifies location of where either Envoy runs or where upstream hosts run. 27message Locality { 28 // Region this :ref:`zone <envoy_api_field_config.core.v3.Locality.zone>` belongs to. 29 string region = 1; 30 31 // Defines the local service zone where Envoy is running. Though optional, it 32 // should be set if discovery service routing is used and the discovery 33 // service exposes :ref:`zone data <envoy_api_field_config.endpoint.v3.LocalityLbEndpoints.locality>`, 34 // either in this message or via :option:`--service-zone`. The meaning of zone 35 // is context dependent, e.g. `Availability Zone (AZ) 36 // <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html>`_ 37 // on AWS, `Zone <https://cloud.google.com/compute/docs/regions-zones/>`_ on 38 // GCP, etc. 39 string zone = 2; 40 41 // When used for locality of upstream hosts, this field further splits zone 42 // into smaller chunks of sub-zones so they can be load balanced 43 // independently. 44 string sub_zone = 3; 45} 46 47// Identifies a specific Envoy instance. The node identifier is presented to the 48// management server, which may use this identifier to distinguish per Envoy 49// configuration for serving. 50// [#next-free-field: 12] 51message Node { 52 // An opaque node identifier for the Envoy node. This also provides the local 53 // service node name. It should be set if any of the following features are 54 // used: :ref:`statsd <arch_overview_statistics>`, :ref:`CDS 55 // <config_cluster_manager_cds>`, and :ref:`HTTP tracing 56 // <arch_overview_tracing>`, either in this message or via 57 // :option:`--service-node`. 58 string id = 1; 59 60 // Defines the local service cluster name where Envoy is running. Though 61 // optional, it should be set if any of the following features are used: 62 // :ref:`statsd <arch_overview_statistics>`, :ref:`health check cluster 63 // verification 64 // <envoy_api_field_config.core.v3.HealthCheck.HttpHealthCheck.service_name_matcher>`, 65 // :ref:`runtime override directory <envoy_api_msg_config.bootstrap.v3.Runtime>`, 66 // :ref:`user agent addition 67 // <envoy_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.add_user_agent>`, 68 // :ref:`HTTP global rate limiting <config_http_filters_rate_limit>`, 69 // :ref:`CDS <config_cluster_manager_cds>`, and :ref:`HTTP tracing 70 // <arch_overview_tracing>`, either in this message or via 71 // :option:`--service-cluster`. 72 string cluster = 2; 73 74 // Opaque metadata extending the node identifier. Envoy will pass this 75 // directly to the management server. 76 google.protobuf.Struct metadata = 3; 77 78 // Locality specifying where the Envoy instance is running. 79 Locality locality = 4; 80 81 // Free-form string that identifies the entity requesting config. 82 // E.g. "envoy" or "grpc" 83 string user_agent_name = 6; 84 85 oneof user_agent_version_type { 86 // Free-form string that identifies the version of the entity requesting config. 87 // E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild" 88 string user_agent_version = 7; 89 } 90 91 // Client feature support list. These are well known features described 92 // in the Envoy API repository for a given major version of an API. Client features 93 // use reverse DNS naming scheme, for example `com.acme.feature`. 94 // See :ref:`the list of features <client_features>` that xDS client may 95 // support. 96 repeated string client_features = 10; 97} 98 99// Data source consisting of either a file or an inline value. 100message DataSource {} 101 102// Runtime derived FractionalPercent with defaults for when the numerator or denominator is not 103// specified via a runtime key. 104// 105// .. note:: 106// 107// Parsing of the runtime key's data is implemented such that it may be represented as a 108// :ref:`FractionalPercent <envoy_api_msg_type.v3.FractionalPercent>` proto represented as JSON/YAML 109// and may also be represented as an integer with the assumption that the value is an integral 110// percentage out of 100. For instance, a runtime key lookup returning the value "42" would parse 111// as a `FractionalPercent` whose numerator is 42 and denominator is HUNDRED. 112message RuntimeFractionalPercent { 113 // Default value if the runtime value's for the numerator/denominator keys are not available. 114 type.v3.FractionalPercent default_value = 1; 115} 116 117// Configuration for transport socket in :ref:`listeners <config_listeners>` and 118// :ref:`clusters <envoy_api_msg_config.cluster.v3.Cluster>`. If the configuration is 119// empty, a default transport socket implementation and configuration will be 120// chosen based on the platform and existence of tls_context. 121message TransportSocket { 122 // The name of the transport socket to instantiate. The name must match a supported transport 123 // socket implementation. 124 string name = 1; 125 126 // Implementation specific configuration which depends on the implementation being instantiated. 127 // See the supported transport socket implementations for further documentation. 128 oneof config_type { 129 google.protobuf.Any typed_config = 3; 130 } 131} 132 133// Metadata provides additional inputs to filters based on matched listeners, 134// filter chains, routes and endpoints. It is structured as a map, usually from 135// filter name (in reverse DNS format) to metadata specific to the filter. Metadata 136// key-values for a filter are merged as connection and request handling occurs, 137// with later values for the same key overriding earlier values. 138// 139// An example use of metadata is providing additional values to 140// http_connection_manager in the envoy.http_connection_manager.access_log 141// namespace. 142// 143// Another example use of metadata is to per service config info in cluster metadata, which may get 144// consumed by multiple filters. 145// 146// For load balancing, Metadata provides a means to subset cluster endpoints. 147// Endpoints have a Metadata object associated and routes contain a Metadata 148// object to match against. There are some well defined metadata used today for 149// this purpose: 150// 151// * ``{"envoy.lb": {"canary": <bool> }}`` This indicates the canary status of an 152// endpoint and is also used during header processing 153// (x-envoy-upstream-canary) and for stats purposes. 154// [#next-major-version: move to type/metadata/v2] 155message Metadata { 156 // Key is the reverse DNS filter name, e.g. com.acme.widget. The ``envoy.*`` 157 // namespace is reserved for Envoy's built-in filters. 158 // If both ``filter_metadata`` and 159 // :ref:`typed_filter_metadata <envoy_v3_api_field_config.core.v3.Metadata.typed_filter_metadata>` 160 // fields are present in the metadata with same keys, 161 // only ``typed_filter_metadata`` field will be parsed. 162 map<string, google.protobuf.Struct> filter_metadata = 1; 163 164 // Key is the reverse DNS filter name, e.g. com.acme.widget. The ``envoy.*`` 165 // namespace is reserved for Envoy's built-in filters. 166 // The value is encoded as google.protobuf.Any. 167 // If both :ref:`filter_metadata <envoy_v3_api_field_config.core.v3.Metadata.filter_metadata>` 168 // and ``typed_filter_metadata`` fields are present in the metadata with same keys, 169 // only ``typed_filter_metadata`` field will be parsed. 170 map<string, google.protobuf.Any> typed_filter_metadata = 2; 171} 172