forked from edseymour/pvc-transfer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjob-template.yaml
47 lines (46 loc) · 1.14 KB
/
job-template.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
46
apiVersion: v1
kind: Template
metadata:
name: rsync-template
parameters:
- name: SOURCE_PVC
displayName: Source PersistentVolumeClaim
description: Name of PVC to read data
required: true
- name: DEST_PVC
displayName: Destination PersistentVolumeClaim
description: Name of the PVC to write data
required: true
- name: RSYNC_IMAGE
displayName: Rsync Image Name
description: Name of Image to use for running rsync process
value: docker-registry.default.svc:5000/openshift/rsync
required: true
objects:
- apiVersion: batch/v1
kind: Job
metadata:
name: rsync
spec:
parallelism: 1
completions: 1
template:
metadata:
name: rsync
spec:
containers:
- name: rsync
image: ${RSYNC_IMAGE}
volumeMounts:
- name: source
mountPath: /srcd
- name: destination
mountPath: /dest
restartPolicy: OnFailure
volumes:
- name: source
persistentVolumeClaim:
claimName: ${SOURCE_PVC}
- name: destination
persistentVolumeClaim:
claimName: ${DEST_PVC}