Skip to content

Commit

Permalink
Merge pull request #1371 from thechristschn/helm-chart-allow-custom-a…
Browse files Browse the repository at this point in the history
…ffinities

Allow custom affinities for flagger deployment in helm chart
  • Loading branch information
aryan9600 authored Feb 20, 2023
2 parents e263d6a + 8d51779 commit 859fb7e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/flagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ The following tables lists the configurable parameters of the Flagger chart and
| `resources.requests/memory` | Pod memory request | `32Mi` |
| `resources.limits/cpu` | Pod CPU limit | `1000m` |
| `resources.limits/memory` | Pod memory limit | `512Mi` |
| `affinity` | Node/pod affinities | None |
| `affinity` | Node/pod affinities | prefer spread across hosts |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `threadiness` | Number of controller workers | `2` |
| `tolerations` | List of node taints to tolerate | `[]` |
Expand Down
12 changes: 3 additions & 9 deletions charts/flagger/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,10 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ template "flagger.serviceAccountName" . }}
{{- if .Values.affinity }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: {{ template "flagger.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
topologyKey: kubernetes.io/hostname
{{- tpl (toYaml .Values.affinity) . | nindent 8 }}
{{- end }}
{{- if .Values.image.pullSecret }}
imagePullSecrets:
- name: {{ .Values.image.pullSecret }}
Expand Down
11 changes: 11 additions & 0 deletions charts/flagger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ nodeSelector: {}

tolerations: []

affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: '{{ template "flagger.name" . }}'
app.kubernetes.io/instance: '{{ .Release.Name }}'
topologyKey: kubernetes.io/hostname

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

0 comments on commit 859fb7e

Please sign in to comment.