Skip to content

Commit eb1ad77

Browse files
committed
fix formatting issues
1 parent 639e36c commit eb1ad77

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

content/ngf/how-to/scaling.md

+12-9
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@ All replicas will share the same configuration from the Gateway used to set up t
3333

3434
There are two ways to modify the number of replicas for an NGINX deployment:
3535

36-
First, by modifying the field `nginx.replicas` in the `values.yaml` or adding the `--set nginx.replicas=` flag to the `helm install` command.
36+
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
3737

38-
```text
38+
```shell
3939
helm install ngf oci://ghcr.io/nginx/charts/nginx-gateway-fabric --create-namespace -n nginx-gateway --set nginx.replicas=5
40-
Secondly, by editing the `NginxProxy` resource attached to the data plane deployment. You can specify the number of replicas in the field `kubernetes.deployment.replicas` of the nginxProxy resource:
40+
```
4141

42-
```text
43-
kubectl edit nginxproxies.gateway.nginx.org ngf-proxy-config -n nginx-gateway
42+
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:
4443

44+
```shell
45+
kubectl edit nginxproxies.gateway.nginx.org ngf-proxy-config -n nginx-gateway
46+
```
4547

4648
The alternate way to scale the data plane is by creating a new Gateway. This is is beneficial when you need distinct configurations, isolation, or separate policies.
4749

@@ -58,11 +60,10 @@ Scaling the control plane can be beneficial in the following scenarios:
5860

5961
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.
6062
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.
61-
1. _Improved resilience_ - Running multiple control plane replicas provides fault tolerance. Even if the pod holding the leader lease fails, another pod can quickly step in and take over, preventing disruptions in status updates.
6263

6364
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:
6465

65-
```text
66+
```shell
6667
kubectl scale deployment -n nginx-gateway ngf-nginx-gateway-fabric --replicas 3
6768
```
6869

@@ -82,13 +83,15 @@ There is still a chance (however unlikely) that one of the data planes connected
8283

8384
To identify which control plane pod currently holds the leader election lease, retrieve the leases in the same namespace as the control plane pods. For example:
8485

85-
```text
86+
```shell
8687
kubectl get leases -n nginx-gateway
88+
```
8789

8890
The current leader lease is held by the pod `ngf-nginx-gateway-fabric-b45ffc8d6-d9z2g`:
8991

90-
```text
92+
```shell
9193
NAME HOLDER AGE
9294
ngf-nginx-gateway-fabric-leader-election ngf-nginx-gateway-fabric-b45ffc8d6-d9z2g_2ef81ced-f19d-41a0-9fcd-a68d89380d10 16d
95+
```
9396

9497
---

0 commit comments

Comments
 (0)