You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit restructures the how-to section, adding a new Traffic
security section and moving the contextually appropriate docs into it.
Subsequent weight changes have been made to re-order pages based on
likelihood of use, and frontmatter data for affected pages have been
updated to contemporary standards.
Copy file name to clipboardExpand all lines: site/content/how-to/control-plane-configuration.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
---
2
2
title: "Control plane configuration"
3
-
weight: 300
4
3
toc: true
5
-
docs: "DOCS-1416"
4
+
weight: 400
5
+
type: how-to
6
+
product: NGF
7
+
docs: DOCS-1416
6
8
---
7
9
8
10
Learn how to dynamically update the NGINX Gateway Fabric control plane configuration.
@@ -11,7 +13,7 @@ Learn how to dynamically update the NGINX Gateway Fabric control plane configura
11
13
12
14
NGINX Gateway Fabric can dynamically update the control plane configuration without restarting. The control plane configuration is stored in the NginxGateway custom resource, created during the installation of NGINX Gateway Fabric.
13
15
14
-
NginxGateway is deployed in the same namespace as the controller (Default: `nginx-gateway`). The resource's default name is based on your [installation method]({{<relref "/installation/installing-ngf">}}):
16
+
NginxGateway is deployed in the same namespace as the controller (Default: `nginx-gateway`). The resource's default name is based on your [installation method]({{<relref "/installation/installing-ngf">}}):
Copy file name to clipboardExpand all lines: site/content/how-to/traffic-management/advanced-routing.md
+28-4
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,16 @@
1
1
---
2
2
title: "Application routes using HTTP matching conditions"
3
-
weight: 200
4
3
toc: true
5
-
docs: "DOCS-1422"
4
+
weight: 200
5
+
type: how-to
6
+
product: NGF
7
+
docs: DOCS-1422
6
8
---
7
9
8
10
Learn how to deploy multiple applications and HTTPRoutes with request conditions such as paths, methods, headers, and query parameters
9
11
12
+
---
13
+
10
14
## Overview
11
15
12
16
In this guide we will configure advanced routing rules for multiple applications. These rules will showcase request matching by path, headers, query parameters, and method. For an introduction to exposing your application, we recommend that you follow the [basic guide]({{< relref "/how-to/traffic-management/routing-traffic-to-your-app.md" >}}) first.
@@ -17,6 +21,9 @@ The following image shows the traffic flow that we will be creating with these r
17
21
18
22
The goal is to create a set of rules that will result in client requests being sent to specific backends based on the request attributes. In this diagram, we have two versions of the `coffee` service. Traffic for v1 needs to be directed to the old application, while traffic for v2 needs to be directed towards the new application. We also have two `tea` services, one that handles GET operations and one that handles POST operations. Both the `tea` and `coffee` applications share the same Gateway.
@@ -27,7 +34,9 @@ The goal is to create a set of rules that will result in client requests being s
27
34
GW_PORT=<port number>
28
35
```
29
36
30
-
{{< 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 >}}
37
+
{{< 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 >}}
38
+
39
+
---
31
40
32
41
## Coffee applications
33
42
@@ -39,6 +48,8 @@ Begin by deploying the `coffee-v1` and `coffee-v2` applications:
### Deploy the Gateway API Resources for the Coffee applications
43
54
44
55
The [gateway](https://gateway-api.sigs.k8s.io/api-types/gateway/) resource is typically deployed by the [cluster operator](https://gateway-api.sigs.k8s.io/concepts/roles-and-personas/#roles-and-personas_1). To deploy the gateway:
@@ -113,6 +124,8 @@ This HTTPRoute has a few important properties:
113
124
114
125
If you want both conditions to be required, you can define headers and queryParams in the same match object.
115
126
127
+
---
128
+
116
129
### Send traffic to Coffee
117
130
118
131
Using the external IP address and port for NGINX Gateway Fabric, we can send traffic to our coffee applications.
@@ -149,16 +162,22 @@ Server address: 10.244.0.9:8080
149
162
Server name: coffee-v2-68bd55f798-s9z5q
150
163
```
151
164
165
+
---
166
+
152
167
## Tea applications
153
168
154
169
Let's deploy a different set of applications now called `tea` and `tea-post`. These applications will have their own set of rules, but will still attach to the same gateway listener as the `coffee` apps.
Copy file name to clipboardExpand all lines: site/content/how-to/traffic-management/https-termination.md
+18-4
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,22 @@
1
1
---
2
2
title: "HTTPS termination"
3
-
weight: 600
4
3
toc: true
5
-
docs: "DOCS-1421"
4
+
weight: 500
5
+
type: how-to
6
+
product: NGF
7
+
docs: DOCS-1421
6
8
---
7
9
8
10
Learn how to terminate HTTPS traffic using NGINX Gateway Fabric.
9
11
12
+
---
13
+
10
14
## Overview
11
15
12
16
In this guide, we will show how to configure HTTPS termination for your application, using an [HTTPRoute](https://gateway-api.sigs.k8s.io/api-types/httproute/) redirect filter, secret, and [ReferenceGrant](https://gateway-api.sigs.k8s.io/api-types/referencegrant/).
@@ -30,6 +36,8 @@ In this guide, we will show how to configure HTTPS termination for your applicat
30
36
31
37
{{< 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 >}}
32
38
39
+
---
40
+
33
41
## Set up
34
42
35
43
Create the **coffee** application in Kubernetes by copying and pasting the following block into your terminal:
@@ -88,6 +96,8 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
For the HTTPS, we need a certificate and key that are stored in a secret. This secret will live in a separate namespace, so we will need a ReferenceGrant in order to access it.
@@ -209,7 +219,9 @@ EOF
209
219
210
220
The first route issues a `requestRedirect` from the `http` listener on port 80 to `https` on port 443. The second route binds the `coffee` route to the `https` listener.
211
221
212
-
## Send Traffic
222
+
---
223
+
224
+
## Send traffic
213
225
214
226
Using the external IP address and port for NGINX Gateway Fabric, we can send traffic to our coffee application.
215
227
@@ -241,7 +253,9 @@ Server address: 10.244.0.6:80
241
253
Server name: coffee-6b8b6d6486-7fc78
242
254
```
243
255
244
-
## Further reading
256
+
---
257
+
258
+
## See also
245
259
246
260
To learn more about redirects using the Gateway API, see the following resource:
Copy file name to clipboardExpand all lines: site/content/how-to/traffic-management/routing-traffic-to-your-app.md
+26-6
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,22 @@
1
1
---
2
2
title: "Routing traffic to applications"
3
-
weight: 100
4
3
toc: true
5
-
docs: "DOCS-1426"
4
+
weight: 100
5
+
type: how-to
6
+
product: NGF
7
+
docs: DOCS-1426
6
8
---
7
9
8
10
Learn how to route external traffic to your Kubernetes applications using NGINX Gateway Fabric.
9
11
12
+
---
13
+
10
14
## Overview
11
15
12
16
You can route traffic to your Kubernetes applications using the Gateway API and NGINX Gateway Fabric. Whether you're managing a web application or a REST backend API, you can use NGINX Gateway Fabric to expose your application outside the cluster.
{{<imgsrc="img/route-all-traffic-app.png"alt="This image shows a single 'coffee' Service connecting to two 'coffee' Pods.">}}
29
37
30
38
Using this architecture, the **coffee** application is not accessible outside the cluster. We want to expose this application on the hostname "cafe.example.com" so that clients outside the cluster can access it.
31
39
32
40
Install NGINX Gateway Fabric and create two Gateway API resources: a [gateway](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1.Gateway) and an [HTTPRoute](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1.HTTPRoute).
33
41
34
42
Using these resources we will configure a simple routing rule to match all HTTP traffic with the hostname "cafe.example.com" and route it to the **coffee** service.
35
43
44
+
---
45
+
36
46
## Set up
37
47
38
48
Create the **coffee** application in Kubernetes by copying and pasting the following block into your terminal:
@@ -92,11 +102,13 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
## Application architecture with NGINX Gateway Fabric
96
108
97
109
To route traffic to the **coffee** application, we will create a gateway and HTTPRoute. The following diagram shows the configuration we are creating in the next step:
We need a gateway to create an entry point for HTTP traffic coming into the cluster. The **cafe** gateway we are going to create will open an entry point to the cluster on port 80 for HTTP traffic.
102
114
@@ -112,6 +124,8 @@ The **coffee** service is omitted from the diagram above because the NGINX Gatew
112
124
113
125
See the [roles and personas](https://gateway-api.sigs.k8s.io/concepts/roles-and-personas/#roles-and-personas_1) Gateway API document for more information on these roles.{{< /note >}}
114
126
127
+
---
128
+
115
129
## Create the Gateway API resources
116
130
117
131
To create the **cafe** gateway, copy and paste the following into your terminal:
@@ -168,6 +182,8 @@ The [**hostnames**](https://gateway-api.sigs.k8s.io/references/spec/#gateway.net
168
182
169
183
The [**rules**](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1.HTTPRouteRule) field defines routing rules for the HTTPRoute. A rule is selected if the request satisfies one of the rule's **matches**. To forward traffic for all paths to the coffee service we specify a match with the PathPrefix "/" and target the coffee service using the **backendRef** field.
170
184
185
+
---
186
+
171
187
## Test the configuration
172
188
173
189
To test the configuration, we will send a request to the public IP and port of NGINX Gateway Fabric that you saved in the [Before you begin](#before-you-begin) section and verify that the response comes from one of the **coffee** pods.
@@ -226,6 +242,8 @@ You should receive a 404 Not Found error:
226
242
</html>
227
243
```
228
244
245
+
---
246
+
229
247
## Troubleshooting
230
248
231
249
If you have any issues while testing the configuration, try the following to debug your configuration and setup:
@@ -357,11 +375,13 @@ If you have any issues while testing the configuration, try the following to deb
357
375
}
358
376
```
359
377
360
-
{{< note >}}The entire configuration is not shown because it is subject to change. Ellipses indicate that there's configuration not shown.{{< /note >}}
378
+
{{< note >}}The entire configuration is not shown because it is subject to change. Ellipses indicate that there's configuration not shown.{{< /note >}}
361
379
362
380
If your issue persists, [contact us](https://github.com/nginx/nginx-gateway-fabric#contacts).
363
381
364
-
## Further reading
382
+
---
383
+
384
+
## See also
365
385
366
386
To learn more about the Gateway API and the resources we created in this guide, check out the following resources:
0 commit comments