From 98af08bea9959f6ca0ca39900e32c3e6dff5c33a Mon Sep 17 00:00:00 2001 From: Tom Sleebe Date: Wed, 10 Jul 2024 09:28:07 +0200 Subject: [PATCH 1/5] Add capability to add resource limits/requests --- charts/nginx-gateway-fabric/templates/deployment.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/nginx-gateway-fabric/templates/deployment.yaml b/charts/nginx-gateway-fabric/templates/deployment.yaml index 9bd5b40223..ce2d38a8e9 100644 --- a/charts/nginx-gateway-fabric/templates/deployment.yaml +++ b/charts/nginx-gateway-fabric/templates/deployment.yaml @@ -90,6 +90,10 @@ spec: lifecycle: {{- toYaml .Values.nginxGateway.lifecycle | nindent 10 }} {{- end }} + {{- if .Values.nginxGateway.resources }} + resources: + {{- toYaml .Values.nginxGateway.resources | nindent 10 }} + {{- end }} ports: {{- if .Values.metrics.enable }} - name: metrics From 80fc692e704f35a683a0cad99485cd893c69ce43 Mon Sep 17 00:00:00 2001 From: Tom Sleebe Date: Wed, 10 Jul 2024 09:41:38 +0200 Subject: [PATCH 2/5] Update readme with new value --- charts/nginx-gateway-fabric/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/nginx-gateway-fabric/README.md b/charts/nginx-gateway-fabric/README.md index de3be00170..950fd1f15a 100644 --- a/charts/nginx-gateway-fabric/README.md +++ b/charts/nginx-gateway-fabric/README.md @@ -285,6 +285,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri | `nginxGateway.leaderElection.enable` | Enable leader election. Leader election is used to avoid multiple replicas of the NGINX Gateway Fabric reporting the status of the Gateway API resources. If not enabled, all replicas of NGINX Gateway Fabric will update the statuses of the Gateway API resources. | bool | `true` | | `nginxGateway.leaderElection.lockName` | The name of the leader election lock. A Lease object with this name will be created in the same Namespace as the controller. | string | Autogenerated if not set or set to "". | | `nginxGateway.lifecycle` | The lifecycle of the nginx-gateway container. | object | `{}` | +| `nginxGateway.resources` | The resource requests and/or limits of the nginx-gateway container. | object | `{}` | | `nginxGateway.productTelemetry.enable` | Enable the collection of product telemetry. | bool | `true` | | `nginxGateway.readinessProbe.enable` | Enable the /readyz endpoint on the control plane. | bool | `true` | | `nginxGateway.readinessProbe.initialDelaySeconds` | The number of seconds after the Pod has started before the readiness probes are initiated. | int | `3` | From 6d156b97f8f8b453345353f30b4391c1af8a4133 Mon Sep 17 00:00:00 2001 From: Tom Sleebe Date: Thu, 11 Jul 2024 07:58:39 +0200 Subject: [PATCH 3/5] Add empty values as default for gateway resources --- charts/nginx-gateway-fabric/values.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/charts/nginx-gateway-fabric/values.yaml b/charts/nginx-gateway-fabric/values.yaml index e0a4854bb8..6745049117 100644 --- a/charts/nginx-gateway-fabric/values.yaml +++ b/charts/nginx-gateway-fabric/values.yaml @@ -22,6 +22,10 @@ nginxGateway: # -- Set of custom annotations for NginxGateway objects. configAnnotations: {} + resources: + requests: + cpu: 0.001 + memory: 50Mi # -- The number of replicas of the NGINX Gateway Fabric Deployment. replicaCount: 1 @@ -64,6 +68,9 @@ nginxGateway: # -- The lifecycle of the nginx-gateway container. lifecycle: {} + # -- The resource requests and/or limits of the nginx-gateway container. + resources: {} + # -- extraVolumeMounts are the additional volume mounts for the nginx-gateway container. extraVolumeMounts: [] From 8fe094b8c632ad8a79b53c766ced858df535ed94 Mon Sep 17 00:00:00 2001 From: Tom Sleebe Date: Thu, 11 Jul 2024 08:00:10 +0200 Subject: [PATCH 4/5] Woops remove local testcase values --- charts/nginx-gateway-fabric/values.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/charts/nginx-gateway-fabric/values.yaml b/charts/nginx-gateway-fabric/values.yaml index 6745049117..e9804ae239 100644 --- a/charts/nginx-gateway-fabric/values.yaml +++ b/charts/nginx-gateway-fabric/values.yaml @@ -22,10 +22,6 @@ nginxGateway: # -- Set of custom annotations for NginxGateway objects. configAnnotations: {} - resources: - requests: - cpu: 0.001 - memory: 50Mi # -- The number of replicas of the NGINX Gateway Fabric Deployment. replicaCount: 1 From e42e16e9c04db88535dafb430961a0a62302fc7c Mon Sep 17 00:00:00 2001 From: Tom Sleebe Date: Fri, 12 Jul 2024 06:50:14 +0200 Subject: [PATCH 5/5] Ran make generate-helm-docs to hopefully fix the pipeline error --- charts/nginx-gateway-fabric/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/nginx-gateway-fabric/README.md b/charts/nginx-gateway-fabric/README.md index 950fd1f15a..73aaaa2bc6 100644 --- a/charts/nginx-gateway-fabric/README.md +++ b/charts/nginx-gateway-fabric/README.md @@ -285,12 +285,12 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri | `nginxGateway.leaderElection.enable` | Enable leader election. Leader election is used to avoid multiple replicas of the NGINX Gateway Fabric reporting the status of the Gateway API resources. If not enabled, all replicas of NGINX Gateway Fabric will update the statuses of the Gateway API resources. | bool | `true` | | `nginxGateway.leaderElection.lockName` | The name of the leader election lock. A Lease object with this name will be created in the same Namespace as the controller. | string | Autogenerated if not set or set to "". | | `nginxGateway.lifecycle` | The lifecycle of the nginx-gateway container. | object | `{}` | -| `nginxGateway.resources` | The resource requests and/or limits of the nginx-gateway container. | object | `{}` | | `nginxGateway.productTelemetry.enable` | Enable the collection of product telemetry. | bool | `true` | | `nginxGateway.readinessProbe.enable` | Enable the /readyz endpoint on the control plane. | bool | `true` | | `nginxGateway.readinessProbe.initialDelaySeconds` | The number of seconds after the Pod has started before the readiness probes are initiated. | int | `3` | | `nginxGateway.readinessProbe.port` | Port in which the readiness endpoint is exposed. | int | `8081` | | `nginxGateway.replicaCount` | The number of replicas of the NGINX Gateway Fabric Deployment. | int | `1` | +| `nginxGateway.resources` | The resource requests and/or limits of the nginx-gateway container. | object | `{}` | | `nginxGateway.securityContext.allowPrivilegeEscalation` | Some environments may need this set to true in order for the control plane to successfully reload NGINX. | bool | `false` | | `nodeSelector` | The nodeSelector of the NGINX Gateway Fabric pod. | object | `{}` | | `service.annotations` | The annotations of the NGINX Gateway Fabric service. | object | `{}` |