diff --git a/charts/statefull/Chart.yaml b/charts/statefull/Chart.yaml index 03bc020..a2c7329 100644 --- a/charts/statefull/Chart.yaml +++ b/charts/statefull/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart for statefull vality services name: statefull -version: 1.0.28 \ No newline at end of file +version: 1.0.29 \ No newline at end of file diff --git a/charts/statefull/templates/statefulset.yaml b/charts/statefull/templates/statefulset.yaml index 52012d1..0285dc3 100644 --- a/charts/statefull/templates/statefulset.yaml +++ b/charts/statefull/templates/statefulset.yaml @@ -109,11 +109,22 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.topologySpreadConstraints }} + {{- if or .Values.topologySpreadConstraints .Values.topologySpreadConstraintsRequired.enabled }} topologySpreadConstraints: + {{- if .Values.topologySpreadConstraints }} + {{- with .Values.topologySpreadConstraints }} {{- toYaml . | nindent 8 }} - {{- end }} - {{- if .Values.storage }} + {{- end }} + {{- end }} + {{- if .Values.topologySpreadConstraintsRequired.enabled }} + - labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + maxSkew: 1 + topologyKey: topology.kubernetes.io/zone + whenUnsatisfiable: DoNotSchedule + {{- end }} + {{- end }} {{- if .Values.storage }} volumeClaimTemplates: - metadata: name: data diff --git a/charts/statefull/values.yaml b/charts/statefull/values.yaml index d8e9883..b91358e 100644 --- a/charts/statefull/values.yaml +++ b/charts/statefull/values.yaml @@ -140,6 +140,8 @@ nodeSelector: {} tolerations: [] topologySpreadConstraints: [] +topologySpreadConstraintsRequired: + enabled: false affinity: {} diff --git a/charts/stateless/Chart.yaml b/charts/stateless/Chart.yaml index 8f2c87d..bf85620 100644 --- a/charts/stateless/Chart.yaml +++ b/charts/stateless/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart for stateless vality services name: stateless -version: 1.0.41 +version: 1.0.42 diff --git a/charts/stateless/templates/deployment.yaml b/charts/stateless/templates/deployment.yaml index 6bb3680..5806286 100644 --- a/charts/stateless/templates/deployment.yaml +++ b/charts/stateless/templates/deployment.yaml @@ -133,7 +133,19 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.topologySpreadConstraints }} + {{- if or .Values.topologySpreadConstraints .Values.topologySpreadConstraintsRequired.enabled }} topologySpreadConstraints: + {{- if .Values.topologySpreadConstraints }} + {{- with .Values.topologySpreadConstraints }} {{- toYaml . | nindent 8 }} {{- end }} + {{- end }} + {{- if .Values.topologySpreadConstraintsRequired.enabled }} + - labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + maxSkew: 1 + topologyKey: topology.kubernetes.io/zone + whenUnsatisfiable: DoNotSchedule + {{- end }} + {{- end }} \ No newline at end of file diff --git a/charts/stateless/values.yaml b/charts/stateless/values.yaml index 7e00ac5..5083ee9 100644 --- a/charts/stateless/values.yaml +++ b/charts/stateless/values.yaml @@ -146,6 +146,8 @@ nodeSelector: {} tolerations: [] topologySpreadConstraints: [] +topologySpreadConstraintsRequired: + enabled: false affinity: {}