-
Andrew Shoell authoredAndrew Shoell authored
cronjob.yaml 7.33 KiB
{{- if .Values.apiVersionOverrides.cronjob -}}
apiVersion: {{ .Values.apiVersionOverrides.cronjob }}
{{- else if .Capabilities.APIVersions.Has "batch/v1/CronJob" }}
apiVersion: batch/v1
{{- else if .Capabilities.APIVersions.Has "batch/v1beta1/CronJob" }}
apiVersion: batch/v1beta1
{{- else }}
{{- fail "\n\n ERROR: You must have at least batch/v1beta1 to use CronJob" }}
{{- end }}
kind: CronJob
metadata:
name: {{ include "renovate.fullname" . }}
labels:
{{- include "renovate.labels" . | nindent 4 }}
{{- with .Values.cronjob.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.cronjob.annotations }}
annotations:
{{ toYaml .Values.cronjob.annotations | nindent 4 }}
{{- end }}
spec:
schedule: "{{ .Values.cronjob.schedule }}"
{{- with .Values.cronjob.timeZone }}
timeZone: {{ . }}
{{- end }}
{{- with .Values.cronjob.suspend }}
suspend: {{ . }}
{{- end }}
{{- with .Values.cronjob.concurrencyPolicy }}
concurrencyPolicy: {{ . }}
{{- end }}
{{- with .Values.cronjob.failedJobsHistoryLimit }}
failedJobsHistoryLimit: {{ . }}
{{- end }}
{{- with .Values.cronjob.successfulJobsHistoryLimit }}
successfulJobsHistoryLimit: {{ . }}
{{- end }}
{{- with .Values.cronjob.startingDeadlineSeconds }}
startingDeadlineSeconds: {{ . }}
{{- end }}
jobTemplate:
metadata:
labels:
{{- include "renovate.selectorLabels" . | nindent 8 }}
spec:
{{- if .Values.cronjob.ttlSecondsAfterFinished }}
ttlSecondsAfterFinished: {{ .Values.cronjob.ttlSecondsAfterFinished }}
{{- end }}
{{- if .Values.cronjob.activeDeadlineSeconds }}
activeDeadlineSeconds: {{ .Values.cronjob.activeDeadlineSeconds }}
{{- end }}
{{- if .Values.cronjob.jobBackoffLimit }}
backoffLimit: {{ .Values.cronjob.jobBackoffLimit }}
{{- end }}
template:
metadata:
labels:
{{- include "renovate.selectorLabels" . | nindent 12 }}
{{- with .Values.pod.labels }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.pod.annotations }}
annotations:
{{ toYaml .Values.pod.annotations | nindent 12 }}
{{- end }}
spec:
serviceAccountName: {{ include "renovate.serviceAccountName" . }}
restartPolicy: {{ .Values.cronjob.jobRestartPolicy }}
{{- with .Values.hostAliases }}