Skip to content

Commit ee5633c

Browse files
committed
Allow configuration of topologySpreadConstraints for flagger deployment
Resolves: #1765 Signed-off-by: Christian Rohmann <[email protected]>
1 parent 660ed74 commit ee5633c

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

charts/flagger/templates/deployment.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ spec:
4949
affinity:
5050
{{- tpl (toYaml .Values.affinity) . | nindent 8 }}
5151
{{- end }}
52+
{{- if .Values.topologySpreadConstraints }}
53+
topologySpreadConstraints:
54+
{{- tpl (toYaml .Values.topologySpreadConstraints) . | nindent 8 }}
55+
{{- end }}
5256
{{- if .Values.image.pullSecret }}
5357
imagePullSecrets:
5458
- name: {{ .Values.image.pullSecret }}
@@ -64,7 +68,7 @@ spec:
6468
{{- end }}
6569
{{- if .Values.podPriorityClassName }}
6670
priorityClassName: {{ .Values.podPriorityClassName }}
67-
{{- end }}
71+
{{- end }}
6872
containers:
6973
- name: flagger
7074
{{- if .Values.securityContext.enabled }}

charts/flagger/values.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,19 @@ affinity:
167167
app.kubernetes.io/instance: '{{ .Release.Name }}'
168168
topologyKey: kubernetes.io/hostname
169169

170+
topologySpreadConstraints:
171+
- labelSelector:
172+
matchLabels:
173+
app.kubernetes.io/name: '{{ template "flagger.name" . }}'
174+
app.kubernetes.io/instance: '{{ .Release.Name }}'
175+
matchLabelKeys:
176+
- pod-template-hash
177+
topologyKey: topology.kubernetes.io/zone
178+
maxSkew: 1
179+
whenUnsatisfiable: ScheduleAnyway
180+
181+
182+
170183
prometheus:
171184
# to be used with ingress controllers
172185
install: false

0 commit comments

Comments
 (0)