mirror of
https://github.com/status-im/consul.git
synced 2025-02-02 00:46:43 +00:00
docs: fixing L7 config entries documentation (#6358)
- add service-router example involving gRPC - fix indentation on service-router page by splitting it up - remove reference to removed setting
This commit is contained in:
parent
33c09f80c8
commit
65fc93ea33
@ -146,14 +146,6 @@ name = "web"
|
|||||||
- `Datacenters` `(array<string>)` - A fixed list of datacenters to try during
|
- `Datacenters` `(array<string>)` - A fixed list of datacenters to try during
|
||||||
failover.
|
failover.
|
||||||
|
|
||||||
- `OverprovisioningFactor` `(int: 0)` - OverprovisioningFactor is a pass
|
|
||||||
through for envoy's
|
|
||||||
[`overprovisioning_factor`](https://www.envoyproxy.io/docs/envoy/v1.10.0/intro/arch_overview/load_balancing/priority)
|
|
||||||
value.
|
|
||||||
|
|
||||||
If omitted the overprovisioning factor value will be set so high as to
|
|
||||||
imply binary failover (all or nothing).
|
|
||||||
|
|
||||||
## Service Subsets
|
## Service Subsets
|
||||||
|
|
||||||
A service subset assigns a concrete name to a specific subset of discoverable
|
A service subset assigns a concrete name to a specific subset of discoverable
|
||||||
|
@ -98,6 +98,28 @@ routes = [
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Re-route a gRPC method to another service. Since gRPC method calls [are
|
||||||
|
HTTP2](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md), we can use an HTTP path match rule to re-route traffic:
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
kind = "service-router"
|
||||||
|
name = "billing"
|
||||||
|
routes = [
|
||||||
|
{
|
||||||
|
match {
|
||||||
|
http {
|
||||||
|
path_exact = "/mycompany.BillingService/GenerateInvoice"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
destination {
|
||||||
|
service = "invoice-generator"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
# NOTE: a default catch-all will send unmatched traffic to "billing"
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
## Available Fields
|
## Available Fields
|
||||||
|
|
||||||
- `Kind` - Must be set to `service-router`
|
- `Kind` - Must be set to `service-router`
|
||||||
@ -109,124 +131,128 @@ routes = [
|
|||||||
stops further evaluation. Traffic that fails to match any of the provided
|
stops further evaluation. Traffic that fails to match any of the provided
|
||||||
routes will be routed to the default service.
|
routes will be routed to the default service.
|
||||||
|
|
||||||
- `Match` `(ServiceRouteMatch: <optional>)` - A set of criteria that can
|
- `Match` `(ServiceRouteMatch: <optional>)` - A set of criteria that can
|
||||||
match incoming L7 requests. If empty or omitted it acts as a catch-all.
|
match incoming L7 requests. If empty or omitted it acts as a catch-all.
|
||||||
|
|
||||||
- `HTTP` `(ServiceRouteHTTPMatch: <optional>)` - A set of http-specific match criteria.
|
- `HTTP` `(ServiceRouteHTTPMatch: <optional>)` - A set of
|
||||||
|
[http-specific match criteria](#serviceroutehttpmatch).
|
||||||
|
|
||||||
- `PathExact` `(string: "")` - Exact path to match on the HTTP request path.
|
- `Destination` `(ServiceRouteDestination: <optional>)` - Controls [how to
|
||||||
|
proxy](#serviceroutedestination) the matching request(s) to a
|
||||||
|
service.
|
||||||
|
|
||||||
At most only one of `PathExact`, `PathPrefix`, or `PathRegex` may be configured.
|
### `ServiceRouteHTTPMatch`
|
||||||
|
|
||||||
- `PathPrefix` `(string: "")` - Path prefix to match on the HTTP request path.
|
- `PathExact` `(string: "")` - Exact path to match on the HTTP request path.
|
||||||
|
|
||||||
At most only one of `PathExact`, `PathPrefix`, or `PathRegex` may be configured.
|
At most only one of `PathExact`, `PathPrefix`, or `PathRegex` may be configured.
|
||||||
|
|
||||||
- `PathRegex` `(string: "")` - Regular expression to match on the HTTP
|
- `PathPrefix` `(string: "")` - Path prefix to match on the HTTP request path.
|
||||||
request path.
|
|
||||||
|
|
||||||
The syntax when using the Envoy proxy is [documented here](https://en.cppreference.com/w/cpp/regex/ecmascript).
|
|
||||||
|
|
||||||
At most only one of `PathExact`, `PathPrefix`, or `PathRegex` may be configured.
|
|
||||||
|
|
||||||
- `Header` `(array<ServiceRouteHTTPMatchHeader>)` - A set of criteria
|
At most only one of `PathExact`, `PathPrefix`, or `PathRegex` may be configured.
|
||||||
that can match on HTTP request headers. If more than one is configured
|
|
||||||
all must match for the overall match to apply.
|
|
||||||
|
|
||||||
- `Name` `(string: <required>)` - Name of the header to match on.
|
- `PathRegex` `(string: "")` - Regular expression to match on the HTTP
|
||||||
|
request path.
|
||||||
|
|
||||||
- `Present` `(bool: false)` - Match if the header with the given name
|
The syntax when using the Envoy proxy is [documented here](https://en.cppreference.com/w/cpp/regex/ecmascript).
|
||||||
is present with any value.
|
|
||||||
|
|
||||||
At most only one of `Exact`, `Prefix`, `Suffix`, `Regex`, or
|
At most only one of `PathExact`, `PathPrefix`, or `PathRegex` may be configured.
|
||||||
`Present` may be configured.
|
|
||||||
|
|
||||||
- `Exact` `(string: "")` - Match if the header with the given name is
|
- `Header` `(array<ServiceRouteHTTPMatchHeader>)` - A set of criteria that can
|
||||||
this value.
|
match on HTTP request headers. If more than one is configured all must match
|
||||||
|
for the overall match to apply.
|
||||||
|
|
||||||
At most only one of `Exact`, `Prefix`, `Suffix`, `Regex`, or
|
- `Name` `(string: <required>)` - Name of the header to match.
|
||||||
`Present` may be configured.
|
|
||||||
|
|
||||||
- `Prefix` `(string: "")` - Match if the header with the given name has
|
- `Present` `(bool: false)` - Match if the header with the given name is
|
||||||
this prefix.
|
present with any value.
|
||||||
|
|
||||||
At most only one of `Exact`, `Prefix`, `Suffix`, `Regex`, or
|
At most only one of `Exact`, `Prefix`, `Suffix`, `Regex`, or `Present`
|
||||||
`Present` may be configured.
|
may be configured.
|
||||||
|
|
||||||
- `Suffix` `(string: "")` - Match if the header with the given name has
|
- `Exact` `(string: "")` - Match if the header with the given name is this
|
||||||
this suffix.
|
value.
|
||||||
|
|
||||||
At most only one of `Exact`, `Prefix`, `Suffix`, `Regex`, or
|
At most only one of `Exact`, `Prefix`, `Suffix`, `Regex`, or `Present`
|
||||||
`Present` may be configured.
|
may be configured.
|
||||||
|
|
||||||
- `Regex` `(string: "")` - Match if the header with the given name
|
- `Prefix` `(string: "")` - Match if the header with the given name has
|
||||||
matches this pattern.
|
this prefix.
|
||||||
|
|
||||||
The syntax when using the Envoy proxy is [documented here](https://en.cppreference.com/w/cpp/regex/ecmascript).
|
At most only one of `Exact`, `Prefix`, `Suffix`, `Regex`, or `Present`
|
||||||
|
may be configured.
|
||||||
|
|
||||||
At most only one of `Exact`, `Prefix`, `Suffix`, `Regex`, or
|
- `Suffix` `(string: "")` - Match if the header with the given name has
|
||||||
`Present` may be configured.
|
this suffix.
|
||||||
|
|
||||||
- `Invert` `(bool: false)` - Inverts the logic of the match.
|
At most only one of `Exact`, `Prefix`, `Suffix`, `Regex`, or `Present`
|
||||||
|
may be configured.
|
||||||
|
|
||||||
- `QueryParam` `(array<ServiceRouteHTTPMatchQueryParam>)` - A set of
|
- `Regex` `(string: "")` - Match if the header with the given name matches
|
||||||
criteria that can match on HTTP query parameters. If more than one is
|
this pattern.
|
||||||
configured all must match for the overall match to apply.
|
|
||||||
|
|
||||||
- `Name` `(string: <required>)` - The name of the query parameter to
|
The syntax when using the Envoy proxy is [documented here](https://en.cppreference.com/w/cpp/regex/ecmascript).
|
||||||
match on.
|
|
||||||
|
|
||||||
- `Present` `(bool: false)` - Match if the query parameter with the given name
|
At most only one of `Exact`, `Prefix`, `Suffix`, `Regex`, or `Present`
|
||||||
is present with any value.
|
may be configured.
|
||||||
|
|
||||||
At most only one of `Exact`, `Regex`, or `Present` may be configured.
|
- `Invert` `(bool: false)` - Inverts the logic of the match.
|
||||||
|
|
||||||
- `Exact` `(string: "")` - Match if the query parameter with the given
|
- `QueryParam` `(array<ServiceRouteHTTPMatchQueryParam>)` - A set of criteria
|
||||||
name is this value.
|
that can match on HTTP query parameters. If more than one is configured all
|
||||||
|
must match for the overall match to apply.
|
||||||
|
|
||||||
At most only one of `Exact`, `Regex`, or `Present` may be configured.
|
- `Name` `(string: <required>)` - The name of the query parameter to match on.
|
||||||
|
|
||||||
- `Regex` `(string: "")` - Match if the query parameter with the given
|
|
||||||
name matches this pattern.
|
|
||||||
|
|
||||||
The syntax when using the Envoy proxy is [documented here](https://en.cppreference.com/w/cpp/regex/ecmascript).
|
- `Present` `(bool: false)` - Match if the query parameter with the given
|
||||||
|
name is present with any value.
|
||||||
|
|
||||||
At most only one of `Exact`, `Regex`, or `Present` may be configured.
|
At most only one of `Exact`, `Regex`, or `Present` may be configured.
|
||||||
|
|
||||||
- `Methods` `(array<string>)` - A list of HTTP methods for which this match
|
- `Exact` `(string: "")` - Match if the query parameter with the given name
|
||||||
applies. If unspecified all http methods are matched.
|
is this value.
|
||||||
|
|
||||||
- `Destination` `(ServiceRouteDestination: <optional>)` - Controls how to
|
At most only one of `Exact`, `Regex`, or `Present` may be configured.
|
||||||
proxy the actual matching request to a service.
|
|
||||||
|
|
||||||
- `Service` `(string: "")` - The service to resolve instead of the default
|
- `Regex` `(string: "")` - Match if the query parameter with the given name
|
||||||
service. If empty then the default service name is used.
|
matches this pattern.
|
||||||
|
|
||||||
- `ServiceSubset` `(string: "")` - A named subset of the given service to
|
The syntax when using the Envoy proxy is [documented here](https://en.cppreference.com/w/cpp/regex/ecmascript).
|
||||||
resolve instead of one defined as that service's `DefaultSubset`. If
|
|
||||||
empty the default subset is used.
|
|
||||||
|
|
||||||
- `Namespace` `(string: "")` - The namespace to resolve the service from
|
At most only one of `Exact`, `Regex`, or `Present` may be configured.
|
||||||
instead of the current namespace. If empty the current namespace is
|
|
||||||
assumed.
|
|
||||||
|
|
||||||
- `PrefixRewrite` `(string: "")` - Defines how to rewrite the http request
|
- `Methods` `(array<string>)` - A list of HTTP methods for which this match
|
||||||
path before proxying it to its final destination.
|
applies. If unspecified all http methods are matched.
|
||||||
|
|
||||||
This requires that either `Match.HTTP.PathPrefix` or
|
### `ServiceRouteDestination`
|
||||||
`Match.HTTP.PathExact` be configured on this route.
|
|
||||||
|
|
||||||
- `RequestTimeout` `(duration: 0s)` - The total amount of time permitted
|
- `Service` `(string: "")` - The service to resolve instead of the default
|
||||||
for the entire downstream request (and retries) to be processed.
|
service. If empty then the default service name is used.
|
||||||
|
|
||||||
- `NumRetries` `(int: 0)` - The number of times to retry the request when a
|
- `ServiceSubset` `(string: "")` - A named subset of the given service to
|
||||||
retryable result occurs.
|
resolve instead of the one defined as that service's `DefaultSubset`. If empty,
|
||||||
|
the default subset is used.
|
||||||
|
|
||||||
- `RetryOnConnectFailure` `(bool: false)` - Allows for connection failure
|
- `Namespace` `(string: "")` - The namespace to resolve the service from
|
||||||
errors to trigger a retry.
|
instead of the current namespace. If empty the current namespace is assumed.
|
||||||
|
|
||||||
- `RetryOnStatusCodes` `(array<int>)` - A flat list of http response status
|
- `PrefixRewrite` `(string: "")` - Defines how to rewrite the HTTP request path
|
||||||
codes that are eligible for retry.
|
before proxying it to its final destination.
|
||||||
|
|
||||||
|
This requires that either `Match.HTTP.PathPrefix` or
|
||||||
|
`Match.HTTP.PathExact` be configured on this route.
|
||||||
|
|
||||||
|
- `RequestTimeout` `(duration: 0s)` - The total amount of time permitted for
|
||||||
|
the entire downstream request (and retries) to be processed.
|
||||||
|
|
||||||
|
- `NumRetries` `(int: 0)` - The number of times to retry the request when a
|
||||||
|
retryable result occurs.
|
||||||
|
|
||||||
|
- `RetryOnConnectFailure` `(bool: false)` - Allows for connection failure
|
||||||
|
errors to trigger a retry.
|
||||||
|
|
||||||
|
- `RetryOnStatusCodes` `(array<int>)` - A flat list of http response status
|
||||||
|
codes that are eligible for retry.
|
||||||
|
|
||||||
## ACLs
|
## ACLs
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user