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

add affinity to jobTemplate #2758

Merged
Merged
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
159 changes: 159 additions & 0 deletions charts/vald-helm-operator/crds/valdrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8406,6 +8406,51 @@ spec:
corrector:
type: object
properties:
affinity:
type: object
properties:
nodeAffinity:
type: object
properties:
preferredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
requiredDuringSchedulingIgnoredDuringExecution:
type: object
properties:
nodeSelectorTerms:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
podAffinity:
type: object
properties:
preferredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
requiredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
podAntiAffinity:
type: object
properties:
preferredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
requiredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
agent_namespace:
type: string
discoverer:
Expand Down Expand Up @@ -9037,6 +9082,9 @@ spec:
type: string
node_name:
type: string
nodeSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
observability:
type: object
properties:
Expand Down Expand Up @@ -9714,6 +9762,11 @@ spec:
minimum: 1
suspend:
type: boolean
tolerations:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
ttlSecondsAfterFinished:
type: integer
version:
Expand All @@ -9722,6 +9775,51 @@ spec:
creator:
type: object
properties:
affinity:
type: object
properties:
nodeAffinity:
type: object
properties:
preferredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
requiredDuringSchedulingIgnoredDuringExecution:
type: object
properties:
nodeSelectorTerms:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
podAffinity:
type: object
properties:
preferredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
requiredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
podAntiAffinity:
type: object
properties:
preferredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
requiredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
agent_namespace:
type: string
concurrency:
Expand Down Expand Up @@ -10157,6 +10255,9 @@ spec:
type: string
node_name:
type: string
nodeSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
observability:
type: object
properties:
Expand Down Expand Up @@ -10835,6 +10936,11 @@ spec:
type: array
items:
type: string
tolerations:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
ttlSecondsAfterFinished:
type: integer
version:
Expand Down Expand Up @@ -13012,6 +13118,51 @@ spec:
saver:
type: object
properties:
affinity:
type: object
properties:
nodeAffinity:
type: object
properties:
preferredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
requiredDuringSchedulingIgnoredDuringExecution:
type: object
properties:
nodeSelectorTerms:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
podAffinity:
type: object
properties:
preferredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
requiredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
podAntiAffinity:
type: object
properties:
preferredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
requiredDuringSchedulingIgnoredDuringExecution:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
agent_namespace:
type: string
concurrency:
Expand Down Expand Up @@ -13445,6 +13596,9 @@ spec:
type: string
node_name:
type: string
nodeSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
observability:
type: object
properties:
Expand Down Expand Up @@ -14123,6 +14277,11 @@ spec:
type: array
items:
type: string
tolerations:
type: array
items:
type: object
x-kubernetes-preserve-unknown-fields: true
ttlSecondsAfterFinished:
type: integer
version:
Expand Down
12 changes: 12 additions & 0 deletions charts/vald/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,10 @@ spec:
{{- toYaml .Job.securityContext | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Job.affinity }}
affinity:
{{- include "vald.affinity" .Job.affinity | nindent 8 }}
{{- end }}
containers:
- name: {{ .Job.name }}
image: "{{ .Job.image.repository }}:{{ default .default.Values.defaults.image.tag .Job.image.tag }}"
Expand Down Expand Up @@ -929,6 +933,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
Loading
Loading