Skip to content

Commit 9738803

Browse files
committed
modify section about infrastructure related settings, api ref links
1 parent 4ab7405 commit 9738803

File tree

1 file changed

+33
-62
lines changed

1 file changed

+33
-62
lines changed

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

+33-62
Original file line numberDiff line numberDiff line change
@@ -198,45 +198,7 @@ spec:
198198
EOF
199199
```
200200

201-
---
202-
203-
### Attaching NginxProxy to GatewayClass
204-
205-
To attach the `ngf-proxy-config` NginxProxy to the GatewayClass:
206-
207-
```shell
208-
kubectl edit gatewayclass nginx
209-
```
210-
211-
This will open your default editor, allowing you to add the following to the `spec`:
212-
213-
```yaml
214-
parametersRef:
215-
group: gateway.nginx.org
216-
kind: NginxProxy
217-
name: ngf-proxy-config
218-
namespace: default
219-
```
220-
221-
After updating, you can check the status of the GatewayClass to see if the configuration is valid:
222-
223-
```shell
224-
kubectl describe gatewayclass nginx
225-
```
226-
227-
```text
228-
...
229-
Status:
230-
Conditions:
231-
...
232-
Message: parametersRef resource is resolved
233-
Observed Generation: 1
234-
Reason: ResolvedRefs
235-
Status: True
236-
Type: ResolvedRefs
237-
```
238-
239-
If everything is valid, the `ResolvedRefs` condition should be `True`. Otherwise, you will see an `InvalidParameters` condition in the status.
201+
For a full list of configuration options that can be set, see the `NginxProxy spec` in the [API reference]({{< ref "/ngf/reference/api.md" >}}).
240202

241203
---
242204

@@ -258,6 +220,8 @@ infrastructure:
258220
name: ngf-proxy-config
259221
```
260222

223+
{{< note >}} The `NginxProxy` resource must reside in the same namespace as the Gateway it is attached to. {{< /note >}}
224+
261225
After updating, you can check the status of the Gateway to see if the configuration is valid:
262226

263227
```shell
@@ -278,13 +242,11 @@ Status:
278242

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

281-
{{< note >}} The `NginxProxy` resource must reside in the same namespace as the Gateway it is attached to. {{< /note >}}
282-
283245
---
284246

285247
## Configure the data plane log level
286248

287-
You can use the `NginxProxy` resource at the GatewayClass level to dynamically configure the log level for all data plane instances.
249+
You can use the `NginxProxy` resource to dynamically configure the log level.
288250

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

@@ -300,7 +262,7 @@ spec:
300262
EOF
301263
```
302264

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

305267
{{< note >}}For `debug` logging to work, NGINX needs to be built with `--with-debug` or "in debug mode". NGINX Gateway Fabric can easily
306268
be [run with NGINX in debug mode](#run-nginx-gateway-fabric-with-nginx-in-debug-mode) upon startup through the addition
@@ -379,27 +341,36 @@ EOF
379341

380342
## Configure infrastructure-related settings
381343

382-
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.
383-
384-
Users can specify these settings for NGINX data plane deployments:
385-
386-
- _replicas_ specifies the number of data plane pod replicas..
387-
- 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_.
388-
- 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.
344+
You can configure deployment and service settings for all data plane instances by editing the `NginxProxy` resource at the Gateway or GatewayClass level. These settings can also be specified under `nginx.` in the Helm values file. You can edit things such as replicas, pod scheduling options, container resource limits, extra volume mounts, service types and load balancer settings.
389345

390-
Users can specify these settings for NGINX data plane service in the `service` config:
391-
392-
- _type_ specifies the service type for the NGINX data plane. Allowed values are ClusterIP, NodePort, or LoadBalancer.
393-
- _externalTrafficPolicy_ sets how external traffic is handled. `Local` preserves the client’s source IP.
394-
- _annotations_ adds custom annotations to the NGINX data plane service.
395-
396-
The below fields can only be specified when the `service.type` is `LoadBalancer`:
397-
- _loadBalancerIP_ specifies the static IP address of the load balancer.
398-
- _loadBalancerClass_ specifies the class of the load balancer implementation this service belongs to.
399-
- _loadBalancerSourceRanges_ specifies IP ranges (CIDR) that are allowed to access the load balancer.
346+
The following command creates an `NginxProxy` resource with 2 replicas, sets `container.resources.requests` to 100m CPU and 128Mi memory, configures a 90 second `pod.terminationGracePeriodSeconds`, and sets the service type to `LoadBalancer` with IP `192.87.9.1` and AWS NLB annotation.
400347

348+
```yaml
349+
kubectl apply -f - <<EOF
350+
apiVersion: gateway.nginx.org/v1alpha2
351+
kind: NginxProxy
352+
metadata:
353+
name: ngf-proxy-config-test
354+
spec:
355+
kubernetes:
356+
deployment:
357+
container:
358+
resources:
359+
requests:
360+
cpu: 100m
361+
memory: 128Mi
362+
pod:
363+
terminationGracePeriodSeconds: 90
364+
replicas: 2
365+
service:
366+
annotations:
367+
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
368+
type: LoadBalancer
369+
loadBalancerIP: "192.87.9.1"
370+
EOF
371+
```
401372

402-
## See also
373+
To view the full list of supported log levels, see the `NginxProxy spec` in the [API reference]({{< ref "/ngf/reference/api.md" >}}).
403374

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

0 commit comments

Comments
 (0)