Skip to content

Commit

Permalink
Feature/allow resource allocation (nginx#2216)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
miledxz committed Jul 15, 2024
1 parent 726262c commit 048070b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/nginx-gateway-fabric/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
| `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 | `{}` |
Expand Down
4 changes: 4 additions & 0 deletions charts/nginx-gateway-fabric/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions charts/nginx-gateway-fabric/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,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: []

Expand Down

0 comments on commit 048070b

Please sign in to comment.