diff --git a/content/ngf/how-to/data-plane-configuration.md b/content/ngf/how-to/data-plane-configuration.md
index 4285528bd..a18725ce5 100644
--- a/content/ngf/how-to/data-plane-configuration.md
+++ b/content/ngf/how-to/data-plane-configuration.md
@@ -375,3 +375,128 @@ To view the full list of configuration options, see the `NginxProxy spec` in the
---
+### Patch data plane Service, Deployment, and DaemonSet
+
+NGINX Gateway Fabric supports advanced customization of the data plane Service, Deployment, and DaemonSet objects using patches in the `NginxProxy` resource. This allows you to apply Kubernetes-style patches to these resources, enabling custom labels, annotations, or other modifications that are not directly exposed via the NginxProxy spec.
+
+#### Supported Patch Types
+
+You can specify one or more patches for each of the following resources:
+
+- `spec.kubernetes.service.patches`
+- `spec.kubernetes.deployment.patches`
+- `spec.kubernetes.daemonSet.patches`
+
+Each patch has two fields:
+
+- `type`: The patch type. Supported values are:
+ - `StrategicMerge` (default): Strategic merge patch (Kubernetes default for most resources)
+ - `Merge`: JSON merge patch (RFC 7386)
+ - `JSONPatch`: JSON patch (RFC 6902)
+- `value`: The patch data. For `StrategicMerge` and `Merge`, this should be a JSON object. For `JSONPatch`, this should be a JSON array of patch operations.
+
+Patches are applied in the order they appear in the array. Later patches can override fields set by earlier patches.
+
+#### Example: Configure Service with session affinity
+
+```yaml
+apiVersion: gateway.nginx.org/v1alpha2
+kind: NginxProxy
+metadata:
+ name: ngf-proxy-patch-service
+spec:
+ kubernetes:
+ service:
+ patches:
+ - type: StrategicMerge
+ value:
+ spec:
+ sessionAffinity: ClientIP
+ sessionAffinityConfig:
+ clientIP:
+ timeoutSeconds: 300
+```
+
+#### Example: Configure Deployment with custom strategy
+
+```yaml
+apiVersion: gateway.nginx.org/v1alpha2
+kind: NginxProxy
+metadata:
+ name: ngf-proxy-patch-deployment
+spec:
+ kubernetes:
+ deployment:
+ patches:
+ - type: Merge
+ value:
+ spec:
+ strategy:
+ type: RollingUpdate
+ rollingUpdate:
+ maxUnavailable: 0
+ maxSurge: 2
+```
+
+#### Example: Use JSONPatch to configure DaemonSet host networking and priority
+
+```yaml
+apiVersion: gateway.nginx.org/v1alpha2
+kind: NginxProxy
+metadata:
+ name: ngf-proxy-patch-daemonset
+spec:
+ kubernetes:
+ daemonSet:
+ patches:
+ - type: JSONPatch
+ value:
+ - op: add
+ path: /spec/template/spec/hostNetwork
+ value: true
+ - op: add
+ path: /spec/template/spec/dnsPolicy
+ value: "ClusterFirstWithHostNet"
+ - op: add
+ path: /spec/template/spec/priorityClassName
+ value: "system-node-critical"
+```
+
+#### Example: Multiple patches, later patch overrides earlier
+
+```yaml
+apiVersion: gateway.nginx.org/v1alpha2
+kind: NginxProxy
+metadata:
+ name: ngf-proxy-multi-patch
+spec:
+ kubernetes:
+ service:
+ patches:
+ - type: StrategicMerge
+ value:
+ spec:
+ sessionAffinity: ClientIP
+ publishNotReadyAddresses: false
+ - type: StrategicMerge
+ value:
+ spec:
+ sessionAffinity: None
+ publishNotReadyAddresses: true
+```
+
+In this example, the final Service will have `sessionAffinity: None` and `publishNotReadyAddresses: true` because the second patch overrides the values from the first patch.
+
+{{< note >}}
+**Which patch type should I use?**
+
+- **StrategicMerge** is the default and most user-friendly for Kubernetes-native resources like Deployments and Services. It understands lists and merges fields intelligently (e.g., merging containers by name). Use this for most use cases.
+- **Merge** (JSON Merge Patch) is simpler and works well for basic object merges, but does not handle lists or complex merging. Use this if you want to replace entire fields or for non-Kubernetes-native resources.
+- **JSONPatch** is the most powerful and flexible, allowing you to add, remove, or replace specific fields using RFC 6902 operations. Use this for advanced or fine-grained changes, but it is more verbose and error-prone.
+
+If unsure, start with StrategicMerge. Use JSONPatch only if you need to surgically modify fields that cannot be addressed by the other patch types.
+
+Patches are applied after all other NginxProxy configuration is rendered. Invalid patches will result in a validation error and will not be applied.
+{{< /note >}}
+
+---
diff --git a/content/ngf/how-to/scaling.md b/content/ngf/how-to/scaling.md
index 8e9961798..b316cf1d0 100644
--- a/content/ngf/how-to/scaling.md
+++ b/content/ngf/how-to/scaling.md
@@ -16,36 +16,64 @@ It provides guidance on how to scale each plane effectively, and when you should
The data plane is the NGINX deployment that handles user traffic to backend applications. Every Gateway object created provisions its own NGINX deployment and configuration.
-You have two options for scaling the data plane:
+You have multiple options for scaling the data plane:
+- Increasing the number of [worker connections](https://nginx.org/en/docs/ngx_core_module.html#worker_connections) for an existing deployment
- Increasing the number of replicas for an existing deployment
- Creating a new Gateway for a new data plane
-#### When to increase replicas or create a new Gateway
+#### When to increase worker connections, replicas, or create a new Gateway
-Understanding when to increase replicas or create a new Gateway is key to managing traffic effectively.
+Understanding when to increase worker connections, replicas, or create a new Gateway is key to managing traffic effectively.
-Increasing data plane replicas is ideal when you need to handle more traffic without changing the configuration.
+Increasing worker connections or replicas is ideal when you need to handle more traffic without changing the overall routing configuration. Setting the worker connections field allows a single NGINX data plane instance to handle more connections without needing to scale the replicas. However, scaling the replicas can be beneficial to reduce single points of failure.
-For example, if you're routing traffic to `api.example.com` and notice an increase in load, you can scale the replicas from 1 to 5 to better distribute the traffic and reduce latency.
+Scaling replicas can be done manually or automatically using a [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) (HPA).
-All replicas will share the same configuration from the Gateway used to set up the data plane, simplifying configuration management.
+To update worker connections (default: 1024), replicas, or enable autoscaling, you can edit the `NginxProxy` resource:
-There are two ways to modify the number of replicas for an NGINX deployment:
+```shell
+kubectl edit nginxproxies.gateway.nginx.org ngf-proxy-config -n nginx-gateway
+```
-First, at the time of installation you can modify the field `nginx.replicas` in the `values.yaml` or add the `--set nginx.replicas=` flag to the `helm install` command:
+{{< call-out "note" >}}
-```shell
-helm install ngf oci://ghcr.io/nginx/charts/nginx-gateway-fabric --create-namespace -n nginx-gateway --set nginx.replicas=5
+The NginxProxy resource in this example lives in the control plane namespace (default: `nginx-gateway`) and applies to the GatewayClass, but you can also define one per Gateway. See the [Data plane configuration]({{< ref "/ngf/how-to/data-plane-configuration.md" >}}) document for more information.
+
+{{< /call-out >}}
+
+- Worker connections is set using the `workerConnections` field:
+
+```yaml
+spec:
+ workerConnections: 4096
```
-Secondly, you can update the `NginxProxy` resource while NGINX is running to modify the `kubernetes.deployment.replicas` field and scale the data plane deployment dynamically:
+- Replicas are set using the `kubernetes.deployment.replicas` field:
-```shell
-kubectl edit nginxproxies.gateway.nginx.org ngf-proxy-config -n nginx-gateway
+```yaml
+spec:
+ kubernetes:
+ deployment:
+ replicas: 3
+```
+
+- Autoscaling can be enabled using the `kubernetes.deployment.autoscaling` field. The default `replicas` value will be used until the Horizontal Pod Autoscaler is running.
+
+```yaml
+spec:
+ kubernetes:
+ deployment:
+ autoscaling:
+ enable: true
+ maxReplicas: 10
```
-The alternate way to scale the data plane is by creating a new Gateway. This is beneficial when you need distinct configurations, isolation, or separate policies.
+See the `NginxProxy` section of the [API reference]({{< ref "/ngf/reference/api.md" >}}) for the full specification.
+
+All of these fields are also available at installation time by setting them in the [helm values](https://github.com/nginx/nginx-gateway-fabric/blob/main/charts/nginx-gateway-fabric/values.yaml).
+
+An alternate way to scale the data plane is by creating a new Gateway. This is beneficial when you need distinct configurations, isolation, or separate policies.
For example, if you're routing traffic to a new domain `admin.example.com` and require a different TLS certificate, stricter rate limits, or separate authentication policies, creating a new Gateway could be a good approach.
@@ -60,7 +88,9 @@ Scaling the control plane can be beneficial in the following scenarios:
1. _Higher availability_ - When a control plane pod crashes, runs out of memory, or goes down during an upgrade, it can interrupt configuration delivery. By scaling to multiple replicas, another pod can quickly step in and take over, keeping things running smoothly with minimal downtime.
1. _Faster configuration distribution_ - As the number of connected NGINX instances grows, a single control plane pod may become a bottleneck in handling connections or streaming configuration updates. Scaling the control plane improves concurrency and responsiveness when delivering configuration over gRPC.
-To scale the control plane, use the `kubectl scale` command on the control plane deployment to increase or decrease the number of replicas. For example, the following command scales the control plane deployment to 3 replicas:
+To automatically scale the control plane, you can create a [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) (HPA) in the control plane namespace (default: `nginx-gateway`). At installation time, the [NGINX Gateway Fabric helm chart](https://github.com/nginx/nginx-gateway-fabric/blob/main/charts/nginx-gateway-fabric/values.yaml) allows you to set the HPA configuration in the `nginxGateway.autoscaling` section, which will provision an HPA for you. If NGINX Gateway Fabric is already running, then you can manually define the HPA and deploy it.
+
+To manually scale the control plane, use the `kubectl scale` command on the control plane deployment to increase or decrease the number of replicas. For example, the following command scales the control plane deployment to 3 replicas:
```shell
kubectl scale deployment -n nginx-gateway ngf-nginx-gateway-fabric --replicas 3
diff --git a/content/ngf/install/upgrade-version.md b/content/ngf/install/upgrade-version.md
index a415eb0c6..4d6e06f89 100644
--- a/content/ngf/install/upgrade-version.md
+++ b/content/ngf/install/upgrade-version.md
@@ -13,15 +13,13 @@ It covers the necessary steps for minor versions as well as major versions (such
Many of the nuances in upgrade paths relate to how custom resource definitions (CRDs) are managed.
-{{< call-out "tip" >}}
-To avoid interruptions, review the [Delay pod termination for zero downtime upgrades](#configure-delayed-pod-termination-for-zero-downtime-upgrades) section.
+## Minor NGINX Gateway Fabric upgrades
+{{< call-out "important" >}}
+Upgrading from v2.0.x to v2.1 requires the NGINX Gateway Fabric control plane to be uninstalled and then reinstalled to avoid any downtime to user traffic. CRDs do not need to be removed. The NGINX data plane deployment is not affected by this process, and traffic should still flow uninterrupted. The steps are described below.
{{< /call-out >}}
-
-## Minor NGINX Gateway Fabric upgrades
-
{{< call-out "important" >}} NGINX Plus users need a JWT secret before upgrading from version 1.4.0 to 1.5.x.
Follow the steps in [Set up the JWT]({{< ref "/ngf/install/nginx-plus.md#set-up-the-jwt" >}}) to create the Secret.
@@ -72,7 +70,7 @@ Warning: kubectl apply should be used on resource created by either kubectl crea
{{% tab name="Helm" %}}
-{{< call-out "important" >}} If you are using NGINX Plus and have a different Secret name than the default `nplus-license` name, specify the Secret name by setting `--set nginx.usage.secretName=
disableSNIHostValidationDisableSNIHostValidation disables the validation that ensures the SNI hostname +matches the Host header in HTTPS requests. When disabled, HTTPS connections can +be reused for requests to different hostnames covered by the same certificate. +This resolves HTTP/2 connection coalescing issues with wildcard certificates but +introduces security risks as described in Gateway API GEP-3567. +If not specified, defaults to false (validation enabled).
+kubernetesKubernetes contains the configuration for the NGINX Deployment and Service Kubernetes objects.
workerConnectionsWorkerConnections specifies the maximum number of simultaneous connections that can be opened by a worker process. +Default is 1024.
++(Appears on: +DeploymentSpec) +
++
AutoscalingSpec is the configuration for the Horizontal Pod Autoscaling.
+ +| Field | +Description | +
|---|---|
+behavior+ + +Kubernetes autoscaling/v2.HorizontalPodAutoscalerBehavior + + + |
+
+(Optional)
+ Behavior configures the scaling behavior of the target +in both Up and Down directions (scaleUp and scaleDown fields respectively). +If not set, the default HPAScalingRules for scale up and scale down are used. + |
+
+targetCPUUtilizationPercentage+ +int32 + + |
+
+(Optional)
+ Target cpu utilization percentage of HPA. + |
+
+targetMemoryUtilizationPercentage+ +int32 + + |
+
+(Optional)
+ Target memory utilization percentage of HPA. + |
+
+minReplicas+ +int32 + + |
+
+(Optional)
+ Minimum number of replicas. + |
+
+metrics+ + +[]Kubernetes autoscaling/v2.MetricSpec + + + |
+
+(Optional)
+ Metrics configures additional metrics options. + |
+
+maxReplicas+ +int32 + + |
+
+ Maximum number of replicas. + |
+
+enable+ +bool + + |
+
+ Enable or disable Horizontal Pod Autoscaler. + |
+
readinessProbeReadinessProbe defines the readiness probe for the NGINX container.
+hostPortsHostPorts are the list of ports to expose on the host.
+volumeMountscontainerContainer defines container fields for the NGINX container.
+podcontainerpatchesContainer defines container fields for the NGINX container.
+Patches are custom patches to apply to the NGINX DaemonSet.
autoscalingAutoscaling defines the configuration for Horizontal Pod Autoscaling.
+podContainer defines container fields for the NGINX container.
patchesPatches are custom patches to apply to the NGINX Deployment.
++(Appears on: +ContainerSpec) +
++
HostPort exposes an nginx container port on the host.
+ +| Field | +Description | +
|---|---|
+port+ +int32 + + |
+
+ Port to expose on the host. + |
+
+containerPort+ +int32 + + |
+
+ ContainerPort is the port on the nginx container to map to the HostPort. + |
+
string alias)¶
disableSNIHostValidationDisableSNIHostValidation disables the validation that ensures the SNI hostname +matches the Host header in HTTPS requests. When disabled, HTTPS connections can +be reused for requests to different hostnames covered by the same certificate. +This resolves HTTP/2 connection coalescing issues with wildcard certificates but +introduces security risks as described in Gateway API GEP-3567. +If not specified, defaults to false (validation enabled).
+kubernetesKubernetes contains the configuration for the NGINX Deployment and Service Kubernetes objects.
workerConnectionsWorkerConnections specifies the maximum number of simultaneous connections that can be opened by a worker process. +Default is 1024.
+Port is the NodePort to expose. -kubebuilder:validation:Minimum=1 -kubebuilder:validation:Maximum=65535
+Port is the NodePort to expose.
ListenerPort is the Gateway listener port that this NodePort maps to. -kubebuilder:validation:Minimum=1 -kubebuilder:validation:Maximum=65535
+ListenerPort is the Gateway listener port that this NodePort maps to.
+(Appears on: +DaemonSetSpec, +DeploymentSpec, +ServiceSpec) +
++
Patch defines a patch to apply to a Kubernetes object.
+ +| Field | +Description | +
|---|---|
+type+ + +PatchType + + + |
+
+(Optional)
+ Type is the type of patch. Defaults to StrategicMerge. + |
+
+value+ +k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON + + |
+
+(Optional)
+ Value is the patch data as raw JSON. +For StrategicMerge and Merge patches, this should be a JSON object. +For JSONPatch patches, this should be a JSON array of patch operations. + |
+
string alias)¶
++(Appears on: +Patch) +
++
PatchType specifies the type of patch.
+ +| Value | +Description | +
|---|---|
"JSONPatch" |
+PatchTypeJSONPatch uses JSON patch (RFC 6902). + |
+
"Merge" |
+PatchTypeMerge uses merge patch (RFC 7386). + |
+
"StrategicMerge" |
+PatchTypeStrategicMerge uses strategic merge patch. + |
+
+(Appears on: +ContainerSpec) +
++
ReadinessProbeSpec defines the configuration for the NGINX readiness probe.
+ +| Field | +Description | +
|---|---|
+port+ +int32 + + |
+
+(Optional)
+ Port is the port on which the readiness endpoint is exposed. +If not specified, the default port is 8081. + |
+
+initialDelaySeconds+ +int32 + + |
+
+(Optional)
+ InitialDelaySeconds is the number of seconds after the container has +started before the readiness probe is initiated. +If not specified, the default is 3 seconds. + |
+
patchesPatches are custom patches to apply to the NGINX Service.
+