From 716cea4416754b92ba7a547df631aac07f84fff7 Mon Sep 17 00:00:00 2001 From: Saylor Berman Date: Thu, 17 Apr 2025 12:50:12 -0600 Subject: [PATCH 1/2] Add NGF request mirror doc NGF is adding the capability for users to configure request mirroring. This adds a guide explaining how a user can set this up. --- .../ngf/how-to/traffic-management/mirror.md | 214 ++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 content/ngf/how-to/traffic-management/mirror.md diff --git a/content/ngf/how-to/traffic-management/mirror.md b/content/ngf/how-to/traffic-management/mirror.md new file mode 100644 index 00000000..8ca7a5c2 --- /dev/null +++ b/content/ngf/how-to/traffic-management/mirror.md @@ -0,0 +1,214 @@ +--- +title: Configure Request Mirroring +weight: 700 +toc: true +type: how-to +product: NGF +docs: DOCS-000 +--- + +Learn how to mirror your HTTP or gRPC traffic using NGINX Gateway Fabric. + +--- + +## Overview + +[HTTPRoute](https://gateway-api.sigs.k8s.io/api-types/httproute/) and [GRPCRoute](https://gateway-api.sigs.k8s.io/api-types/grpcroute/) filters can be used to configure request mirroring. Mirroring copies a request to another backend. + +In this guide, we will set up two applications, **coffee** and **tea**, and mirror requests between them. All requests +sent to the **coffee** application will also be sent to the **tea** application automatically. + +--- + +## Before you begin + +- [Install]({{< ref "/ngf/installation/" >}}) NGINX Gateway Fabric. +- Save the public IP address and port of NGINX Gateway Fabric into shell variables: + + ```text + GW_IP=XXX.YYY.ZZZ.III + GW_PORT= + ``` + +{{< note >}}In a production environment, you should have a DNS record for the external IP address that is exposed, and it should refer to the hostname that the gateway will forward for.{{< /note >}} + +--- + +## Set up + +Create the **coffee** and **tea** applications in Kubernetes by copying and pasting the following block into your terminal: + +```yaml +kubectl apply -f - < 80/TCP 3s +service/tea ClusterIP 10.96.185.235 80/TCP 3s +``` + +--- + +## Configure request mirroring + +First, create the **cafe** Gateway resource: + +```yaml +kubectl apply -f - < Date: Fri, 18 Apr 2025 14:33:31 -0600 Subject: [PATCH 2/2] Update compat doc --- content/ngf/overview/gateway-api-compatibility.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/ngf/overview/gateway-api-compatibility.md b/content/ngf/overview/gateway-api-compatibility.md index d68e34de..4e08a90d 100644 --- a/content/ngf/overview/gateway-api-compatibility.md +++ b/content/ngf/overview/gateway-api-compatibility.md @@ -178,7 +178,8 @@ See the [static-mode]({{< ref "/ngf/reference/cli-help.md#static-mode">}}) comma - `requestHeaderModifier`: Supported. If multiple filters are configured, NGINX Gateway Fabric will choose the first and ignore the rest. - `urlRewrite`: Supported. If multiple filters are configured, NGINX Gateway Fabric will choose the first and ignore the rest. Incompatible with `requestRedirect`. - `responseHeaderModifier`: Supported. If multiple filters are configured, NGINX Gateway Fabric will choose the first and ignore the rest. - - `requestMirror`, `extensionRef`: Not supported. + - `requestMirror`: Supported. Multiple mirrors can be specified. + - `extensionRef`: Supported for SnippetsFilters. - `backendRefs`: Partially supported. Backend ref `filters` are not supported. - `status` - `parents` @@ -226,7 +227,8 @@ See the [static-mode]({{< ref "/ngf/reference/cli-help.md#static-mode">}}) comma - `type`: Supported. - `requestHeaderModifier`: Supported. If multiple filters are configured, NGINX Gateway Fabric will choose the first and ignore the rest. - `responseHeaderModifier`: Supported. If multiple filters are configured, NGINX Gateway Fabric will choose the first and ignore the rest. - - `requestMirror`, `extensionRef`: Not supported. + - `requestMirror`: Supported. Multiple mirrors can be specified. + - `extensionRef`: Supported for SnippetsFilters. - `backendRefs`: Partially supported. Backend ref `filters` are not supported. - `status` - `parents`