Skip to content

Commit 5aac5a8

Browse files
authored
docs: full copy-edit of CronWorkflows page (argoproj#13292)
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
1 parent c94e21e commit 5aac5a8

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

docs/cron-workflows.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
> v2.5 and after
44
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.
88

99
## `CronWorkflow` Spec
1010

11-
An example `CronWorkflow` spec would look like:
11+
Below is an example `CronWorkflow`:
1212

1313
```yaml
1414
apiVersion: argoproj.io/v1alpha1
@@ -31,30 +31,31 @@ spec:
3131
3232
### `workflowSpec` and `workflowMetadata`
3333

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.
3536

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`.
3739

38-
`CronWorkflow.spec.workflowMetadata` can be used to add `labels` and `annotations`.
40+
You can use `CronWorkflow.spec.workflowMetadata` to add `labels` and `annotations`.
3941

4042
### `CronWorkflow` Options
4143

42-
| Option Name | Default Value | Description |
43-
|:----------------------------:|:----------------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
44-
| `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 |
44+
| Option Name | Default Value | Description |
45+
|:----------------------------:|:----------------------:|-------------|
46+
| `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 |
5254

5355
### Cron Schedule Syntax
5456

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).
5859

5960
### Crash Recovery
6061

@@ -70,9 +71,10 @@ This setting can also be configured in tandem with `concurrencyPolicy` to achiev
7071

7172
### Daylight Saving
7273

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.
7476

75-
For example, with timezone set at `America/Los_Angeles`, we have daylight saving
77+
For example, with `timezone: America/Los_Angeles`:
7678

7779
- +1 hour (DST start) at 2020-03-08 02:00:00:
7880

@@ -141,7 +143,7 @@ stopStrategy:
141143

142144
### CLI
143145

144-
`CronWorkflow` can be created from the CLI by using basic commands:
146+
You can create `CronWorkflows` with the CLI:
145147

146148
```bash
147149
$ argo cron create cron.yaml
@@ -176,20 +178,20 @@ NextScheduledTime: Thu Oct 29 13:03:00 +0000 (32 seconds from now)
176178
Active Workflows: test-cron-wf-rt4nf
177179
```
178180

179-
**Note**: `NextScheduledRun` assumes that the workflow-controller uses UTC as its timezone
181+
**Note**: `NextScheduledRun` assumes the Controller uses UTC as its timezone
180182

181183
### `kubectl`
182184

183-
Using `kubectl apply -f` and `kubectl get cwf`
185+
You can use `kubectl apply -f` and `kubectl get cwf`
184186

185187
## Back-Filling Days
186188

187189
See [cron backfill](cron-backfill.md).
188190

189191
### GitOps via Argo CD
190192

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)
192194

193195
### UI
194196

195-
`CronWorkflow` resources can also be managed by the UI
197+
You can also manage `CronWorkflow` resources in the UI

0 commit comments

Comments
 (0)