From 6d74f262153a631e0505fcd53139a374abba3e65 Mon Sep 17 00:00:00 2001 From: Robsta86 Date: Sat, 19 Oct 2024 22:30:36 +0200 Subject: [PATCH 1/4] Add topologySpreadConstraints to the helm chart --- charts/nginx-gateway-fabric/README.md | 1 + charts/nginx-gateway-fabric/templates/deployment.yaml | 4 ++++ charts/nginx-gateway-fabric/values.yaml | 3 +++ 3 files changed, 8 insertions(+) diff --git a/charts/nginx-gateway-fabric/README.md b/charts/nginx-gateway-fabric/README.md index 531386c0c7..ab6674aef8 100644 --- a/charts/nginx-gateway-fabric/README.md +++ b/charts/nginx-gateway-fabric/README.md @@ -307,6 +307,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri | `serviceAccount.name` | The name of the service account of the NGINX Gateway Fabric pods. Used for RBAC. | string | Autogenerated if not set or set to "" | | `terminationGracePeriodSeconds` | The termination grace period of the NGINX Gateway Fabric pod. | int | `30` | | `tolerations` | Tolerations for the NGINX Gateway Fabric pod. | list | `[]` | +| `topologySpreadConstraints` | topologySpreadConstraints for the NGINX Gateway Fabric pod. | list | `[]` | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) diff --git a/charts/nginx-gateway-fabric/templates/deployment.yaml b/charts/nginx-gateway-fabric/templates/deployment.yaml index f669ded5c2..8d753e92f4 100644 --- a/charts/nginx-gateway-fabric/templates/deployment.yaml +++ b/charts/nginx-gateway-fabric/templates/deployment.yaml @@ -29,6 +29,10 @@ spec: {{- end }} {{- end }} spec: + {{- if .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml .Values.topologySpreadConstraints | nindent 8 }} + {{- end }} initContainers: - name: copy-nginx-config image: {{ .Values.nginxGateway.image.repository }}:{{ default .Chart.AppVersion .Values.nginxGateway.image.tag }} diff --git a/charts/nginx-gateway-fabric/values.yaml b/charts/nginx-gateway-fabric/values.yaml index 652acedbdc..3200a4eae9 100644 --- a/charts/nginx-gateway-fabric/values.yaml +++ b/charts/nginx-gateway-fabric/values.yaml @@ -260,6 +260,9 @@ nodeSelector: {} # -- The affinity of the NGINX Gateway Fabric pod. affinity: {} +# -- The topology spread constraints for the NGINX Gateway Fabric pod. +topologySpreadConstraints: [] + serviceAccount: # -- Set of custom annotations for the NGINX Gateway Fabric service account. annotations: {} From 301037923de65b102c11aaed32b51eaa95a9da16 Mon Sep 17 00:00:00 2001 From: Robsta86 Date: Sat, 19 Oct 2024 22:32:33 +0200 Subject: [PATCH 2/4] Run make generate-all --- charts/nginx-gateway-fabric/README.md | 2 +- charts/nginx-gateway-fabric/values.schema.json | 9 +++++++++ config/tests/static-deployment.yaml | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/charts/nginx-gateway-fabric/README.md b/charts/nginx-gateway-fabric/README.md index ab6674aef8..b8c6a35b3e 100644 --- a/charts/nginx-gateway-fabric/README.md +++ b/charts/nginx-gateway-fabric/README.md @@ -307,7 +307,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri | `serviceAccount.name` | The name of the service account of the NGINX Gateway Fabric pods. Used for RBAC. | string | Autogenerated if not set or set to "" | | `terminationGracePeriodSeconds` | The termination grace period of the NGINX Gateway Fabric pod. | int | `30` | | `tolerations` | Tolerations for the NGINX Gateway Fabric pod. | list | `[]` | -| `topologySpreadConstraints` | topologySpreadConstraints for the NGINX Gateway Fabric pod. | list | `[]` | +| `topologySpreadConstraints` | The topology spread constraints for the NGINX Gateway Fabric pod. | list | `[]` | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) diff --git a/charts/nginx-gateway-fabric/values.schema.json b/charts/nginx-gateway-fabric/values.schema.json index 94211e9322..38cbbd34d2 100644 --- a/charts/nginx-gateway-fabric/values.schema.json +++ b/charts/nginx-gateway-fabric/values.schema.json @@ -676,6 +676,15 @@ "required": [], "title": "tolerations", "type": "array" + }, + "topologySpreadConstraints": { + "description": "The topology spread constraints for the NGINX Gateway Fabric pod.", + "items": { + "required": [] + }, + "required": [], + "title": "topologySpreadConstraints", + "type": "array" } }, "required": [], diff --git a/config/tests/static-deployment.yaml b/config/tests/static-deployment.yaml index 8de0432701..54110bb41b 100644 --- a/config/tests/static-deployment.yaml +++ b/config/tests/static-deployment.yaml @@ -20,7 +20,7 @@ spec: labels: app.kubernetes.io/name: nginx-gateway app.kubernetes.io/instance: nginx-gateway - spec: + spec: initContainers: - name: copy-nginx-config image: ghcr.io/nginxinc/nginx-gateway-fabric:edge From d449c19e16828e9ab67d7c668da8c3e10311a8fd Mon Sep 17 00:00:00 2001 From: Robsta86 Date: Sat, 19 Oct 2024 22:37:00 +0200 Subject: [PATCH 3/4] trim trailing whitespace --- charts/nginx-gateway-fabric/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/nginx-gateway-fabric/templates/deployment.yaml b/charts/nginx-gateway-fabric/templates/deployment.yaml index 8d753e92f4..d1bd9e8b05 100644 --- a/charts/nginx-gateway-fabric/templates/deployment.yaml +++ b/charts/nginx-gateway-fabric/templates/deployment.yaml @@ -32,7 +32,7 @@ spec: {{- if .Values.topologySpreadConstraints }} topologySpreadConstraints: {{- toYaml .Values.topologySpreadConstraints | nindent 8 }} - {{- end }} + {{- end }} initContainers: - name: copy-nginx-config image: {{ .Values.nginxGateway.image.repository }}:{{ default .Chart.AppVersion .Values.nginxGateway.image.tag }} From ee386c2af88cc4217aaf479e393e9f0fadb4b3c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 20 Oct 2024 07:41:41 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- config/tests/static-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/tests/static-deployment.yaml b/config/tests/static-deployment.yaml index 54110bb41b..8de0432701 100644 --- a/config/tests/static-deployment.yaml +++ b/config/tests/static-deployment.yaml @@ -20,7 +20,7 @@ spec: labels: app.kubernetes.io/name: nginx-gateway app.kubernetes.io/instance: nginx-gateway - spec: + spec: initContainers: - name: copy-nginx-config image: ghcr.io/nginxinc/nginx-gateway-fabric:edge