From f837f67282bee2aa5a67628e36de1df43fecb67f Mon Sep 17 00:00:00 2001 From: Jerome Brown Date: Wed, 25 Oct 2023 12:10:13 +1300 Subject: [PATCH 1/4] Helm Chart: Add support for tolerations --- deploy/helm-chart/README.md | 1 + deploy/helm-chart/templates/deployment.yaml | 4 ++++ deploy/helm-chart/values.yaml | 19 +++++++++++-------- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/deploy/helm-chart/README.md b/deploy/helm-chart/README.md index b6324958f..955344ab6 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 b576f793a..52fa3da33 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 + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} volumes: - name: nginx-conf emptyDir: {} diff --git a/deploy/helm-chart/values.yaml b/deploy/helm-chart/values.yaml index 6380f61e4..3ec0e2404 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 NGINGX Gateway Fabric pod. +tolerations: [] + ## The affinity of the NGINX Gateway Fabric pod. affinity: {} @@ -83,14 +86,14 @@ service: ## A list of ports to expose through the NGINX Gateway Fabric service. Update it to match the listener ports from ## your Gateway resource. Follows the conventional Kubernetes yaml syntax for service ports. ports: - - port: 80 - targetPort: 80 - protocol: TCP - name: http - - port: 443 - targetPort: 443 - protocol: TCP - name: https + - port: 80 + targetPort: 80 + protocol: TCP + name: http + - port: 443 + targetPort: 443 + protocol: TCP + name: https metrics: ## Enable exposing metrics in the Prometheus format. From 82fe19027b4a081e5abcf7b303c1882acd1432cd Mon Sep 17 00:00:00 2001 From: Jerome Brown Date: Thu, 26 Oct 2023 13:27:31 +1300 Subject: [PATCH 2/4] Update based on feedback in other PR --- deploy/helm-chart/templates/deployment.yaml | 2 +- deploy/helm-chart/values.yaml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deploy/helm-chart/templates/deployment.yaml b/deploy/helm-chart/templates/deployment.yaml index 52fa3da33..3e43193d4 100644 --- a/deploy/helm-chart/templates/deployment.yaml +++ b/deploy/helm-chart/templates/deployment.yaml @@ -143,7 +143,7 @@ spec: securityContext: fsGroup: 1001 runAsNonRoot: true - {{- with .Values.tolerations }} + {{- with .Values.tolerations -}} tolerations: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/deploy/helm-chart/values.yaml b/deploy/helm-chart/values.yaml index 3ec0e2404..b611a5510 100644 --- a/deploy/helm-chart/values.yaml +++ b/deploy/helm-chart/values.yaml @@ -61,7 +61,7 @@ nginx: ## The termination grace period of the NGINX Gateway Fabric pod. terminationGracePeriodSeconds: 30 -## Tolerations for the NGINGX Gateway Fabric pod. +## Tolerations for the NGINX Gateway Fabric pod. tolerations: [] ## The affinity of the NGINX Gateway Fabric pod. @@ -86,14 +86,14 @@ service: ## A list of ports to expose through the NGINX Gateway Fabric service. Update it to match the listener ports from ## your Gateway resource. Follows the conventional Kubernetes yaml syntax for service ports. ports: - - port: 80 - targetPort: 80 - protocol: TCP - name: http - - port: 443 - targetPort: 443 - protocol: TCP - name: https + - port: 80 + targetPort: 80 + protocol: TCP + name: http + - port: 443 + targetPort: 443 + protocol: TCP + name: https metrics: ## Enable exposing metrics in the Prometheus format. From bbc4cb0b0f834f51426ab9dbe4a3fd0e6ea15e26 Mon Sep 17 00:00:00 2001 From: Jerome Brown Date: Mon, 30 Oct 2023 09:38:25 +1300 Subject: [PATCH 3/4] Fix README spacing --- deploy/helm-chart/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/helm-chart/README.md b/deploy/helm-chart/README.md index 955344ab6..04a494908 100644 --- a/deploy/helm-chart/README.md +++ b/deploy/helm-chart/README.md @@ -226,7 +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. | [] | +| `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 | From 8536bd0798f3b9816df41ae0fcb839adb03fe773 Mon Sep 17 00:00:00 2001 From: Jerome Brown Date: Mon, 30 Oct 2023 10:04:26 +1300 Subject: [PATCH 4/4] Fix issue with tolerations not deploying --- deploy/helm-chart/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/helm-chart/templates/deployment.yaml b/deploy/helm-chart/templates/deployment.yaml index 3e43193d4..a6a6c5012 100644 --- a/deploy/helm-chart/templates/deployment.yaml +++ b/deploy/helm-chart/templates/deployment.yaml @@ -143,9 +143,9 @@ spec: securityContext: fsGroup: 1001 runAsNonRoot: true - {{- with .Values.tolerations -}} + {{- if .Values.tolerations }} tolerations: - {{- toYaml . | nindent 8 }} + {{- toYaml .Values.tolerations | nindent 6 }} {{- end }} volumes: - name: nginx-conf