Skip to content

Commit

Permalink
example for pod spec from output of previous step (argoproj#1724)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehtadeepen authored and sarabala1979 committed Nov 4, 2019
1 parent 12b983f commit 3412034
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions examples/pod-spec-from-previous-step.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: pod-spec-from-previous-step-
spec:
entrypoint: workflow
templates:
- name: workflow
dag:
tasks:
- name: parse-resources
template: parse-resources-tmpl
- name: setup-resources
dependencies: [parse-resources]
template: setup-resources-tmpl
arguments:
parameters:
- name: resources
value: "{{tasks.parse-resources.outputs.parameters.resources}}"

- name: parse-resources-tmpl
outputs:
parameters:
- name: resources
valueFrom:
path: /tmp/resources.json
script:
image: alpine:latest
command: [sh]
source: |
echo '{"memory": "10Gi", "cpu": "2000m"}' > /tmp/resources.json && cat /tmp/resources.json
- name: setup-resources-tmpl
inputs:
parameters:
- name: resources
podSpecPatch: '{"containers":[{"name":"main", "resources":{"limits": {{inputs.parameters.resources}}, "requests": {{inputs.parameters.resources}} }}]}'
script:
image: alpine:latest
command: [sh]
source: |
echo {{inputs.parameters.resources}}

0 comments on commit 3412034

Please sign in to comment.