Skip to content

Commit

Permalink
docs: Example showing how to use default settings for workflow spec. …
Browse files Browse the repository at this point in the history
…Related to #argoproj#2388 (argoproj#2411)
  • Loading branch information
NikeNano committed Mar 13, 2020
1 parent 1350882 commit dd3029a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/default-workflow-specs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Default Workflow Spec

![alpha](assets/alpha.svg)

> v2.7 and after
It's possible to set default workflow specs which will be written to all workflows if the spec of interest is not set. This can be configurated through the
workflow controller config [map](../workflow/config/config.go#L11) and the field [DefaultWorkflowSpec](../workflow/config/config.go#L69).


In order to edit the Default workflow spec for a controller, edit the workflow config map:


```bash
kubectl edit cm/workflow-controller-configmap
```


As an example the time for a argo workflow to live after finish can be set, in the spec this field is known as ```secondsAfterCompletion``` in the ```ttlStrategy```. Example of how the config map could look with this filed can be found [here](./workflow-controller-configmap.yaml).

In order to test it a example workflow can be submited, in this case the [coinflip example](../examples/coinflip.yaml), the following can be run:

```bash
argo submit ./examples/coinflip.yaml
```

to verify that the the defaultd are set run

```bash
argo get [YOUR_ARGO_WORKFLOW_NAME]
```

You should then see the field, Ttl Strategy populated
```yaml
Ttl Strategy:
Seconds After Completion: 10
```
5 changes: 5 additions & 0 deletions docs/workflow-controller-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,8 @@ data:
# passwordSecret:
# name: argo-mysql-config
# key: password
# default workflow spec, follow the workflow spec, more info: https://github.com/argoproj/argo/blob/master/examples/README.md#the-structure-of-workflow-specs
workflowDefaults:
ttlStrategy:
secondsAfterCompletion: 10

0 comments on commit dd3029a

Please sign in to comment.