Skip to content

Commit fb956e7

Browse files
committed
OSDOCS-4095: Adding timezone option to cron job config
1 parent 6ec909e commit fb956e7

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

modules/nodes-nodes-jobs-creating-cron.adoc

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,45 @@ kind: CronJob
2121
metadata:
2222
name: pi
2323
spec:
24-
schedule: "*/1 * * * *" <1>
25-
concurrencyPolicy: "Replace" <2>
26-
startingDeadlineSeconds: 200 <3>
27-
suspend: true <4>
28-
successfulJobsHistoryLimit: 3 <5>
29-
failedJobsHistoryLimit: 1 <6>
30-
jobTemplate: <7>
24+
schedule: "*/1 * * * *" <1>
25+
timeZone: Etc/UTC <2>
26+
concurrencyPolicy: "Replace" <3>
27+
startingDeadlineSeconds: 200 <4>
28+
suspend: true <5>
29+
successfulJobsHistoryLimit: 3 <6>
30+
failedJobsHistoryLimit: 1 <7>
31+
jobTemplate: <8>
3132
spec:
3233
template:
3334
metadata:
34-
labels: <8>
35+
labels: <9>
3536
parent: "cronjobpi"
3637
spec:
3738
containers:
3839
- name: pi
3940
image: perl
4041
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
41-
restartPolicy: OnFailure <9>
42+
restartPolicy: OnFailure <10>
4243
----
4344
+
4445
<1> Schedule for the job specified in link:https://en.wikipedia.org/wiki/Cron[cron format]. In this example, the job will run every minute.
45-
<2> An optional concurrency policy, specifying how to treat concurrent jobs within a cron job. Only one of the following concurrent policies may be specified. If not specified, this defaults to allowing concurrent executions.
46+
<2> An optional time zone for the schedule. See link:https://en.wikipedia.org/wiki/List_of_tz_database_time_zones[List of tz database time zones] for valid options. If not specified, the Kubernetes controller manager interprets the schedule relative to its local time zone. This setting is offered as a link:https://access.redhat.com/support/offerings/techpreview[Technology Preview].
47+
<3> An optional concurrency policy, specifying how to treat concurrent jobs within a cron job. Only one of the following concurrent policies may be specified. If not specified, this defaults to allowing concurrent executions.
4648
* `Allow` allows cron jobs to run concurrently.
4749
* `Forbid` forbids concurrent runs, skipping the next run if the previous has not
4850
finished yet.
4951
* `Replace` cancels the currently running job and replaces
5052
it with a new one.
51-
<3> An optional deadline (in seconds) for starting the job if it misses its
53+
<4> An optional deadline (in seconds) for starting the job if it misses its
5254
scheduled time for any reason. Missed jobs executions will be counted as failed
5355
ones. If not specified, there is no deadline.
54-
<4> An optional flag allowing the suspension of a cron job. If set to `true`,
56+
<5> An optional flag allowing the suspension of a cron job. If set to `true`,
5557
all subsequent executions will be suspended.
56-
<5> The number of successful finished jobs to retain (defaults to 3).
57-
<6> The number of failed finished jobs to retain (defaults to 1).
58-
<7> Job template. This is similar to the job example.
59-
<8> Sets a label for jobs spawned by this cron job.
60-
<9> The restart policy of the pod. This does not apply to the job controller.
58+
<6> The number of successful finished jobs to retain (defaults to 3).
59+
<7> The number of failed finished jobs to retain (defaults to 1).
60+
<8> Job template. This is similar to the job example.
61+
<9> Sets a label for jobs spawned by this cron job.
62+
<10> The restart policy of the pod. This does not apply to the job controller.
6163
+
6264
[NOTE]
6365
====

0 commit comments

Comments
 (0)