Skip to content

Commit

Permalink
Add topologyspreadconstraint to deploy pods in sts cross different az…
Browse files Browse the repository at this point in the history
… evenly

Signed-off-by: Wang, Shu <[email protected]>
  • Loading branch information
wangshu3000 committed Aug 27, 2024
1 parent 0031827 commit ca8bcda
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/pulsar/templates/autorecovery-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
4 changes: 4 additions & 0 deletions charts/pulsar/templates/bookkeeper-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
4 changes: 4 additions & 0 deletions charts/pulsar/templates/broker-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,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}}
Expand Down
4 changes: 4 additions & 0 deletions charts/pulsar/templates/proxy-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
4 changes: 4 additions & 0 deletions charts/pulsar/templates/pulsar-manager-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/pulsar/templates/toolset-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/pulsar/templates/zookeeper-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
14 changes: 14 additions & 0 deletions charts/pulsar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -850,6 +856,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
Expand Down Expand Up @@ -1088,6 +1096,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
Expand Down Expand Up @@ -1209,6 +1219,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
Expand Down Expand Up @@ -1343,6 +1355,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
Expand Down

0 comments on commit ca8bcda

Please sign in to comment.