Rename DestinationWeight and cleanup add/remove headers (#641)

This commit is contained in:
Frank Budinsky 2018-09-28 15:39:39 -04:00 committed by istio-bot
parent a8128703d4
commit 96d74ee7cf
5 changed files with 1493 additions and 602 deletions

View File

@ -30,7 +30,8 @@
TLSRoute
TCPRoute
HTTPMatchRequest
DestinationWeight
HTTPRouteDestination
RouteDestination
L4MatchAttributes
TLSMatchAttributes
HTTPRedirect

View File

@ -6,7 +6,7 @@ layout: protoc-gen-docs
generator: protoc-gen-docs
aliases:
- /docs/reference/config/istio.routing.v1alpha1/
number_of_entries: 50
number_of_entries: 51
---
<p>Configuration affecting traffic routing. Here are a few terms useful to define
in the context of traffic routing.</p>
@ -571,130 +571,6 @@ sizes, outlier detection).</p>
<p>One or more named sets that represent individual versions of a
service. Traffic policies can be overridden at subset level.</p>
</td>
</tr>
</tbody>
</table>
</section>
<h2 id="DestinationWeight">DestinationWeight</h2>
<section>
<p>Each routing rule is associated with one or more service versions (see
glossary in beginning of document). Weights associated with the version
determine the proportion of traffic it receives. For example, the
following rule will route 25% of traffic for the &ldquo;reviews&rdquo; service to
instances with the &ldquo;v2&rdquo; tag and the remaining traffic (i.e., 75%) to
&ldquo;v1&rdquo;.</p>
<pre><code class="language-yaml">apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews-route
spec:
hosts:
- reviews.prod.svc.cluster.local
http:
- route:
- destination:
host: reviews.prod.svc.cluster.local
subset: v2
weight: 25
- destination:
host: reviews.prod.svc.cluster.local
subset: v1
weight: 75
</code></pre>
<p>And the associated DestinationRule</p>
<pre><code class="language-yaml">apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: reviews-destination
spec:
host: reviews.prod.svc.cluster.local
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
</code></pre>
<p>Traffic can also be split across two entirely different services without
having to define new subsets. For example, the following rule forwards 25% of
traffic to reviews.com to dev.reviews.com</p>
<pre><code class="language-yaml">apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews-route-two-domains
spec:
hosts:
- reviews.com
http:
- route:
- destination:
host: dev.reviews.com
weight: 25
- destination:
host: reviews.com
weight: 75
</code></pre>
<table class="message-fields">
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr id="DestinationWeight-destination">
<td><code>destination</code></td>
<td><code><a href="#Destination">Destination</a></code></td>
<td>
<p>REQUIRED. Destination uniquely identifies the instances of a service
to which the request/connection should be forwarded to.</p>
</td>
</tr>
<tr id="DestinationWeight-weight">
<td><code>weight</code></td>
<td><code>int32</code></td>
<td>
<p>REQUIRED. The proportion of traffic to be forwarded to the service
version. (0-100). Sum of weights across destinations SHOULD BE == 100.
If there is only one destination in a rule, the weight value is assumed to
be 100.</p>
</td>
</tr>
<tr id="DestinationWeight-append_headers">
<td><code>appendHeaders</code></td>
<td><code>map&lt;string,&nbsp;string&gt;</code></td>
<td>
<p>Additional HTTP headers to add before forwarding a request to the
destination service.</p>
</td>
</tr>
<tr id="DestinationWeight-remove_response_headers">
<td><code>removeResponseHeaders</code></td>
<td><code>string[]</code></td>
<td>
<p>Http headers to remove before returning the response to the caller</p>
</td>
</tr>
<tr id="DestinationWeight-append_response_headers">
<td><code>appendResponseHeaders</code></td>
<td><code>map&lt;string,&nbsp;string&gt;</code></td>
<td>
<p>Additional HTTP headers to add before returning a response to the
caller.</p>
</td>
</tr>
</tbody>
@ -1711,7 +1587,7 @@ number of retries attempted depends on the httpReqTimeout.</p>
<section>
<p>HTTPRewrite can be used to rewrite specific parts of a HTTP request
before forwarding the request to the destination. Rewrite primitive can
be used only with the DestinationWeights. The following example
be used only with HTTPRouteDestination. The following example
demonstrates how to rewrite the URL prefix for api call (/ratings) to
ratings service before making the actual API call.</p>
@ -1791,7 +1667,7 @@ is matched if any one of the match blocks succeed.</p>
</tr>
<tr id="HTTPRoute-route">
<td><code>route</code></td>
<td><code><a href="#DestinationWeight">DestinationWeight[]</a></code></td>
<td><code><a href="#HTTPRouteDestination">HTTPRouteDestination[]</a></code></td>
<td>
<p>A http rule can either redirect or forward (default) traffic. The
forwarding target can be one of several versions of a service (see
@ -1869,12 +1745,12 @@ for further details about cross origin resource sharing.</p>
</td>
</tr>
<tr id="HTTPRoute-append_headers">
<tr id="HTTPRoute-append_headers" class="deprecated ">
<td><code>appendHeaders</code></td>
<td><code>map&lt;string,&nbsp;string&gt;</code></td>
<td>
<p>Additional HTTP headers to add before forwarding a request to the
destination service.</p>
<p>Use of <code>append_headers</code> is deprecated. Use the <code>append_request_headers</code>
field instead.</p>
</td>
</tr>
@ -1882,7 +1758,167 @@ destination service.</p>
<td><code>removeResponseHeaders</code></td>
<td><code>string[]</code></td>
<td>
<p>Http headers to remove before returning the response to the caller.</p>
<p>HTTP headers to remove before returning a response to the caller.</p>
</td>
</tr>
<tr id="HTTPRoute-append_response_headers">
<td><code>appendResponseHeaders</code></td>
<td><code>map&lt;string,&nbsp;string&gt;</code></td>
<td>
<p>Additional HTTP headers to add before returning a response to the
caller.</p>
</td>
</tr>
<tr id="HTTPRoute-remove_request_headers">
<td><code>removeRequestHeaders</code></td>
<td><code>string[]</code></td>
<td>
<p>HTTP headers to remove before forwarding forwarding a request to the
destination service.</p>
</td>
</tr>
<tr id="HTTPRoute-append_request_headers">
<td><code>appendRequestHeaders</code></td>
<td><code>map&lt;string,&nbsp;string&gt;</code></td>
<td>
<p>Additional HTTP headers to add before forwarding a request to the
destination service.</p>
</td>
</tr>
</tbody>
</table>
</section>
<h2 id="HTTPRouteDestination">HTTPRouteDestination</h2>
<section>
<p>Each routing rule is associated with one or more service versions (see
glossary in beginning of document). Weights associated with the version
determine the proportion of traffic it receives. For example, the
following rule will route 25% of traffic for the &ldquo;reviews&rdquo; service to
instances with the &ldquo;v2&rdquo; tag and the remaining traffic (i.e., 75%) to
&ldquo;v1&rdquo;.</p>
<pre><code class="language-yaml">apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews-route
spec:
hosts:
- reviews.prod.svc.cluster.local
http:
- route:
- destination:
host: reviews.prod.svc.cluster.local
subset: v2
weight: 25
- destination:
host: reviews.prod.svc.cluster.local
subset: v1
weight: 75
</code></pre>
<p>And the associated DestinationRule</p>
<pre><code class="language-yaml">apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: reviews-destination
spec:
host: reviews.prod.svc.cluster.local
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
</code></pre>
<p>Traffic can also be split across two entirely different services without
having to define new subsets. For example, the following rule forwards 25% of
traffic to reviews.com to dev.reviews.com</p>
<pre><code class="language-yaml">apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews-route-two-domains
spec:
hosts:
- reviews.com
http:
- route:
- destination:
host: dev.reviews.com
weight: 25
- destination:
host: reviews.com
weight: 75
</code></pre>
<table class="message-fields">
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr id="HTTPRouteDestination-destination">
<td><code>destination</code></td>
<td><code><a href="#Destination">Destination</a></code></td>
<td>
<p>REQUIRED. Destination uniquely identifies the instances of a service
to which the request/connection should be forwarded to.</p>
</td>
</tr>
<tr id="HTTPRouteDestination-weight">
<td><code>weight</code></td>
<td><code>int32</code></td>
<td>
<p>REQUIRED. The proportion of traffic to be forwarded to the service
version. (0-100). Sum of weights across destinations SHOULD BE == 100.
If there is only one destination in a rule, the weight value is assumed to
be 100.</p>
</td>
</tr>
<tr id="HTTPRouteDestination-remove_response_headers">
<td><code>removeResponseHeaders</code></td>
<td><code>string[]</code></td>
<td>
<p>HTTP headers to remove before returning a response to the caller.</p>
</td>
</tr>
<tr id="HTTPRouteDestination-append_response_headers">
<td><code>appendResponseHeaders</code></td>
<td><code>map&lt;string,&nbsp;string&gt;</code></td>
<td>
<p>Additional HTTP headers to add before returning a response to the
caller.</p>
</td>
</tr>
<tr id="HTTPRouteDestination-remove_request_headers">
<td><code>removeRequestHeaders</code></td>
<td><code>string[]</code></td>
<td>
<p>HTTP headers to remove before forwarding forwarding a request to the
destination service.</p>
</td>
</tr>
<tr id="HTTPRouteDestination-append_request_headers">
<td><code>appendRequestHeaders</code></td>
<td><code>map&lt;string,&nbsp;string&gt;</code></td>
<td>
<p>Additional HTTP headers to add before forwarding a request to the
destination service.</p>
</td>
</tr>
@ -2334,6 +2370,42 @@ matching or selection for final routing.</p>
<td>
<p>Valid port number</p>
</td>
</tr>
</tbody>
</table>
</section>
<h2 id="RouteDestination">RouteDestination</h2>
<section>
<p>L4 routing rule weighted destination.</p>
<table class="message-fields">
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr id="RouteDestination-destination">
<td><code>destination</code></td>
<td><code><a href="#Destination">Destination</a></code></td>
<td>
<p>REQUIRED. Destination uniquely identifies the instances of a service
to which the request/connection should be forwarded to.</p>
</td>
</tr>
<tr id="RouteDestination-weight">
<td><code>weight</code></td>
<td><code>int32</code></td>
<td>
<p>REQUIRED. The proportion of traffic to be forwarded to the service
version. (0-100). Sum of weights across destinations SHOULD BE == 100.
If there is only one destination in a rule, the weight value is assumed to
be 100.</p>
</td>
</tr>
</tbody>
@ -3205,7 +3277,7 @@ is matched if any one of the match blocks succeed.</p>
</tr>
<tr id="TCPRoute-route">
<td><code>route</code></td>
<td><code><a href="#DestinationWeight">DestinationWeight[]</a></code></td>
<td><code><a href="#RouteDestination">RouteDestination[]</a></code></td>
<td>
<p>The destination to which the connection should be forwarded to.
Currently, only one destination is allowed for TCP services. When TCP
@ -3340,7 +3412,7 @@ is matched if any one of the match blocks succeed.</p>
</tr>
<tr id="TLSRoute-route">
<td><code>route</code></td>
<td><code><a href="#DestinationWeight">DestinationWeight[]</a></code></td>
<td><code><a href="#RouteDestination">RouteDestination[]</a></code></td>
<td>
<p>The destination to which the connection should be forwarded to.
Currently, only one destination is allowed for TLS services. When TCP

File diff suppressed because it is too large Load Diff

View File

@ -345,7 +345,7 @@ message HTTPRoute {
// forwarding target can be one of several versions of a service (see
// glossary in beginning of document). Weights associated with the
// service version determine the proportion of traffic it receives.
repeated DestinationWeight route = 2;
repeated HTTPRouteDestination route = 2;
// A http rule can either redirect or forward (default) traffic. If
// traffic passthrough option is specified in the rule,
@ -385,12 +385,24 @@ message HTTPRoute {
// for further details about cross origin resource sharing.
CorsPolicy cors_policy = 10;
// Use of `append_headers` is deprecated. Use the `append_request_headers`
// field instead.
map<string, string> append_headers = 11 [deprecated=true];
// HTTP headers to remove before returning a response to the caller.
repeated string remove_response_headers = 12;
// Additional HTTP headers to add before returning a response to the
// caller.
map<string, string> append_response_headers = 13;
// HTTP headers to remove before forwarding forwarding a request to the
// destination service.
repeated string remove_request_headers = 14;
// Additional HTTP headers to add before forwarding a request to the
// destination service.
map<string, string> append_headers = 11;
// Http headers to remove before returning the response to the caller.
repeated string remove_response_headers = 12;
map<string, string> append_request_headers = 15;
}
// Describes match conditions and actions for routing unterminated TLS
@ -435,7 +447,7 @@ message TLSRoute {
// Currently, only one destination is allowed for TLS services. When TCP
// weighted routing support is introduced in Envoy, multiple destinations
// with weights can be specified.
repeated DestinationWeight route = 2;
repeated RouteDestination route = 2;
}
// Describes match conditions and actions for routing TCP traffic. The
@ -470,7 +482,7 @@ message TCPRoute {
// Currently, only one destination is allowed for TCP services. When TCP
// weighted routing support is introduced in Envoy, multiple destinations
// with weights can be specified.
repeated DestinationWeight route = 2;
repeated RouteDestination route = 2;
}
// HttpMatchRequest specifies a set of criterion to be met in order for the
@ -642,7 +654,7 @@ message HTTPMatchRequest {
// host: reviews.com
// weight: 75
// ```
message DestinationWeight {
message HTTPRouteDestination {
// REQUIRED. Destination uniquely identifies the instances of a service
// to which the request/connection should be forwarded to.
Destination destination = 1;
@ -653,16 +665,33 @@ message DestinationWeight {
// be 100.
int32 weight = 2;
// Additional HTTP headers to add before forwarding a request to the
// destination service.
map<string, string> append_headers = 3;
// Http headers to remove before returning the response to the caller
repeated string remove_response_headers = 4;
// HTTP headers to remove before returning a response to the caller.
repeated string remove_response_headers = 3;
// Additional HTTP headers to add before returning a response to the
// caller.
map<string, string> append_response_headers = 5;
map<string, string> append_response_headers = 4;
// HTTP headers to remove before forwarding forwarding a request to the
// destination service.
repeated string remove_request_headers = 5;
// Additional HTTP headers to add before forwarding a request to the
// destination service.
map<string, string> append_request_headers = 6;
}
// L4 routing rule weighted destination.
message RouteDestination {
// REQUIRED. Destination uniquely identifies the instances of a service
// to which the request/connection should be forwarded to.
Destination destination = 1;
// REQUIRED. The proportion of traffic to be forwarded to the service
// version. (0-100). Sum of weights across destinations SHOULD BE == 100.
// If there is only one destination in a rule, the weight value is assumed to
// be 100.
int32 weight = 2;
}
// L4 connection match attributes. Note that L4 connection matching support
@ -765,7 +794,7 @@ message HTTPRedirect {
// HTTPRewrite can be used to rewrite specific parts of a HTTP request
// before forwarding the request to the destination. Rewrite primitive can
// be used only with the DestinationWeights. The following example
// be used only with HTTPRouteDestination. The following example
// demonstrates how to rewrite the URL prefix for api call (/ratings) to
// ratings service before making the actual API call.
//

File diff suppressed because one or more lines are too long