forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
volumes-existing.yaml
45 lines (42 loc) · 1.31 KB
/
volumes-existing.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
45
# This example demonstrates the ability for a workflow to attach
# to a pre-created, existing volume for use throughout a workflow.
# A PVC named 'my-existing-volume' is assumed to exist. Create it
# using `kubectl create -f examples/testvolume.yaml`.
#
# The first step will append the current timestamp to an access log.
# The second step will dump the contents of the access log. Submit
# this workflow multiple times to see the access log grow after each
# submission.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: volumes-existing-
spec:
entrypoint: volumes-existing-example
volumes:
- name: workdir
persistentVolumeClaim:
claimName: my-existing-volume
templates:
- name: volumes-existing-example
steps:
- - name: generate
template: append-to-accesslog
- - name: print
template: print-accesslog
- name: append-to-accesslog
container:
image: alpine:latest
command: [sh, -c]
args: ["echo accessed at: $(date) | tee -a /mnt/vol/accesslog"]
volumeMounts:
- name: workdir
mountPath: /mnt/vol
- name: print-accesslog
container:
image: alpine:latest
command: [sh, -c]
args: ["echo 'Volume access log:'; cat /mnt/vol/accesslog"]
volumeMounts:
- name: workdir
mountPath: /mnt/vol