Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding nodeSelector and affinity to values so that it is possible to configure where the statefulset pods will get scheduled. #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion charts/libretranslate/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,17 @@ spec:
claimName: models-volume
{{- end }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{- toYaml .Values.affinity | nindent 8 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{- toYaml .Values.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{- toYaml .Values.tolerations | nindent 6 }}
{{- toYaml .Values.tolerations | nindent 6 }}
{{- end }}
{{- if and .Values.persistence.enabled (or (eq .Values.persistence.models.accessMode "ReadWriteOnce") (eq .Values.persistence.db.accessMode "ReadWriteOnce")) }}
# still in beta, but this will allow us to delete the volumes when the statefulset is scaled down
Expand Down
6 changes: 6 additions & 0 deletions charts/libretranslate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ annotations: {}
# Extra tolerations for pods
tolerations: []

# Node selectors for pods
affinity: {}

# Pod affinities
nodeSelector: {}

# Chart name override
nameOverride: ""

Expand Down