_jobSpec.tpl 2.0 KB

123456789101112131415161718192021222324
  1. {{/* Job Spec */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.lib.workload.jobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}}
  4. rootCtx: The root context of the chart.
  5. objectData:
  6. backoffLimit: The number of retries before marking this job failed. Defaults to 6.
  7. completions: The desired number of successfully finished pods the job should be run with. Defaults to 1.
  8. parallelism: The maximum desired number of pods the job should run at any given time. Defaults to 1.
  9. activeDeadlineSeconds: Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer. If set to nil, the job is never terminated due to timeout.
  10. ttlSecondsAfterFinished: TTLSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature.
  11. completionMode: CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.
  12. */}}
  13. {{- define "ix.v1.common.lib.workload.jobSpec" -}}
  14. {{- $objectData := .objectData -}}
  15. {{- $rootCtx := .rootCtx -}}
  16. backoffLimit: {{ $objectData.backoffLimit | default 5 }}
  17. completionMode: {{ $objectData.completionMode | default "NonIndexed" }}
  18. completions: {{ $objectData.completions | default nil }}
  19. parallelism: {{ $objectData.parallelism | default 1 }}
  20. ttlSecondsAfterFinished: {{ $objectData.ttlSecondsAfterFinished | default 120 }}
  21. {{- with $objectData.activeDeadlineSeconds }}
  22. activeDeadlineSeconds: {{ . }}
  23. {{- end -}}
  24. {{- end -}}