Skip to content

Commit f1758d1

Browse files
authored
Add doc and httproute example for HTTP request mirroring (#2853)
* Added example HTTPRoute yaml for configuring HTTP request mirroring.
1 parent bc99239 commit f1758d1

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#$ Used in:
2+
#$ - site-src/guides/http-request-mirroring.md
3+
apiVersion: gateway.networking.k8s.io/v1
4+
kind: HTTPRoute
5+
metadata:
6+
name: http-filter-mirror
7+
labels:
8+
gateway: mirror-gateway
9+
spec:
10+
parentRefs:
11+
- name: mirror-gateway
12+
hostnames:
13+
- mirror.example
14+
rules:
15+
- backendRefs:
16+
- name: foo-v1
17+
port: 8080
18+
filters:
19+
- type: RequestMirror
20+
requestMirror:
21+
backendRef:
22+
name: foo-v2
23+
port: 8080

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ nav:
8686
- HTTP redirects and rewrites: guides/http-redirect-rewrite.md
8787
- HTTP header modifier: guides/http-header-modifier.md
8888
- HTTP traffic splitting: guides/traffic-splitting.md
89+
- HTTP request mirroring: guides/http-request-mirroring.md
8990
- Cross-Namespace routing: guides/multiple-ns.md
9091
- TLS: guides/tls.md
9192
- TCP routing: guides/tcp.md
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# HTTP request mirroring
2+
3+
??? example "Extended Support Feature"
4+
5+
As of v1.0.0, the Request Mirroring feature is an Extended feature, and
6+
requires implementations to support the `HTTPRouteRequestMirror` feature.
7+
8+
The [HTTPRoute resource](/api-types/httproute) allows you to mirror HTTP
9+
requests to another backend using
10+
[filters](/api-types/httproute#filters-optional). This guide shows how to use
11+
this feature.
12+
13+
Mirrored requests will must only be sent to one single destination endpoint
14+
within this backendRef, and responses from this backend MUST be ignored by
15+
the Gateway.
16+
17+
Request mirroring is particularly useful in blue-green deployment. It can be
18+
used to assess the impact on application performance without impacting
19+
responses to clients in any way.
20+
21+
```yaml
22+
{% include 'standard/http-request-mirroring/httproute-mirroring.yaml' %}
23+
```
24+
25+
In this example, all requests are forwarded to service `foo-v1` on port `8080`,
26+
and they are also forwarded to service `foo-v2` on port `8080`, but responses
27+
are only generated from service `foo-v1`.

0 commit comments

Comments
 (0)