Thrift Proxy Route Configuration¶
Thrift Proxy configuration overview.
config.filter.network.thrift_proxy.v2alpha1.RouteConfiguration¶
[config.filter.network.thrift_proxy.v2alpha1.RouteConfiguration proto]
{
"name": "...",
"routes": []
}
- name
(string) The name of the route configuration. Reserved for future use in asynchronous route discovery.
- routes
(config.filter.network.thrift_proxy.v2alpha1.Route) The list of routes that will be matched, in order, against incoming requests. The first route that matches will be used.
config.filter.network.thrift_proxy.v2alpha1.Route¶
[config.filter.network.thrift_proxy.v2alpha1.Route proto]
{
"match": "{...}",
"route": "{...}"
}
- match
(config.filter.network.thrift_proxy.v2alpha1.RouteMatch, REQUIRED) Route matching parameters.
- route
(config.filter.network.thrift_proxy.v2alpha1.RouteAction, REQUIRED) Route request to some upstream cluster.
config.filter.network.thrift_proxy.v2alpha1.RouteMatch¶
[config.filter.network.thrift_proxy.v2alpha1.RouteMatch proto]
{
"method_name": "...",
"service_name": "...",
"invert": "...",
"headers": []
}
- method_name
(string) If specified, the route must exactly match the request method name. As a special case, an empty string matches any request method name.
Precisely one of method_name, service_name must be set.
- service_name
(string) If specified, the route must have the service name as the request method name prefix. As a special case, an empty string matches any service name. Only relevant when service multiplexing.
Precisely one of method_name, service_name must be set.
- invert
(bool) Inverts whatever matching is done in the method_name or service_name fields. Cannot be combined with wildcard matching as that would result in routes never being matched.
Note
This does not invert matching done as part of the headers field field. To invert header matching, see invert_match.
- headers
(route.HeaderMatcher) Specifies a set of headers that the route should match on. The router will check the request’s headers against all the specified headers in the route config. A match will happen if all the headers in the route are present in the request with the same values (or based on presence if the value field is not in the config). Note that this only applies for Thrift transports and/or protocols that support headers.
config.filter.network.thrift_proxy.v2alpha1.RouteAction¶
[config.filter.network.thrift_proxy.v2alpha1.RouteAction proto]
{
"cluster": "...",
"weighted_clusters": "{...}",
"metadata_match": "{...}",
"rate_limits": [],
"strip_service_name": "..."
}
- cluster
(string) Indicates a single upstream cluster to which the request should be routed to.
Precisely one of cluster, weighted_clusters must be set.
- weighted_clusters
(config.filter.network.thrift_proxy.v2alpha1.WeightedCluster) Multiple upstream clusters can be specified for a given route. The request is routed to one of the upstream clusters based on weights assigned to each cluster.
Precisely one of cluster, weighted_clusters must be set.
- metadata_match
(core.Metadata) Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints in the upstream cluster with metadata matching what is set in this field will be considered. Note that this will be merged with what’s provided in :ref: WeightedCluster.MetadataMatch <envoy_api_field_config.filter.network.thrift_proxy.v2alpha1.WeightedCluster.ClusterWeight.metadata_match>, with values there taking precedence. Keys and values should be provided under the “envoy.lb” metadata key.
- rate_limits
(route.RateLimit) Specifies a set of rate limit configurations that could be applied to the route. N.B. Thrift service or method name matching can be achieved by specifying a RequestHeaders action with the header name “:method-name”.
- strip_service_name
(bool) Strip the service prefix from the method name, if there’s a prefix. For example, the method call Service:method would end up being just method.
config.filter.network.thrift_proxy.v2alpha1.WeightedCluster¶
[config.filter.network.thrift_proxy.v2alpha1.WeightedCluster proto]
Allows for specification of multiple upstream clusters along with weights that indicate the percentage of traffic to be forwarded to each cluster. The router selects an upstream cluster based on these weights.
{
"clusters": []
}
- clusters
(config.filter.network.thrift_proxy.v2alpha1.WeightedCluster.ClusterWeight, REQUIRED) Specifies one or more upstream clusters associated with the route.
config.filter.network.thrift_proxy.v2alpha1.WeightedCluster.ClusterWeight¶
[config.filter.network.thrift_proxy.v2alpha1.WeightedCluster.ClusterWeight proto]
{
"name": "...",
"weight": "{...}",
"metadata_match": "{...}"
}
- name
(string, REQUIRED) Name of the upstream cluster.
- weight
(UInt32Value) When a request matches the route, the choice of an upstream cluster is determined by its weight. The sum of weights across all entries in the clusters array determines the total weight.
- metadata_match
(core.Metadata) Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints in the upstream cluster with metadata matching what is set in this field, combined with what’s provided in :ref: RouteAction’s metadata_match <envoy_api_field_config.filter.network.thrift_proxy.v2alpha1.RouteAction.metadata_match>, will be considered. Values here will take precedence. Keys and values should be provided under the “envoy.lb” metadata key.