Skip to content

Commit 5868e82

Browse files
ADubhlaoichbjee19
authored andcommitted
feat: Restructure how-to section layout, update frontmatter (#2991)
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.
1 parent 2be5b0c commit 5868e82

11 files changed

+153
-29
lines changed

site/content/how-to/control-plane-configuration.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
22
title: "Control plane configuration"
3-
weight: 300
43
toc: true
5-
docs: "DOCS-1416"
4+
weight: 400
5+
type: how-to
6+
product: NGF
7+
docs: DOCS-1416
68
---
79

810
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
1113

1214
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.
1315

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" >}}):
1517

1618
- Helm: `<release-name>-config`
1719
- Manifests: `nginx-gateway-config`

site/content/how-to/data-plane-configuration.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
22
title: "Data plane configuration"
3-
weight: 400
43
toc: true
5-
docs: "DOCS-000"
4+
weight: 500
5+
type: how-to
6+
product: NGF
7+
docs: DOCS-000
68
---
79

810
Learn how to dynamically update the NGINX Gateway Fabric global data plane configuration.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
title: "Monitoring and troubleshooting"
3-
weight: 200
3+
weight: 300
44
---

site/content/how-to/traffic-management/advanced-routing.md

+28-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
22
title: "Application routes using HTTP matching conditions"
3-
weight: 200
43
toc: true
5-
docs: "DOCS-1422"
4+
weight: 200
5+
type: how-to
6+
product: NGF
7+
docs: DOCS-1422
68
---
79

810
Learn how to deploy multiple applications and HTTPRoutes with request conditions such as paths, methods, headers, and query parameters
911

12+
---
13+
1014
## Overview
1115

1216
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
1721

1822
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.
1923

24+
25+
---
26+
2027
## Before you begin
2128

2229
- [Install]({{< relref "/installation/" >}}) NGINX Gateway Fabric.
@@ -27,7 +34,9 @@ The goal is to create a set of rules that will result in client requests being s
2734
GW_PORT=<port number>
2835
```
2936

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+
---
3140

3241
## Coffee applications
3342

@@ -39,6 +48,8 @@ Begin by deploying the `coffee-v1` and `coffee-v2` applications:
3948
kubectl apply -f https://raw.githubusercontent.com/nginx/nginx-gateway-fabric/v1.5.1/examples/advanced-routing/coffee.yaml
4049
```
4150

51+
---
52+
4253
### Deploy the Gateway API Resources for the Coffee applications
4354

4455
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:
113124

114125
If you want both conditions to be required, you can define headers and queryParams in the same match object.
115126

127+
---
128+
116129
### Send traffic to Coffee
117130

118131
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
149162
Server name: coffee-v2-68bd55f798-s9z5q
150163
```
151164

165+
---
166+
152167
## Tea applications
153168

154169
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.
155170

171+
---
172+
156173
### Deploy the Tea applications
157174

158175
```shell
159176
kubectl apply -f https://raw.githubusercontent.com/nginx/nginx-gateway-fabric/v1.5.1/examples/advanced-routing/tea.yaml
160177
```
161178

179+
---
180+
162181
### Deploy the HTTPRoute for the Tea services
163182

164183
We are reusing the previous gateway for these applications, so all we need to create is the HTTPRoute.
@@ -201,6 +220,8 @@ The properties of this HTTPRoute include:
201220
- The first rule defines that a POST request to the `/tea` path is routed to the `tea-post` Service.
202221
- The second rule defines that a GET request to the `/tea` path is routed to the `tea` Service.
203222

223+
---
224+
204225
### Send traffic to Tea
205226

206227
Using the external IP address and port for NGINX Gateway Fabric, we can send traffic to our tea applications.
@@ -231,6 +252,7 @@ Server name: tea-post-b59b8596b-g586r
231252

232253
This request should receive a response from the `tea-post` pod. Any other type of method, such as PATCH, will result in a `404 Not Found` response.
233254

255+
---
234256

235257
## Troubleshooting
236258

@@ -334,7 +356,9 @@ If you have any issues while sending traffic, try the following to debug your co
334356

335357
Check for any error messages in the conditions.
336358

337-
## Further reading
359+
---
360+
361+
## See also
338362

339363
To learn more about the Gateway API and the resources we created in this guide, check out the following Kubernetes documentation resources:
340364

site/content/how-to/traffic-management/https-termination.md

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
---
22
title: "HTTPS termination"
3-
weight: 600
43
toc: true
5-
docs: "DOCS-1421"
4+
weight: 500
5+
type: how-to
6+
product: NGF
7+
docs: DOCS-1421
68
---
79

810
Learn how to terminate HTTPS traffic using NGINX Gateway Fabric.
911

12+
---
13+
1014
## Overview
1115

1216
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/).
1317

18+
---
19+
1420
## Before you begin
1521

1622
- [Install]({{< relref "installation/" >}}) NGINX Gateway Fabric.
@@ -30,6 +36,8 @@ In this guide, we will show how to configure HTTPS termination for your applicat
3036

3137
{{< 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 >}}
3238

39+
---
40+
3341
## Set up
3442

3543
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
8896
service/coffee ClusterIP 10.96.189.37 <none> 80/TCP 40s
8997
```
9098

99+
---
100+
91101
## Configure HTTPS termination and routing
92102

93103
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
209219

210220
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.
211221

212-
## Send Traffic
222+
---
223+
224+
## Send traffic
213225

214226
Using the external IP address and port for NGINX Gateway Fabric, we can send traffic to our coffee application.
215227

@@ -241,7 +253,9 @@ Server address: 10.244.0.6:80
241253
Server name: coffee-6b8b6d6486-7fc78
242254
```
243255

244-
## Further reading
256+
---
257+
258+
## See also
245259

246260
To learn more about redirects using the Gateway API, see the following resource:
247261

site/content/how-to/traffic-management/request-response-headers.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
---
22
title: "Modify HTTP request and response headers"
3-
weight: 500
43
toc: true
4+
weight: 600
5+
type: how-to
6+
product: NGF
7+
docs: DOCS-000
58
---
69

710
Learn how to modify the request and response headers of your application using NGINX Gateway Fabric.

site/content/how-to/traffic-management/routing-traffic-to-your-app.md

+26-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
---
22
title: "Routing traffic to applications"
3-
weight: 100
43
toc: true
5-
docs: "DOCS-1426"
4+
weight: 100
5+
type: how-to
6+
product: NGF
7+
docs: DOCS-1426
68
---
79

810
Learn how to route external traffic to your Kubernetes applications using NGINX Gateway Fabric.
911

12+
---
13+
1014
## Overview
1115

1216
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.
1317

18+
---
19+
1420
## Before you begin
1521

1622
- [Install]({{< relref "installation/" >}}) NGINX Gateway Fabric.
@@ -21,18 +27,22 @@ You can route traffic to your Kubernetes applications using the Gateway API and
2127
GW_PORT=<port number>
2228
```
2329

30+
---
31+
2432
## Example application
2533

2634
The application we are going to use in this guide is a simple **coffee** application comprised of one service and two pods:
2735

28-
{{<img src="img/route-all-traffic-app.png" alt="">}}
36+
{{<img src="img/route-all-traffic-app.png" alt="This image shows a single 'coffee' Service connecting to two 'coffee' Pods.">}}
2937

3038
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.
3139

3240
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).
3341

