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
Description: Add `cronWorkflowDefaults` to the controller ConfigMap so default `CronWorkflow` spec values can be set controller-wide
4
+
Author: [alien2003](https://github.com/alien2003)
5
+
6
+
`cronWorkflowDefaults` mirrors the existing `workflowDefaults`, but for `CronWorkflow` spec fields such as `concurrencyPolicy`, `startingDeadlineSeconds`, `successfulJobsHistoryLimit`, `failedJobsHistoryLimit` and `timezone`.
7
+
Use it to enforce settings across every `CronWorkflow` a controller manages, for example capping the number of retained child Workflows for cost control without editing each `CronWorkflow`.
8
+
9
+
A value set on the `CronWorkflow` itself always takes precedence over the default.
10
+
Defaults are applied to the controller's in-memory copy during reconciliation and are never written back to the resource, so they do not conflict with GitOps tools that own the `CronWorkflow` manifest.
Copy file name to clipboardExpand all lines: docs/default-workflow-specs.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,3 +55,29 @@ data:
55
55
parallelism: 3
56
56
57
57
```
58
+
59
+
## Setting Default CronWorkflow Values
60
+
61
+
> v4.1 and after
62
+
63
+
Default `CronWorkflow` spec values can be specified under the `cronWorkflowDefaults` key in the `workflow-controller-configmap`.
64
+
These apply to all `CronWorkflows` executed from the controller, such as `concurrencyPolicy`, `startingDeadlineSeconds`, `successfulJobsHistoryLimit`, `failedJobsHistoryLimit` and `timezone`.
65
+
If a `CronWorkflow` sets a value that also has a default, the `CronWorkflow`'s value takes precedence.
66
+
See the [Field Reference](./fields.md#cronworkflowspec) for the full list of `CronWorkflowSpec` fields.
67
+
68
+
Defaults are applied to the controller's in-memory copy during reconciliation and are never written back to the `CronWorkflow`, so they do not conflict with GitOps tools that manage the resource.
69
+
70
+
For example, to keep at most four successful and four failed child Workflows for every `CronWorkflow`:
Copy file name to clipboardExpand all lines: docs/workflow-controller-configmap.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,7 @@ Config contains the root of the configuration settings for the workflow controll
86
86
| `Links` | `Array<`[`Link`](fields.md#link)`>` | Links to related apps. |
87
87
| `Columns` | `Array<`[`Column`](fields.md#column)`>` | Columns are custom columns that will be exposed in the Workflow List View. |
88
88
| `WorkflowDefaults` | [`wfv1.Workflow`](fields.md#workflow) | WorkflowDefaults are values that will apply to all Workflows from this controller, unless overridden on the Workflow-level |
89
+
| `CronWorkflowDefaults` | [`wfv1.CronWorkflowSpec`](fields.md#cronworkflowspec) | CronWorkflowDefaults are values that will apply to all CronWorkflows from this controller, unless overridden on the CronWorkflow-level |
89
90
| `PodSpecLogStrategy` | [`PodSpecLogStrategy`](#podspeclogstrategy) | PodSpecLogStrategy enables the logging of podspec on controller log. |
90
91
| `PodGCGracePeriodSeconds` | `int64` | PodGCGracePeriodSeconds specifies the duration in seconds before a terminating pod is forcefully killed. Value must be non-negative integer. A zero value indicates that the pod will be forcefully terminated immediately. Defaults to the Kubernetes default of 30 seconds. |
91
92
| `PodGCDeleteDelayDuration` | [`metav1.Duration`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#duration-v1-meta) | PodGCDeleteDelayDuration specifies the duration before pods in the GC queue get deleted. Value must be non-negative. A zero value indicates that the pods will be deleted immediately. Defaults to 5 seconds. |
0 commit comments