Skip to content

Commit 40d0261

Browse files
committed
modify section about infrastructure related settings
1 parent 4ab7405 commit 40d0261

File tree

1 file changed

+31
-58
lines changed

1 file changed

+31
-58
lines changed

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

Lines changed: 31 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -200,46 +200,6 @@ EOF
200200

201201
---
202202

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.
240-
241-
---
242-
243203
### Attaching NginxProxy to Gateway
244204

245205
To attach the `ngf-proxy-config` NginxProxy to a Gateway:
@@ -284,7 +244,7 @@ If everything is valid, the `ResolvedRefs` condition should be `True`. Otherwise
284244

285245
## Configure the data plane log level
286246

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

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

@@ -300,7 +260,7 @@ spec:
300260
EOF
301261
```
302262

303-
Other log levels supported are debug, notice, error, crit, alert, emerg.
263+
Other log levels supported are can be found in the `NginxProxy` [spec](#see-also).
304264

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

380340
## Configure infrastructure-related settings
381341

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:
342+
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.
385343

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

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.
371+
All infrastructure-related configurable settings can be found in the `NginxProxy` [spec](#see-also).
400372

373+
---
401374

402375
## See also
403376

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" >}}).
377+
**For a full list of configuration options that can be set, see the `NginxProxy spec` in the [API reference]({{< ref "/ngf/reference/api.md" >}}).**
405378

0 commit comments

Comments
 (0)