-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathvolumes-pvc.yaml
44 lines (41 loc) · 1.19 KB
/
volumes-pvc.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
43
44
# This example demonstrates the ability for a workflow to create a
# temporary, ephemeral volume used by the workflow, and delete it
# when the workflow completes. It uses the same volumeClaimTemplates
# syntax as statefulsets.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: volumes-pvc-
spec:
entrypoint: volumes-pvc-example
volumeClaimTemplates:
- metadata:
name: workdir
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
templates:
- name: volumes-pvc-example
steps:
- - name: generate
template: hello-world-to-file
- - name: print
template: print-message-from-file
- name: hello-world-to-file
container:
image: busybox
command: [sh, -c]
args: ["echo generating message in volume; echo hello world | tee /mnt/vol/hello_world.txt"]
volumeMounts:
- name: workdir
mountPath: /mnt/vol
- name: print-message-from-file
container:
image: alpine:latest
command: [sh, -c]
args: ["echo getting message from volume; find /mnt/vol; cat /mnt/vol/hello_world.txt"]
volumeMounts:
- name: workdir
mountPath: /mnt/vol