From febd0a94f5ed19c16a3ceac12224bbb18b5ea90e Mon Sep 17 00:00:00 2001 From: Jerome Brown Date: Wed, 1 Nov 2023 07:40:08 +1300 Subject: [PATCH] Helm Chart: Add support for tolerations (#1192) Problem: There's no way to configure tolerations for the NGINX Gateway Fabric Pod in the helm chart. Solution: Add support for tolerations to be supplied if required. If not provided, there is no change to the deployment --- deploy/helm-chart/README.md | 1 + deploy/helm-chart/templates/deployment.yaml | 4 ++++ deploy/helm-chart/values.yaml | 3 +++ 3 files changed, 8 insertions(+) diff --git a/deploy/helm-chart/README.md b/deploy/helm-chart/README.md index b6324958f0..04a4949086 100644 --- a/deploy/helm-chart/README.md +++ b/deploy/helm-chart/README.md @@ -226,6 +226,7 @@ The following tables lists the configurable parameters of the NGINX Gateway Fabr | `nginx.image.pullPolicy` | The `imagePullPolicy` for the NGINX image. | Always | | `nginx.lifecycle` | The `lifecycle` of the nginx container. | {} | | `terminationGracePeriodSeconds` | The termination grace period of the NGINX Gateway Fabric pod. | 30 | +| `tolerations` | The `tolerations` of the NGINX Gateway Fabric pod. | [] | | `affinity` | The `affinity` of the NGINX Gateway Fabric pod. | {} | | `serviceAccount.annotations` | The `annotations` for the ServiceAccount used by the NGINX Gateway Fabric deployment. | {} | | `serviceAccount.name` | Name of the ServiceAccount used by the NGINX Gateway Fabric deployment. | Autogenerated | diff --git a/deploy/helm-chart/templates/deployment.yaml b/deploy/helm-chart/templates/deployment.yaml index b576f793a0..a6a6c50121 100644 --- a/deploy/helm-chart/templates/deployment.yaml +++ b/deploy/helm-chart/templates/deployment.yaml @@ -143,6 +143,10 @@ spec: securityContext: fsGroup: 1001 runAsNonRoot: true + {{- if .Values.tolerations }} + tolerations: + {{- toYaml .Values.tolerations | nindent 6 }} + {{- end }} volumes: - name: nginx-conf emptyDir: {} diff --git a/deploy/helm-chart/values.yaml b/deploy/helm-chart/values.yaml index 6380f61e43..b611a55104 100644 --- a/deploy/helm-chart/values.yaml +++ b/deploy/helm-chart/values.yaml @@ -61,6 +61,9 @@ nginx: ## The termination grace period of the NGINX Gateway Fabric pod. terminationGracePeriodSeconds: 30 +## Tolerations for the NGINX Gateway Fabric pod. +tolerations: [] + ## The affinity of the NGINX Gateway Fabric pod. affinity: {}