Skip to content

Commit

Permalink
make kruise deployment spread across availability zone (#124)
Browse files Browse the repository at this point in the history
Signed-off-by: 守辰 <shouchen.zz@alibaba-inc.com>
  • Loading branch information
furykerry authored Nov 4, 2024
1 parent 6b875ee commit e111262
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
9 changes: 9 additions & 0 deletions versions/kruise-game/0.9/templates/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ spec:
volumeMounts:
- mountPath: /etc/kruise-game
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 }}
terminationGracePeriodSeconds: 10
volumes:
Expand Down
9 changes: 9 additions & 0 deletions versions/kruise-rollout/0.5/templates/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ spec:
- {{ .Values.rollout.fullname }}
topologyKey: kubernetes.io/hostname
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 }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
9 changes: 9 additions & 0 deletions versions/kruise-state-metrics/0.2/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ spec:
port: 8081
resources:
{{- 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 }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
9 changes: 9 additions & 0 deletions versions/kruise/1.7.2/templates/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ spec:
- controller-manager
topologyKey: kubernetes.io/hostname
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 }}
nodeAffinity:
{{ toYaml . | indent 10 }}
Expand Down

0 comments on commit e111262

Please sign in to comment.