Skip to content

Commit bcbd150

Browse files
committed
docs: update data plane config file
1 parent 707e7df commit bcbd150

File tree

1 file changed

+62
-32
lines changed

1 file changed

+62
-32
lines changed

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

Lines changed: 62 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@ Learn how to dynamically update the NGINX Gateway Fabric global data plane confi
1111

1212
## Overview
1313

14-
NGINX Gateway Fabric can dynamically update the global data plane configuration without restarting. The data plane configuration contains configuration for NGINX that is not available using the standard Gateway API resources. This includes such things as setting an OpenTelemetry collector config, disabling http2, changing the IP family, or setting the NGINX error log level.
14+
NGINX Gateway Fabric can dynamically update the global data plane configuration without restarting. The data plane configuration is a global configuration for NGINX that has options that is not available using the standard Gateway API resources. This includes options such as configuring an OpenTelemetry collector, disabling HTTP/2, changing the IP family, modifying infrastructure-related fields, and setting the NGINX error log level.
1515

16-
The data plane configuration is stored in the NginxProxy custom resource, which is a namespace-scoped resource that can be attached to a GatewayClass or Gateway. When attached to a GatewayClass, the fields in the NginxProxy affect all Gateways that belong to the GatewayClass.
17-
When attached to a Gateway, the fields in the NginxProxy only affect the Gateway. If a GatewayClass and its Gateway both specify an NginxProxy, the GatewayClass NginxProxy provides defaults that can be overridden by the Gateway NginxProxy. See the [Merging Semantics](#merging-semantics) section for more detail.
16+
The data plane configuration is stored in the `NginxProxy` custom resource, which is a namespace-scoped resource that can be attached to a gatewayClass or gateway. When attached to a gatewayClass, the fields in the NginxProxy affect all gateways that belong to the gatewayClass.
17+
When attached to a gateway, the fields in the NginxProxy only affect the gateway. If a gatewayClass and its gateway both specify an NginxProxy, the gatewayClass NginxProxy provides defaults that can be overridden by the gateway NginxProxy. See the [Merging Semantics](#merging-semantics) section for more detail.
1818

1919
---
2020

2121
## Merging Semantics
2222

23-
NginxProxy resources are merged when a GatewayClass and a Gateway reference different NginxProxy resources.
23+
NginxProxy resources are merged when a gatewayClass and a gateway reference different NginxProxy resources.
2424

2525
For fields that are bools, integers, and strings:
26-
- If a field on the Gateway's NginxProxy is unspecified (`nil`), the Gateway __inherits__ the value of the field in the GatewayClass's NginxProxy.
27-
- If a field on the Gateway's NginxProxy is specified, its value __overrides__ the value of the field in the GatewayClass's NginxProxy.
26+
- If a field on the gateway's NginxProxy is unspecified (`nil`), the gateway __inherits__ the value of the field in the gatewayClass's NginxProxy.
27+
- If a field on the gateway's NginxProxy is specified, its value __overrides__ the value of the field in the gatewayClass's NginxProxy.
2828

2929
For array fields:
30-
- If the array on the Gateway's NginxProxy is unspecified (`nil`), the Gateway __inherits__ the entire array in the GatewayClass's NginxProxy.
31-
- If the array on the Gateway's NginxProxy is empty, it __overrides__ the entire array in the GatewayClass's NginxProxy, effectively unsetting the field.
32-
- If the array on the Gateway's NginxProxy is specified and not empty, it __overrides__ the entire array in the GatewayClass's NginxProxy.
30+
- If the array on the gateway's NginxProxy is unspecified (`nil`), the gateway __inherits__ the entire array in the gatewayClass's NginxProxy.
31+
- If the array on the gateway's NginxProxy is empty, it __overrides__ the entire array in the gatewayClass's NginxProxy, effectively unsetting the field.
32+
- If the array on the gateway's NginxProxy is specified and not empty, it __overrides__ the entire array in the gatewayClass's NginxProxy.
3333

3434

3535
### Merging Examples
3636

37-
This section contains examples of how NginxProxy resources are merged when they are attached to both a Gateway and its GatewayClass.
37+
This section contains examples of how NginxProxy resources are merged when they are attached to both a gateway and its gatewayClass.
3838

3939
#### Disable HTTP/2 for a Gateway
4040

41-
A GatewayClass references the following NginxProxy which explicitly allows HTTP/2 traffic and sets the IPFamily to ipv4:
41+
A gatewayClass references the following NginxProxy which explicitly allows HTTP/2 traffic and sets the IPFamily to ipv4:
4242

4343
```yaml
4444
apiVersion: gateway.nginx.org/v1alpha2
@@ -51,7 +51,7 @@ spec:
5151
disableHTTP: false
5252
```
5353
54-
To disable HTTP/2 traffic for a particular Gateway, reference the following NginxProxy in the Gateway's spec:
54+
To disable HTTP/2 traffic for a particular gateway, reference the following NginxProxy in the gateway's spec:
5555
5656
```yaml
5757
apiVersion: gateway.nginx.org/v1alpha2
@@ -63,7 +63,7 @@ spec:
6363
disableHTTP: true
6464
```
6565
66-
These NginxProxy resources are merged and the following settings are applied to the Gateway:
66+
These NginxProxy resources are merged and the following settings are applied to the gateway:
6767
6868
```yaml
6969
ipFamily: "ipv4"
@@ -72,7 +72,7 @@ disableHTTP: true
7272
7373
#### Change Telemetry configuration for a Gateway
7474
75-
A GatewayClass references the following NginxProxy which configures telemetry:
75+
A gatewayClass references the following NginxProxy which configures telemetry:
7676
7777
```yaml
7878
apiVersion: gateway.nginx.org/v1alpha2
@@ -92,7 +92,7 @@ spec:
9292
value: "company-value"
9393
```
9494
95-
To change the telemetry configuration for a particular Gateway, reference the following NginxProxy in the Gateway's spec:
95+
To change the telemetry configuration for a particular gateway, reference the following NginxProxy in the gateway's spec:
9696
9797
```yaml
9898
apiVersion: gateway.nginx.org/v1alpha2
@@ -111,7 +111,7 @@ spec:
111111
value: "app-value"
112112
```
113113
114-
These NginxProxy resources are merged and the following settings are applied to the Gateway:
114+
These NginxProxy resources are merged and the following settings are applied to the gateway:
115115
116116
```yaml
117117
telemetry:
@@ -128,7 +128,7 @@ These NginxProxy resources are merged and the following settings are applied to
128128
129129
#### Disable Tracing for a Gateway
130130
131-
A GatewayClass references the following NginxProxy which configures telemetry:
131+
A gatewayClass references the following NginxProxy which configures telemetry:
132132
133133
```yaml
134134
apiVersion: gateway.nginx.org/v1alpha2
@@ -144,7 +144,7 @@ spec:
144144
serviceName: "my-company"
145145
```
146146
147-
To disable tracing for a particular Gateway, reference the following NginxProxy in the Gateway's spec:
147+
To disable tracing for a particular gateway, reference the following NginxProxy in the gateway's spec:
148148
149149
```yaml
150150
apiVersion: gateway.nginx.org/v1alpha2
@@ -158,7 +158,7 @@ spec:
158158
- DisableTracing
159159
```
160160
161-
These NginxProxy resources are merged and the following settings are applied to the Gateway:
161+
These NginxProxy resources are merged and the following settings are applied to the gateway:
162162
163163
```yaml
164164
telemetry:
@@ -172,9 +172,9 @@ telemetry:
172172
173173
---
174174
175-
## Configuring the GatewayClass NginxProxy on Install
175+
## Configuring the GatewayClass NginxProxy on install
176176
177-
By default, the NginxProxy resource is not created when installing NGINX Gateway Fabric. However, you can set configuration options in the `nginx.config` Helm values, and the resource will be created and attached to the GatewayClass when NGINX Gateway Fabric is installed using Helm. You can also [manually create and attach](#manually-creating-nginxproxies) the resource after NGINX Gateway Fabric is already installed.
177+
By default, the `NginxProxy` resource is created in the same namespace where NGINX Gateway Fabric is installed. You can set configuration options in the `nginx.` Helm values, and the resource will be created and attached using the set values, when NGINX Gateway Fabric is installed using Helm. You can also manually create and attach specific `NginxProxy` resources to target different data planes [manually creating NginxProxies](#manually-creating-nginxProxies).
178178

179179
When installed using the Helm chart, the NginxProxy resource is named `<release-name>-proxy-config` and is created in the release Namespace.
180180

@@ -186,7 +186,7 @@ When installed using the Helm chart, the NginxProxy resource is named `<release-
186186

187187
## Manually Creating NginxProxies
188188

189-
The following command creates a basic `NginxProxy` configuration that sets the IP family to `ipv4` instead of the default value of `dual`:
189+
The following command creates a basic `NginxProxy` configuration in the `default` namespace that sets the IP family to `ipv4` instead of the default value of `dual`:
190190

191191
```yaml
192192
kubectl apply -f - <<EOF
@@ -200,13 +200,11 @@ spec:
200200
EOF
201201
```
202202

203-
**For a full list of configuration options that can be set, see the `NginxProxy spec` in the [API reference]({{< ref "/ngf/reference/api.md" >}}).**
204-
205203
---
206204

207205
### Attaching NginxProxy to GatewayClass
208206

209-
To attach the `ngf-proxy-config` NginxProxy to the GatewayClass:
207+
To attach the `ngf-proxy-config` NginxProxy to the gatewayClass:
210208

211209
```shell
212210
kubectl edit gatewayclass nginx
@@ -222,7 +220,7 @@ parametersRef:
222220
namespace: default
223221
```
224222

225-
After updating, you can check the status of the GatewayClass to see if the configuration is valid:
223+
After updating, you can check the status of the gatewayClass to see if the configuration is valid:
226224

227225
```shell
228226
kubectl describe gatewayclass nginx
@@ -246,7 +244,7 @@ If everything is valid, the `ResolvedRefs` condition should be `True`. Otherwise
246244

247245
### Attaching NginxProxy to Gateway
248246

249-
To attach the `ngf-proxy-config` NginxProxy to a Gateway:
247+
To attach the `ngf-proxy-config` NginxProxy to a gateway:
250248

251249
```shell
252250
kubectl edit gateway <gateway-name>
@@ -262,7 +260,7 @@ infrastructure:
262260
name: ngf-proxy-config
263261
```
264262

265-
After updating, you can check the status of the Gateway to see if the configuration is valid:
263+
After updating, you can check the status of the gateway to see if the configuration is valid:
266264

267265
```shell
268266
kubectl describe gateway <gateway-name>
@@ -282,11 +280,13 @@ Status:
282280

283281
If everything is valid, the `ResolvedRefs` condition should be `True`. Otherwise, you will see an `InvalidParameters` condition in the status.
284282

283+
{{< note >}} The `NginxProxy` resource must reside in the same namespace as the gateway it is attached to. {{< /note >}}
284+
285285
---
286286

287287
## Configure the data plane log level
288288

289-
You can use the `NginxProxy` resource to dynamically configure the Data Plane Log Level.
289+
You can use the `NginxProxy` resource at the gatewayClass level to dynamically configure the log level for all data plane instances.
290290

291291
The following command creates a basic `NginxProxy` configuration that sets the log level to `warn` instead of the default value of `info`:
292292

@@ -302,7 +302,7 @@ spec:
302302
EOF
303303
```
304304

305-
To view the full list of supported log levels, see the `NginxProxy spec` in the [API reference]({{< ref "/ngf/reference/api.md" >}}).
305+
Other log levels supported are - debug, notice, error, crit, alert, emerg.
306306

307307
{{< note >}}For `debug` logging to work, NGINX needs to be built with `--with-debug` or "in debug mode". NGINX Gateway Fabric can easily
308308
be [run with NGINX in debug mode](#run-nginx-gateway-fabric-with-nginx-in-debug-mode) upon startup through the addition
@@ -375,6 +375,36 @@ spec:
375375
EOF
376376
```
377377

378-
For the full configuration API, see the `NginxProxy spec` in the [API reference]({{< ref "/ngf/reference/api.md" >}}).
379-
380378
{{< note >}} When sending curl requests to a server expecting proxy information, use the flag `--haproxy-protocol` to avoid broken header errors. {{< /note >}}
379+
380+
---
381+
382+
## Configure infrastructure-related settings
383+
384+
You can configure deployment and service settings for all data plane instances by editing the `NginxProxy` resource at the gatewayClass level. These settings can also be specified under `nginx.` in the Helm values file.
385+
386+
Users can specify these settings for NGINX data plane deployments:
387+
388+
- _replicas_ specifies the number of data plane pod replicas..
389+
- The `pod` section provides control over pod scheduling and lifecycle behavior. You can configure settings such as _terminationGracePeriodSeconds_, _tolerations_, _nodeSelector_, _affinity_, and _topologySpreadConstraints_. Use _extraVolumes_ to mount additional volumes, typically alongside container-level _extraVolumeMounts_.
390+
- The `container` defines settings for the NGINX container itself., such as resource requests and limits using _resources_, and lifecycle hooks like preStop or postStart via _lifecycle_. You can also specify _extraVolumeMounts_ to mount additional volumes defined at the pod level.
391+
392+
Users can specify these settings for NGINX data plane service in the `service` config:
393+
394+
- _type_ specifies the service type for the NGINX data plane. Allowed values are ClusterIP, NodePort, or LoadBalancer.
395+
- _externalTrafficPolicy_ sets how external traffic is handled. `Local` preserves the client’s source IP.
396+
- _annotations_ adds custom annotations to the NGINX data plane service.
397+
- Certain fields are only applicable when _service.type_ is set to `LoadBalancer`: _loadBalancerIP_ to assign a static IP, _loadBalancerClass_ to define the load balancer implementation, and _loadBalancerSourceRanges_ to restrict access to specific IP ranges (CIDRs).
398+
399+
The below fields can only be specified when the `service.type` is `LoadBalancer`:
400+
- _loadBalancerIP_ specifies the static IP address of the load balancer.
401+
- _loadBalancerClass_ specifies the class of the load balancer implementation this service belongs to.
402+
- _loadBalancerSourceRanges_ specifies IP ranges (CIDR) that are allowed to access the load balancer.
403+
404+
---
405+
406+
## See also
407+
408+
For a full list of configuration options that can be set, see the `NginxProxy spec` in the [API reference]({{< ref "/ngf/reference/api.md" >}}).
409+
410+
---

0 commit comments

Comments
 (0)