You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cron-workflows.md
+29-27Lines changed: 29 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@
2
2
3
3
> v2.5 and after
4
4
5
-
## Introduction
6
-
7
-
`CronWorkflow` are workflows that run on a preset schedule. They are designed to be converted from `Workflow` easily and to mimic the same options as Kubernetes `CronJob`. In essence, `CronWorkflow` = `Workflow` + some specific cron options.
5
+
`CronWorkflows` are workflows that run on a schedule.
6
+
They are designed to wrap a `workflowSpec` and to mimic the options of Kubernetes `CronJobs`.
7
+
In essence, `CronWorkflow` = `Workflow` + some specific cron options.
8
8
9
9
## `CronWorkflow` Spec
10
10
11
-
An example `CronWorkflow` spec would look like:
11
+
Below is an example `CronWorkflow`:
12
12
13
13
```yaml
14
14
apiVersion: argoproj.io/v1alpha1
@@ -31,30 +31,31 @@ spec:
31
31
32
32
### `workflowSpec` and `workflowMetadata`
33
33
34
-
`CronWorkflow.spec.workflowSpec`is the same type as `Workflow.spec` and serves as a template for `Workflow` objects that are created from it. Everything under this spec will be converted to a `Workflow`.
34
+
`CronWorkflow.spec.workflowSpec`is the same type as `Workflow.spec`.
35
+
It is a template for `Workflow` objects created from it.
35
36
36
-
The resulting `Workflow` name will be a generated name based on the `CronWorkflow` name. In this example it could be something like `test-cron-wf-tj6fe`.
37
+
The `Workflow` name is generated based on the `CronWorkflow` name.
38
+
In the above example it would be similar to `test-cron-wf-tj6fe`.
37
39
38
-
`CronWorkflow.spec.workflowMetadata`can be used to add `labels` and `annotations`.
40
+
You can use `CronWorkflow.spec.workflowMetadata` to add `labels` and `annotations`.
| `schedule` | None, must be provided | Schedule at which the `Workflow` will be run. E.g. `5 4 * * *` |
45
-
| `timezone` |Machine timezone | Timezone during which the Workflow will be run from the IANA timezone standard, e.g. `America/Los_Angeles` |
46
-
| `suspend` | `false` | If `true` Workflow scheduling will not occur. Can be set from the CLI, GitOps, or directly |
47
-
| `concurrencyPolicy` | `Allow` | Policy that determines what to do if multiple `Workflows` are scheduled at the same time. Available options: `Allow`: allow all, `Replace`: remove all old before scheduling a new, `Forbid`: do not allow any new while there are old |
48
-
| `startingDeadlineSeconds` | `0` | Number of seconds after the last scheduled time during which a missed `Workflow` will still be run. See [Crash Recovery](#crash-recovery) for more details. |
49
-
| `successfulJobsHistoryLimit` | `3` | Number of successful `Workflows` that will be persisted at a time |
50
-
| `failedJobsHistoryLimit` | `1` | Number of failed `Workflows` that will be persisted at a time |
51
-
| `stopStrategy` | `nil` | v3.6 and after: defines if the CronWorkflow should stop scheduling based on a condition |
| `schedule` | None, must be provided | [Cron schedule](#cron-schedule-syntax) to run `Workflows`. Example: `5 4 * * *` |
47
+
| `timezone` | Machine timezone | [IANA Timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to run `Workflows`. Example: `America/Los_Angeles`|
48
+
| `suspend` | `false` | If `true` Workflow scheduling will not occur. Can be set from the CLI, GitOps, or directly |
49
+
| `concurrencyPolicy` | `Allow` | What to do if multiple `Workflows` are scheduled at the same time. `Allow`: allow all, `Replace`: remove all old before scheduling new, `Forbid`: do not allow any new while there are old |
50
+
| `startingDeadlineSeconds` | `0` | Seconds after [the last scheduled time](#crash-recovery) during which a missed `Workflow` will still be run. |
51
+
| `successfulJobsHistoryLimit` | `3` | Number of successful `Workflows` to persist |
52
+
| `failedJobsHistoryLimit` | `1` | Number of failed `Workflows` to persist |
53
+
| `stopStrategy` | `nil` | v3.6 and after: defines if the CronWorkflow should stop scheduling based on a condition |
52
54
53
55
### Cron Schedule Syntax
54
56
55
-
The cron scheduler uses the standard cron syntax, as [documented on Wikipedia](https://en.wikipedia.org/wiki/Cron).
56
-
57
-
More detailed documentation for the specific library used is [documented here](https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format).
57
+
The cron scheduler uses [standard cron syntax](https://en.wikipedia.org/wiki/Cron).
58
+
The implementation is the same as `CronJobs`, using [`robfig/cron`](https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format).
58
59
59
60
### Crash Recovery
60
61
@@ -70,9 +71,10 @@ This setting can also be configured in tandem with `concurrencyPolicy` to achiev
70
71
71
72
### Daylight Saving
72
73
73
-
Daylight Saving (DST) is taken into account when using timezone. This means that, depending on the local time of the scheduled job, argo will schedule the workflow once, twice, or not at all when the clock moves forward or back.
74
+
When using `timezone`, [Daylight Saving Time (DST)](https://en.wikipedia.org/wiki/Daylight_saving_time) is taken into account.
75
+
Depending on the local time of the scheduled workflow, it will run once, twice, or not at all when the clock moves forward or back.
74
76
75
-
For example, with timezone set at `America/Los_Angeles`, we have daylight saving
77
+
For example, with `timezone: America/Los_Angeles`:
76
78
77
79
- +1 hour (DST start) at 2020-03-08 02:00:00:
78
80
@@ -141,7 +143,7 @@ stopStrategy:
141
143
142
144
### CLI
143
145
144
-
`CronWorkflow` can be created from the CLI by using basic commands:
146
+
You can create `CronWorkflows` with the CLI:
145
147
146
148
```bash
147
149
$ argo cron create cron.yaml
@@ -176,20 +178,20 @@ NextScheduledTime: Thu Oct 29 13:03:00 +0000 (32 seconds from now)
176
178
Active Workflows: test-cron-wf-rt4nf
177
179
```
178
180
179
-
**Note**: `NextScheduledRun` assumes that the workflow-controller uses UTC as its timezone
181
+
**Note**: `NextScheduledRun` assumes the Controller uses UTC as its timezone
180
182
181
183
### `kubectl`
182
184
183
-
Using `kubectl apply -f` and `kubectl get cwf`
185
+
You can use `kubectl apply -f` and `kubectl get cwf`
184
186
185
187
## Back-Filling Days
186
188
187
189
See [cron backfill](cron-backfill.md).
188
190
189
191
### GitOps via Argo CD
190
192
191
-
`CronWorkflow`resources can be managed with GitOps by using [Argo CD](https://github.com/argoproj/argo-cd)
193
+
You can manage `CronWorkflow` resources with GitOps by using [Argo CD](https://github.com/argoproj/argo-cd)
192
194
193
195
### UI
194
196
195
-
`CronWorkflow`resources can also be managed by the UI
197
+
You can also manage `CronWorkflow` resources in the UI
0 commit comments