make kruise deployment spread across availability zone (#124)

Signed-off-by: 守辰 <shouchen.zz@alibaba-inc.com>
This commit is contained in:
Zhen Zhang 2024-11-04 15:15:14 +08:00 committed by GitHub
parent 6b875eefa1
commit e111262f53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 36 additions and 0 deletions

View File

@ -98,6 +98,15 @@ spec:
volumeMounts: volumeMounts:
- mountPath: /etc/kruise-game - mountPath: /etc/kruise-game
name: provider-config name: provider-config
topologySpreadConstraints:
- labelSelector:
matchLabels:
control-plane: {{ .Values.kruiseGame.fullname }}
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
serviceAccountName: {{ .Values.kruiseGame.fullname }} serviceAccountName: {{ .Values.kruiseGame.fullname }}
terminationGracePeriodSeconds: 10 terminationGracePeriodSeconds: 10
volumes: volumes:

View File

@ -96,6 +96,15 @@ spec:
- {{ .Values.rollout.fullname }} - {{ .Values.rollout.fullname }}
topologyKey: kubernetes.io/hostname topologyKey: kubernetes.io/hostname
weight: 100 weight: 100
topologySpreadConstraints:
- labelSelector:
matchLabels:
control-plane: {{ .Values.rollout.fullname }}
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
{{- with .Values.tolerations }} {{- with .Values.tolerations }}
tolerations: tolerations:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}

View File

@ -57,6 +57,15 @@ spec:
port: 8081 port: 8081
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
topologySpreadConstraints:
- labelSelector:
matchLabels:
{{- include "kruise-state-metrics.selectorLabels" . | nindent 12 }}
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}

View File

@ -124,6 +124,15 @@ spec:
- controller-manager - controller-manager
topologyKey: kubernetes.io/hostname topologyKey: kubernetes.io/hostname
weight: 100 weight: 100
topologySpreadConstraints:
- labelSelector:
matchLabels:
control-plane: controller-manager
matchLabelKeys:
- pod-template-hash
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
{{- with .Values.manager.nodeAffinity }} {{- with .Values.manager.nodeAffinity }}
nodeAffinity: nodeAffinity:
{{ toYaml . | indent 10 }} {{ toYaml . | indent 10 }}