_cronjobSpec.tpl 1.5 KB

1234567891011121314151617181920212223242526
  1. {{/* CronJob Spec */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.lib.workload.cronjobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) -}}
  4. rootCtx: The root context of the chart.
  5. objectData:
  6. schedule: The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
  7. concurrencyPolicy: Allow, Forbid, or Replace. Defaults to Allow.
  8. failedJobsHistoryLimit: The number of failed finished jobs to retain. Defaults to 1.
  9. successfulJobsHistoryLimit: The number of successful finished jobs to retain. Defaults to 3.
  10. startingDeadlineSeconds: Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Defaults to nil.
  11. timezone: The timezone name. Defaults to .Values.TZ
  12. +jobSpec data
  13. */}}
  14. {{- define "ix.v1.common.lib.workload.cronjobSpec" -}}
  15. {{- $objectData := .objectData -}}
  16. {{- $rootCtx := .rootCtx -}}
  17. timeZone: {{ (tpl ($objectData.timezone | default $rootCtx.Values.TZ) $rootCtx) | quote }}
  18. schedule: {{ (tpl $objectData.schedule $rootCtx) | quote }}
  19. concurrencyPolicy: {{ $objectData.concurrencyPolicy | default "Forbid" }}
  20. failedJobsHistoryLimit: {{ $objectData.failedJobsHistoryLimit | default 1 }}
  21. successfulJobsHistoryLimit: {{ $objectData.successfulJobsHistoryLimit | default 3 }}
  22. startingDeadlineSeconds: {{ $objectData.startingDeadlineSeconds | default nil }}
  23. jobTemplate:
  24. spec:
  25. {{- include "ix.v1.common.lib.workload.jobSpec" (dict "rootCtx" $rootCtx "objectData" $objectData) | nindent 4 }}
  26. {{- end -}}