Skip to content

Commit

Permalink
Allow setting affinity for replicated deployment (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin authored Dec 17, 2024
1 parent 05fb840 commit d6434c6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,26 @@ jobs:
fi
cat << EOF > test-values.yaml
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: production/node-pool
operator: In
values:
- replicated-sdk
EOF
output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --values test-values.yaml)
if ! echo $output | grep -q 'affinity:'; then
printf "user-set affinity should exist:\n\n%s\n\n" "$output"
exit 1
fi
cat << EOF > test-values.yaml
statusInformers: []
EOF
Expand Down
4 changes: 4 additions & 0 deletions chart/templates/replicated-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if $podSecurityContext.enabled }}
securityContext: {{- omit $podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions chart/values.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,5 @@ replicatedID: ""
appID: ""

tolerations: []

affinity: ~

0 comments on commit d6434c6

Please sign in to comment.