Add topologyspreadconstraint to deploy pods in sts cross different az evenly (#526)

Signed-off-by: Wang, Shu <shu.wang@fmr.com>
This commit is contained in:
Shu.Wang 2024-09-27 12:37:15 +08:00 committed by GitHub
parent 5276bd69ad
commit a45bc4bfe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 42 additions and 0 deletions

View File

@ -61,6 +61,10 @@ spec:
{{- with .Values.autorecovery.tolerations }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}
{{- if .Values.autorecovery.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.autorecovery.topologySpreadConstraints | nindent 8 }}
{{- end }}
affinity:
{{- if and .Values.affinity.anti_affinity .Values.autorecovery.affinity.anti_affinity}}

View File

@ -58,6 +58,10 @@ spec:
{{- if .Values.bookkeeper.tolerations }}
tolerations:
{{ toYaml .Values.bookkeeper.tolerations | indent 8 }}
{{- end }}
{{- if .Values.bookkeeper.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.bookkeeper.topologySpreadConstraints | nindent 8 }}
{{- end }}
affinity:
{{- if and .Values.affinity.anti_affinity .Values.bookkeeper.affinity.anti_affinity}}

View File

@ -79,6 +79,10 @@ spec:
{{- if .Values.broker.tolerations }}
tolerations:
{{ toYaml .Values.broker.tolerations | indent 8 }}
{{- end }}
{{- if .Values.broker.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.broker.topologySpreadConstraints | nindent 8 }}
{{- end }}
affinity:
{{- if and .Values.affinity.anti_affinity .Values.broker.affinity.anti_affinity}}

View File

@ -60,6 +60,10 @@ spec:
{{- if .Values.proxy.tolerations }}
tolerations:
{{ toYaml .Values.proxy.tolerations | indent 8 }}
{{- end }}
{{- if .Values.proxy.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.proxy.topologySpreadConstraints | nindent 8 }}
{{- end }}
affinity:
{{- if and .Values.affinity.anti_affinity .Values.proxy.affinity.anti_affinity}}

View File

@ -53,6 +53,10 @@ spec:
{{- if .Values.pulsar_manager.tolerations }}
tolerations:
{{ toYaml .Values.pulsar_manager.tolerations | indent 8 }}
{{- end }}
{{- if .Values.pulsar_manager.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.pulsar_manager.topologySpreadConstraints | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.pulsar_manager.gracePeriod }}
{{- if .Values.pulsar_manager.initContainers }}

View File

@ -56,6 +56,10 @@ spec:
{{- if .Values.toolset.tolerations }}
tolerations:
{{ toYaml .Values.toolset.tolerations | indent 8 }}
{{- end }}
{{- if .Values.toolset.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.toolset.topologySpreadConstraints | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.toolset.gracePeriod }}
serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"

View File

@ -57,6 +57,10 @@ spec:
{{- if .Values.zookeeper.tolerations }}
tolerations:
{{ toYaml .Values.zookeeper.tolerations | indent 8 }}
{{- end }}
{{- if .Values.zookeeper.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.zookeeper.topologySpreadConstraints | nindent 8 }}
{{- end }}
affinity:
{{- if and .Values.affinity.anti_affinity .Values.zookeeper.affinity.anti_affinity}}

View File

@ -358,6 +358,8 @@ zookeeper:
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
type: requiredDuringSchedulingIgnoredDuringExecution
# set topologySpreadConstraint to deploy pods across different zones
topologySpreadConstraints: []
annotations: {}
tolerations: []
gracePeriod: 30
@ -533,6 +535,8 @@ bookkeeper:
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
type: requiredDuringSchedulingIgnoredDuringExecution
# set topologySpreadConstraint to deploy pods across different zones
topologySpreadConstraints: []
annotations: {}
tolerations: []
gracePeriod: 30
@ -721,6 +725,8 @@ autorecovery:
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
type: requiredDuringSchedulingIgnoredDuringExecution
# set topologySpreadConstraint to deploy pods across different zones
topologySpreadConstraints: []
annotations: {}
# tolerations: []
gracePeriod: 30
@ -852,6 +858,8 @@ broker:
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
type: preferredDuringSchedulingIgnoredDuringExecution
# set topologySpreadConstraint to deploy pods across different zones
topologySpreadConstraints: []
annotations: {}
tolerations: []
gracePeriod: 30
@ -1090,6 +1098,8 @@ proxy:
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
type: requiredDuringSchedulingIgnoredDuringExecution
# set topologySpreadConstraint to deploy pods across different zones
topologySpreadConstraints: []
annotations: {}
tolerations: []
gracePeriod: 30
@ -1211,6 +1221,8 @@ toolset:
restartPodsOnConfigMapChange: false
# nodeSelector:
# cloud.google.com/gke-nodepool: default-pool
# set topologySpreadConstraint to deploy pods across different zones
topologySpreadConstraints: []
annotations: {}
tolerations: []
gracePeriod: 30
@ -1345,6 +1357,8 @@ pulsar_manager:
restartPodsOnConfigMapChange: false
# nodeSelector:
# cloud.google.com/gke-nodepool: default-pool
# set topologySpreadConstraint to deploy pods across different zones
topologySpreadConstraints: []
annotations: {}
tolerations: []
gracePeriod: 30