From 6649432955ceb260c4153487aa3c860a0eb244fa Mon Sep 17 00:00:00 2001 From: Bjoern Weidlich Date: Thu, 5 Oct 2023 04:08:10 -0700 Subject: [PATCH] exposing topologySpreadConstraints on the helm chart (#3892) This allows users to set `topologySpreadConstraints` which can be used to more evenly spread pods out over nodes/AZs/etc. and prevent uneven utilization of federation pods. Fixes #3891 --- **Checklist** Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review. - [X] Changes are compatible[^1] - [X] Documentation[^2] completed - [X] Performance impact assessed and acceptable - Tests added and passing[^3] - [ ] Unit Tests - [ ] Integration Tests - [X] Manual Tests **Exceptions** Tested helm chart template generation locally *Note any exceptions here* N/A **Notes** N/A [^1]: It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. [^2]: Configuration is an important part of many changes. Where applicable please try to document configuration examples. [^3]: Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. --------- Co-authored-by: Gary Pennington Co-authored-by: Gary Pennington --- .changesets/feat_expose_topology_spread_constraints.md | 5 +++++ helm/chart/router/templates/deployment.yaml | 4 ++++ helm/chart/router/values.yaml | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 .changesets/feat_expose_topology_spread_constraints.md diff --git a/.changesets/feat_expose_topology_spread_constraints.md b/.changesets/feat_expose_topology_spread_constraints.md new file mode 100644 index 0000000000..4d4bf78644 --- /dev/null +++ b/.changesets/feat_expose_topology_spread_constraints.md @@ -0,0 +1,5 @@ +### Expose the ability to set topology spread constraints on the helm chart ([3891](https://github.com/apollographql/router/issues/3891)) + +Give developers the ability to set topology spread constraints that can be used to guarantee that federation pods are spread out evenly across AZs. + +By [bjoern](https://github.com/bjoernw) in https://github.com/apollographql/router/pull/3892 \ No newline at end of file diff --git a/helm/chart/router/templates/deployment.yaml b/helm/chart/router/templates/deployment.yaml index 2fb6fa1c7a..45d5822fd8 100644 --- a/helm/chart/router/templates/deployment.yaml +++ b/helm/chart/router/templates/deployment.yaml @@ -162,3 +162,7 @@ spec: {{- if .Values.terminationGracePeriodSeconds }} terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/helm/chart/router/values.yaml b/helm/chart/router/values.yaml index 94120f7f00..66f39b8d88 100644 --- a/helm/chart/router/values.yaml +++ b/helm/chart/router/values.yaml @@ -232,3 +232,6 @@ probes: # -- Configure liveness probe liveness: initialDelaySeconds: 0 + +# -- Sets the [topology spread constraints](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/) for Deployment pods +topologySpreadConstraints: []