From d2e92e735ed1883f662f417b86ed428f8687e477 Mon Sep 17 00:00:00 2001 From: Michael Eklund Date: Thu, 25 Apr 2024 17:21:24 -0500 Subject: [PATCH] Add topologySpreadConstraints (#16) * Add topologySpreadConstraints to jitsu helm chart * Update topologySpreadConstraints to allow templating or yaml --- templates/bulker/deployment.yaml | 8 ++++++++ templates/console/deployment.yaml | 8 ++++++++ templates/ingest/deployment.yaml | 8 ++++++++ templates/rotor/deployment.yaml | 8 ++++++++ templates/syncctl/deployment.yaml | 8 ++++++++ values.yaml | 29 ++++++++++++++++++++++++++++- 6 files changed, 68 insertions(+), 1 deletion(-) diff --git a/templates/bulker/deployment.yaml b/templates/bulker/deployment.yaml index 7a09bbf..6e269f3 100644 --- a/templates/bulker/deployment.yaml +++ b/templates/bulker/deployment.yaml @@ -136,3 +136,11 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.bulker.topologySpreadConstraints }} + topologySpreadConstraints: + {{- if kindIs "string" . }} + {{- tpl . $ | nindent 8 }} + {{- else }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} diff --git a/templates/console/deployment.yaml b/templates/console/deployment.yaml index dd198da..94bb0ef 100644 --- a/templates/console/deployment.yaml +++ b/templates/console/deployment.yaml @@ -113,3 +113,11 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.console.topologySpreadConstraints }} + topologySpreadConstraints: + {{- if kindIs "string" . }} + {{- tpl . $ | nindent 8 }} + {{- else }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} diff --git a/templates/ingest/deployment.yaml b/templates/ingest/deployment.yaml index 30ab006..ae52c9c 100644 --- a/templates/ingest/deployment.yaml +++ b/templates/ingest/deployment.yaml @@ -136,3 +136,11 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.ingest.topologySpreadConstraints }} + topologySpreadConstraints: + {{- if kindIs "string" . }} + {{- tpl . $ | nindent 8 }} + {{- else }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} diff --git a/templates/rotor/deployment.yaml b/templates/rotor/deployment.yaml index e17a47a..578975f 100644 --- a/templates/rotor/deployment.yaml +++ b/templates/rotor/deployment.yaml @@ -154,3 +154,11 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.rotor.topologySpreadConstraints }} + topologySpreadConstraints: + {{- if kindIs "string" . }} + {{- tpl . $ | nindent 8 }} + {{- else }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} diff --git a/templates/syncctl/deployment.yaml b/templates/syncctl/deployment.yaml index 3769fbe..4a565ee 100644 --- a/templates/syncctl/deployment.yaml +++ b/templates/syncctl/deployment.yaml @@ -104,3 +104,11 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.syncctl.topologySpreadConstraints }} + topologySpreadConstraints: + {{- if kindIs "string" . }} + {{- tpl . $ | nindent 8 }} + {{- else }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} diff --git a/values.yaml b/values.yaml index aa5cad5..7fe947b 100644 --- a/values.yaml +++ b/values.yaml @@ -174,7 +174,7 @@ console: # https://docs.jitsu.com/self-hosting/configuration#ingest rotorAuthKey: "" rotorAuthKeyFrom: "" - + # Public domain where ingest service is available. Leave empty to configure automatically. # https://docs.jitsu.com/self-hosting/configuration#ingest_host @@ -262,6 +262,29 @@ console: nodeSelector: {} tolerations: [] affinity: {} + topologySpreadConstraints: + # Allows use of a string template: + # + # topologySpreadConstraints: | + # - maxSkew: 1 + # topologyKey: "topology.kubernetes.io/zone" + # whenUnsatisfiable: DoNotSchedule + # labelSelector: + # matchLabels: + # {{- include "jitsu.selectorLabels" . | nindent 10 }} + # {{- include "jitsu.console.selectorLabels" . | nindent 10 }} + # + # or a yaml structure: + # + # topologySpreadConstraints: + # - maxSkew: 1 + # topologyKey: "topology.kubernetes.io/zone" + # whenUnsatisfiable: DoNotSchedule + # labelSelector: + # matchLabels: + # app.kubernetes.io/name: jitsu + # app.kubernetes.io/instance: jitsu + # app.kubernetes.io/component: console bulker: enabled: true @@ -408,6 +431,7 @@ bulker: nodeSelector: {} tolerations: [] affinity: {} + topologySpreadConstraints: rotor: enabled: true @@ -528,6 +552,7 @@ rotor: nodeSelector: {} tolerations: [] affinity: {} + topologySpreadConstraints: ingest: enabled: true @@ -655,6 +680,7 @@ ingest: nodeSelector: {} tolerations: [] affinity: {} + topologySpreadConstraints: syncctl: enabled: true @@ -757,6 +783,7 @@ syncctl: nodeSelector: {} tolerations: [] affinity: {} + topologySpreadConstraints: migration: enabled: true