Skip to content

Commit

Permalink
argo-workflows: add example
Browse files Browse the repository at this point in the history
Signed-off-by: Login Victor <batazor@evrone.com>
  • Loading branch information
batazor committed Aug 29, 2022
1 parent 64152be commit d6fecf6
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 7 deletions.
28 changes: 28 additions & 0 deletions ops/Helm/shortlink-workflows/templates/workflow-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: shortlink-template
spec:
serviceAccountName: argo
templates:
- name: templateContainer
inputs:
parameters:
- name: message
container:
image: docker/whalesay:latest
command: [ cowsay ]
args: [ "{{ printf "{{inputs.parameters.message}}" }}" ]
resources: # limit the resources
limits:
memory: 32Mi
cpu: 100m
retryStrategy:
limit: 10
retryPolicy: "Always"
backoff:
duration: "1" # Must be a string. Default unit is seconds. Could also be a Duration, e.g.: "2m", "6h", "1d"
factor: 2
maxDuration: "1m" # Must be a string. Default unit is seconds. Could also be a Duration, e.g.: "2m", "6h", "1d"
affinity:
nodeAntiAffinity: { }
46 changes: 39 additions & 7 deletions ops/Helm/shortlink-workflows/templates/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: shortlink-
name: shortlink
namespace: {{ .Release.Namespace }}
generateName: hello-world-
spec:
entrypoint: whalesay
serviceAccountName: argo
entrypoint: containerA
arguments:
parameters:
- name: message
value: hello world
templates:
- name: whalesay
container:
image: docker/whalesay
command: [cowsay]
args: ["Hello, world!"]
- name: containerA
dag:
tasks:
- name: containerA
templateRef:
name: shortlink-template
template: templateContainer
arguments:
parameters: [{name: message, value: A}]
- name: containerB
dependencies: [containerA]
templateRef:
name: shortlink-template
template: templateContainer
arguments:
parameters: [{name: message, value: B}]
- name: containerC
dependencies: [ containerA ]
templateRef:
name: shortlink-template
template: templateContainer
arguments:
parameters: [{name: message, value: C}]
- name: containerD
dependencies: [ containerB, containerC ]
templateRef:
name: shortlink-template
template: templateContainer
arguments:
parameters: [{name: message, value: D}]

0 comments on commit d6fecf6

Please sign in to comment.