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

Update cron-jobs.md #11512

Merged
merged 9 commits into from
Feb 18, 2019
12 changes: 7 additions & 5 deletions content/en/docs/concepts/workloads/controllers/cron-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ It is important to note that if the `startingDeadlineSeconds` field is set (not

A CronJob is counted as missed if it has failed to be created at its scheduled time. For example, If `concurrencyPolicy` is set to `Forbid` and a CronJob was attempted to be scheduled when there was a previous schedule still running, then it would count as missed.

For example, suppose a cron job is set to start at exactly `08:30:00` and its
`startingDeadlineSeconds` is set to 10, if the CronJob controller happens to
be down from `08:29:00` to `08:42:00`, the job will not start.
Set a longer `startingDeadlineSeconds` if starting later is better than not
starting at all.
For example, suppose a cron job is run to schedule every one minute, say it is set to start at exactly `08:30:00` and its
k-vishwa marked this conversation as resolved.
Show resolved Hide resolved
`startingDeadlineSeconds` is not set, if the CronJob controller happens to
k-vishwa marked this conversation as resolved.
Show resolved Hide resolved
be down from `08:29:00` to `10:21:00`, the job will not start as the number of missed jobs which missed their schedule is greater than 100.

For example, suppose a cron job is run to schedule every one minute, say it is set to start at exactly `08:30:00` and its
k-vishwa marked this conversation as resolved.
Show resolved Hide resolved
`startingDeadlineSeconds` is set to 200 seconds, if the CronJob controller happens to
k-vishwa marked this conversation as resolved.
Show resolved Hide resolved
be down from `08:29:00` to `10:21:00`, the job will still start at 10:22:00. This happens as the controller now checks how many missed schedules happened in the last 200 seconds (ie, 3 missed schedules), rather than from the last scheduled time until now.
k-vishwa marked this conversation as resolved.
Show resolved Hide resolved

The Cronjob is only responsible for creating Jobs that match its schedule, and
the Job in turn is responsible for the management of the Pods it represents.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To view completed pods of a job, use `kubectl get pods`.
To list all the pods that belong to a job in a machine readable form, you can use a command like this:

```shell
$ pods=$(kubectl get pods --selector=job-name=pi --output=jsonpath={.items..metadata.name})
$ pods=$(kubectl get pods --selector=job-name=pi --output=jsonpath='{.items[*].metadata.name}')
$ echo $pods
pi-aiw0a
```
Expand Down