Skip to content

Commit d7597c3

Browse files
authored
Feature/allow resource allocation (#2216)
Problem: When using autoscaling kubernetes clusters based on resource requests (like Karpenter implemenations or fargate kind of setups), pods will get evicted when the request 0 cpu and memory whilst the node it landed on is strapped for one of those resources, this change will give use the capability to set resource requests & limits in a way users see fit. Solution: Allow use to set resource values
1 parent 25f2b89 commit d7597c3

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

charts/nginx-gateway-fabric/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
290290
| `nginxGateway.readinessProbe.initialDelaySeconds` | The number of seconds after the Pod has started before the readiness probes are initiated. | int | `3` |
291291
| `nginxGateway.readinessProbe.port` | Port in which the readiness endpoint is exposed. | int | `8081` |
292292
| `nginxGateway.replicaCount` | The number of replicas of the NGINX Gateway Fabric Deployment. | int | `1` |
293+
| `nginxGateway.resources` | The resource requests and/or limits of the nginx-gateway container. | object | `{}` |
293294
| `nginxGateway.securityContext.allowPrivilegeEscalation` | Some environments may need this set to true in order for the control plane to successfully reload NGINX. | bool | `false` |
294295
| `nodeSelector` | The nodeSelector of the NGINX Gateway Fabric pod. | object | `{}` |
295296
| `service.annotations` | The annotations of the NGINX Gateway Fabric service. | object | `{}` |

charts/nginx-gateway-fabric/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ spec:
9090
lifecycle:
9191
{{- toYaml .Values.nginxGateway.lifecycle | nindent 10 }}
9292
{{- end }}
93+
{{- if .Values.nginxGateway.resources }}
94+
resources:
95+
{{- toYaml .Values.nginxGateway.resources | nindent 10 }}
96+
{{- end }}
9397
ports:
9498
{{- if .Values.metrics.enable }}
9599
- name: metrics

charts/nginx-gateway-fabric/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ nginxGateway:
6464
# -- The lifecycle of the nginx-gateway container.
6565
lifecycle: {}
6666

67+
# -- The resource requests and/or limits of the nginx-gateway container.
68+
resources: {}
69+
6770
# -- extraVolumeMounts are the additional volume mounts for the nginx-gateway container.
6871
extraVolumeMounts: []
6972

0 commit comments

Comments
 (0)