Skip to content

Commit

Permalink
Allow configuration of topologySpreadConstraints for flagger deployment
Browse files Browse the repository at this point in the history
Resolves: fluxcd#1765
  • Loading branch information
frittentheke committed Feb 20, 2025
1 parent 660ed74 commit 5a29a7f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion charts/flagger/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ spec:
affinity:
{{- tpl (toYaml .Values.affinity) . | nindent 8 }}
{{- end }}
{{- if .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl (toYaml .Values.topologySpreadConstraints) . | nindent 8 }}
{{- end }}
{{- if .Values.image.pullSecret }}
imagePullSecrets:
- name: {{ .Values.image.pullSecret }}
Expand All @@ -64,7 +68,7 @@ spec:
{{- end }}
{{- if .Values.podPriorityClassName }}
priorityClassName: {{ .Values.podPriorityClassName }}
{{- end }}
{{- end }}
containers:
- name: flagger
{{- if .Values.securityContext.enabled }}
Expand Down
13 changes: 13 additions & 0 deletions charts/flagger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,19 @@ affinity:
app.kubernetes.io/instance: '{{ .Release.Name }}'
topologyKey: kubernetes.io/hostname

topologySpreadConstraints:
- labelSelector:
matchLabels:
app.kubernetes.io/name: '{{ template "flagger.name" . }}'
app.kubernetes.io/instance: '{{ .Release.Name }}'
matchLabelKeys:
- pod-template-hash
topologyKey: topology.kubernetes.io/zone
maxSkew: 1
whenUnsatisfiable: ScheduleAnyway



prometheus:
# to be used with ingress controllers
install: false
Expand Down

0 comments on commit 5a29a7f

Please sign in to comment.