Skip to content

Commit

Permalink
Add topologySpreadConstraints support (#405)
Browse files Browse the repository at this point in the history
User can set evenly_distributed true to have the pods distribute evenly.

Signed-off-by: Dolpher Du <[email protected]>
  • Loading branch information
yongfengdu authored Sep 9, 2024
1 parent b22fc52 commit af9e1b6
Show file tree
Hide file tree
Showing 21 changed files with 189 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helm-charts/chatqna/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "chatqna.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/codegen/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "codegen.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/codetrans/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "codetrans.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/asr/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "asr.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/chatqna-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "chatqna-ui.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/data-prep/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "data-prep.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/embedding-usvc/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "embedding-usvc.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/guardrails-usvc/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "guardrails-usvc.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/llm-uservice/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "llm-uservice.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/redis-vector-db/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "redis-vector-db.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/reranking-usvc/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "reranking-usvc.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/retriever-usvc/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "retriever-usvc.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/speecht5/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "speecht5.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/tei/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,12 @@ spec:
# extra time to finish processing buffered requests before HPA forcibly terminates pod
terminationGracePeriodSeconds: 60
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "tei.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/teirerank/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,12 @@ spec:
# extra time to finish processing buffered requests before HPA forcibly terminates pod
terminationGracePeriodSeconds: 60
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "teirerank.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/tgi/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,12 @@ spec:
# extra time to finish processing buffered requests before HPA forcibly terminates pod
terminationGracePeriodSeconds: 120
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "tgi.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/tts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "tts.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/vllm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "vllm.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/web-retriever/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "web-retriever.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/common/whisper/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "whisper.selectorLabels" . | nindent 14 }}
{{- end }}
9 changes: 9 additions & 0 deletions helm-charts/docsum/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,12 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "docsum.selectorLabels" . | nindent 14 }}
{{- end }}

0 comments on commit af9e1b6

Please sign in to comment.