forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pod-spec-from-previous-step.yaml
42 lines (40 loc) · 1.17 KB
/
pod-spec-from-previous-step.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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}}