3442
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.
3543

44+
---
45+
3646
## Set up
3747

3848
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
92102
service/coffee ClusterIP 198.51.100.1 <none> 80/TCP 77s
93103
```
94104

105+
---
106+
95107
## Application architecture with NGINX Gateway Fabric
96108

97109
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:
98110

99-
{{<img src="img/route-all-traffic-config.png" alt="Configuration">}}
111+
{{<img src="img/route-all-traffic-config.png" alt="">}}
100112

101113
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.
102114

@@ -112,6 +124,8 @@ The **coffee** service is omitted from the diagram above because the NGINX Gatew
112124

113125
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 >}}
114126

127+
---
128+
115129
## Create the Gateway API resources
116130

117131
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
168182

169183
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.
170184

185+
---
186+
171187
## Test the configuration
172188

173189
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:
226242
</html>
227243
```
228244

245+
---
246+
229247
## Troubleshooting
230248

231249
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
357375
}
358376
```
359377

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 >}}
361379

362380
If your issue persists, [contact us](https://github.com/nginx/nginx-gateway-fabric#contacts).
363381

364-
## Further reading
382+
---
383+
384+
## See also
365385

366386
To learn more about the Gateway API and the resources we created in this guide, check out the following resources:
367387

0 commit comments

Comments
 (0)