Skip to content

Commit

Permalink
add affinity to jobTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
takuyaymd authored and takuyaymd committed Dec 2, 2024
1 parent b17cc73 commit 0dac2c2
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
10 changes: 10 additions & 0 deletions charts/vald/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,8 @@ spec:
{{- toYaml .Job.securityContext | nindent 12 }}
{{- end }}
{{- end }}
affinity:
{{- include "vald.affinity" .Job.affinity | nindent 8 }}
containers:
- name: {{ .Job.name }}
image: "{{ .Job.image.repository }}:{{ default .default.Values.defaults.image.tag .Job.image.tag }}"
Expand Down Expand Up @@ -928,6 +930,14 @@ spec:
configMap:
defaultMode: 420
name: {{ .Job.name }}-config
{{- if .Job.nodeSelector }}
nodeSelector:
{{- toYaml .Job.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Job.tolerations }}
tolerations:
{{- toYaml .Job.tolerations | nindent 8 }}
{{- end }}
{{- if .Job.serviceAccount }}
serviceAccountName: {{ .Job.serviceAccount.name }}
{{- end }}
Expand Down
72 changes: 72 additions & 0 deletions charts/vald/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3353,6 +3353,30 @@ manager:
# @schema {"name": "manager.index.corrector.node_name", "type": "string"}
# manager.index.corrector.node_name -- node name
node_name: "" # _MY_NODE_NAME_
# @schema {"name": "manager.index.corrector.nodeSelector", "alias": "nodeSelector"}
# manager.index.corrector.nodeSelector -- node selector
nodeSelector: {}
# @schema {"name": "manager.index.corrector.tolerations", "alias": "tolerations"}
# manager.index.corrector.tolerations -- tolerations
tolerations: []
# @schema {"name": "manager.index.corrector.affinity", "alias": "affinity"}
affinity:
nodeAffinity:
# manager.index.corrector.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution -- node affinity preferred scheduling terms
preferredDuringSchedulingIgnoredDuringExecution: []
requiredDuringSchedulingIgnoredDuringExecution:
# manager.index.corrector.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms -- node affinity required node selectors
nodeSelectorTerms: []
podAffinity:
# manager.index.corrector.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution -- pod affinity preferred scheduling terms
preferredDuringSchedulingIgnoredDuringExecution: []
# manager.index.corrector.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
podAntiAffinity:
# manager.index.corrector.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity preferred scheduling terms
preferredDuringSchedulingIgnoredDuringExecution: []
# manager.index.corrector.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
# @schema {"name": "manager.index.corrector.gateway", "alias": "grpc.client"}
# manager.index.corrector.gateway -- gRPC client for gateway (overrides defaults.grpc.client)
gateway: {}
Expand Down Expand Up @@ -3463,6 +3487,30 @@ manager:
# @schema {"name": "manager.index.creator.node_name", "type": "string"}
# manager.index.creator.node_name -- node name
node_name: "" # _MY_NODE_NAME_
# @schema {"name": "manager.index.creator.nodeSelector", "alias": "nodeSelector"}
# manager.index.creator.nodeSelector -- node selector
nodeSelector: {}
# @schema {"name": "manager.index.creator.tolerations", "alias": "tolerations"}
# manager.index.creator.tolerations -- tolerations
tolerations: []
# @schema {"name": "manager.index.creator.affinity", "alias": "affinity"}
affinity:
nodeAffinity:
# manager.index.creator.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution -- node affinity preferred scheduling terms
preferredDuringSchedulingIgnoredDuringExecution: []
requiredDuringSchedulingIgnoredDuringExecution:
# manager.index.creator.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms -- node affinity required node selectors
nodeSelectorTerms: []
podAffinity:
# manager.index.creator.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution -- pod affinity preferred scheduling terms
preferredDuringSchedulingIgnoredDuringExecution: []
# manager.index.creator.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
podAntiAffinity:
# manager.index.creator.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity preferred scheduling terms
preferredDuringSchedulingIgnoredDuringExecution: []
# manager.index.creator.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
# @schema {"name": "manager.index.creator.discoverer", "type": "object"}
discoverer:
# @schema {"name": "manager.index.creator.discoverer.duration", "type": "string"}
Expand Down Expand Up @@ -3567,6 +3615,30 @@ manager:
# @schema {"name": "manager.index.saver.node_name", "type": "string"}
# manager.index.saver.node_name -- node name
node_name: "" # _MY_NODE_NAME_
# @schema {"name": "manager.index.saver.nodeSelector", "alias": "nodeSelector"}
# manager.index.saver.nodeSelector -- node selector
nodeSelector: {}
# @schema {"name": "manager.index.saver.tolerations", "alias": "tolerations"}
# manager.index.saver.tolerations -- tolerations
tolerations: []
# @schema {"name": "manager.index.saver.affinity", "alias": "affinity"}
affinity:
nodeAffinity:
# manager.index.saver.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution -- node affinity preferred scheduling terms
preferredDuringSchedulingIgnoredDuringExecution: []
requiredDuringSchedulingIgnoredDuringExecution:
# manager.index.saver.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms -- node affinity required node selectors
nodeSelectorTerms: []
podAffinity:
# manager.index.saver.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution -- pod affinity preferred scheduling terms
preferredDuringSchedulingIgnoredDuringExecution: []
# manager.index.saver.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
podAntiAffinity:
# manager.index.saver.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity preferred scheduling terms
preferredDuringSchedulingIgnoredDuringExecution: []
# manager.index.saver.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution -- pod anti-affinity required scheduling terms
requiredDuringSchedulingIgnoredDuringExecution: []
# @schema {"name": "manager.index.saver.discoverer", "type": "object"}
discoverer:
# @schema {"name": "manager.index.saver.discoverer.duration", "type": "string"}
Expand Down

0 comments on commit 0dac2c2

Please sign in to comment.