Skip to content

Commit e111262

Browse files
authored
make kruise deployment spread across availability zone (#124)
Signed-off-by: 守辰 <[email protected]>
1 parent 6b875ee commit e111262

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

versions/kruise-game/0.9/templates/manager.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ spec:
9898
volumeMounts:
9999
- mountPath: /etc/kruise-game
100100
name: provider-config
101+
topologySpreadConstraints:
102+
- labelSelector:
103+
matchLabels:
104+
control-plane: {{ .Values.kruiseGame.fullname }}
105+
matchLabelKeys:
106+
- pod-template-hash
107+
maxSkew: 1
108+
topologyKey: topology.kubernetes.io/zone
109+
whenUnsatisfiable: ScheduleAnyway
101110
serviceAccountName: {{ .Values.kruiseGame.fullname }}
102111
terminationGracePeriodSeconds: 10
103112
volumes:

versions/kruise-rollout/0.5/templates/manager.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ spec:
9696
- {{ .Values.rollout.fullname }}
9797
topologyKey: kubernetes.io/hostname
9898
weight: 100
99+
topologySpreadConstraints:
100+
- labelSelector:
101+
matchLabels:
102+
control-plane: {{ .Values.rollout.fullname }}
103+
matchLabelKeys:
104+
- pod-template-hash
105+
maxSkew: 1
106+
topologyKey: topology.kubernetes.io/zone
107+
whenUnsatisfiable: ScheduleAnyway
99108
{{- with .Values.tolerations }}
100109
tolerations:
101110
{{- toYaml . | nindent 8 }}

versions/kruise-state-metrics/0.2/templates/deployment.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ spec:
5757
port: 8081
5858
resources:
5959
{{- toYaml .Values.resources | nindent 12 }}
60+
topologySpreadConstraints:
61+
- labelSelector:
62+
matchLabels:
63+
{{- include "kruise-state-metrics.selectorLabels" . | nindent 12 }}
64+
matchLabelKeys:
65+
- pod-template-hash
66+
maxSkew: 1
67+
topologyKey: topology.kubernetes.io/zone
68+
whenUnsatisfiable: ScheduleAnyway
6069
{{- with .Values.nodeSelector }}
6170
nodeSelector:
6271
{{- toYaml . | nindent 8 }}

versions/kruise/1.7.2/templates/manager.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ spec:
124124
- controller-manager
125125
topologyKey: kubernetes.io/hostname
126126
weight: 100
127+
topologySpreadConstraints:
128+
- labelSelector:
129+
matchLabels:
130+
control-plane: controller-manager
131+
matchLabelKeys:
132+
- pod-template-hash
133+
maxSkew: 1
134+
topologyKey: topology.kubernetes.io/zone
135+
whenUnsatisfiable: ScheduleAnyway
127136
{{- with .Values.manager.nodeAffinity }}
128137
nodeAffinity:
129138
{{ toYaml . | indent 10 }}

0 commit comments

Comments
 (0)