Add startingDeadlineSeconds field to cronJobs

This patch set adds "startingDeadlineSeconds" field to cronJobs.
When the field is not set, the controller counts how many missed
jobs occured from the last scheduled time till now. And if it happends
more than 100 time the job will not be scheduled. To avoid this
the "startingDeadlineSeconds" field should be set to sufficient period
of time. In this case the controller counts how many missed jobs occured
during this period of time. The value of the field should be less than
time (in seconds) needed for running >100 jobs (according to schedule).

Change-Id: I3bf7c7077b55ca5a3421052bd0b59b70c9bbcf24
This commit is contained in:
Dmitrii Kabanov 2018-10-11 16:02:02 -07:00
parent 815fa767ed
commit 34a092a7f4
7 changed files with 16 additions and 0 deletions

View File

@ -33,6 +33,9 @@ spec:
schedule: {{ .Values.jobs.volume_usage_audit.cron | quote }}
successfulJobsHistoryLimit: {{ .Values.jobs.volume_usage_audit.history.success }}
failedJobsHistoryLimit: {{ .Values.jobs.volume_usage_audit.history.failed }}
{{- if .Values.jobs.volume_usage_audit.starting_deadline }}
startingDeadlineSeconds: {{ .Values.jobs.volume_usage_audit.starting_deadline }}
{{- end }}
concurrencyPolicy: Forbid
jobTemplate:
metadata:

View File

@ -71,6 +71,7 @@ images:
jobs:
volume_usage_audit:
cron: "*/5 * * * *"
starting_deadline: 600
history:
success: 3
failed: 1

View File

@ -33,6 +33,9 @@ spec:
schedule: {{ .Values.jobs.engine_cleaner.cron | quote }}
successfulJobsHistoryLimit: {{ .Values.jobs.engine_cleaner.history.success }}
failedJobsHistoryLimit: {{ .Values.jobs.engine_cleaner.history.failed }}
{{- if .Values.jobs.engine_cleaner.starting_deadline }}
startingDeadlineSeconds: {{ .Values.jobs.engine_cleaner.starting_deadline }}
{{- end }}
concurrencyPolicy: Forbid
jobTemplate:
metadata:

View File

@ -67,6 +67,7 @@ images:
jobs:
engine_cleaner:
cron: "*/5 * * * *"
starting_deadline: 600
history:
success: 3
failed: 1

View File

@ -30,6 +30,9 @@ spec:
schedule: {{ .Values.jobs.cell_setup.cron | quote }}
successfulJobsHistoryLimit: {{ .Values.jobs.cell_setup.history.success }}
failedJobsHistoryLimit: {{ .Values.jobs.cell_setup.history.failed }}
{{- if .Values.jobs.cell_setup.starting_deadline }}
startingDeadlineSeconds: {{ .Values.jobs.cell_setup.starting_deadline }}
{{- end }}
concurrencyPolicy: Forbid
jobTemplate:
metadata:

View File

@ -30,6 +30,9 @@ spec:
schedule: {{ .Values.jobs.service_cleaner.cron | quote }}
successfulJobsHistoryLimit: {{ .Values.jobs.service_cleaner.history.success }}
failedJobsHistoryLimit: {{ .Values.jobs.service_cleaner.history.failed }}
{{- if .Values.jobs.service_cleaner.starting_deadline }}
startingDeadlineSeconds: {{ .Values.jobs.service_cleaner.starting_deadline }}
{{- end }}
concurrencyPolicy: Forbid
jobTemplate:
metadata:

View File

@ -100,11 +100,13 @@ jobs:
# TODO(portdirect): Add a post-start action to nova compute pods that registers themselves.
cell_setup:
cron: "0 */1 * * *"
starting_deadline: 600
history:
success: 3
failed: 1
service_cleaner:
cron: "0 */1 * * *"
starting_deadline: 600
history:
success: 3
failed: 1