-
Notifications
You must be signed in to change notification settings - Fork 1
/
rclone.yaml
107 lines (100 loc) · 2.64 KB
/
rclone.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#
# https://hub.docker.com/r/rclone/rclone
#
apiVersion: template.openshift.io/v1
kind: Template
labels:
template: rclone
message: rclone template
metadata:
annotations:
description: Deploys a rclone Cronjob to synchronize a PVC into a S3 bucket/folder
iconClass: "fa fa-cubes"
openshift.io/display-name: rclone
openshift.io/provider-display-name: CSC
name: rclone
objects:
- apiVersion: batch/v1beta1
kind: CronJob
metadata:
labels:
app: rclone
name: rclone
spec:
schedule: ${SCHEDULE}
jobTemplate:
spec:
template:
metadata:
labels:
parent: "rclone"
spec:
containers:
- name: rclone
image: rclone/rclone:1
command: ["rclone", "sync", "-P", "/mnt", "default:${BUCKET_DIR}"]
volumeMounts:
- mountPath: /.rclone.conf
name: rclone-conf
subPath: rclone.conf
- mountPath: /mnt
name: pvc
restartPolicy: OnFailure
volumes:
- name: rclone-conf
secret:
secretName: rclone-conf
defaultMode: 420
items:
- key: rclone.conf
path: rclone.conf
- name: pvc
persistentVolumeClaim:
claimName: ${PVC}
- apiVersion: v1
kind: Secret
metadata:
name: rclone-conf
labels:
app: rclone
type: Opaque
stringData:
"rclone.conf": |-
[default]
type = s3
provider = Other
env_auth = false
access_key_id = ${ACCESS_KEY}
secret_access_key = ${SECRET_KEY}
endpoint = ${S3HOST}
location_constraint = regionOne
parameters:
- name: ACCESS_KEY
required: true
description: Access key
displayName: Access key
from: '[a-zA-Z0-9]{32}'
- name: SECRET_KEY
description: "Secret key"
displayName: Secret key
required: true
from: '[a-zA-Z0-9]{32}'
- name: PVC
description: "Name on the persistent volume claim to synchronize from"
displayName: PersistentVolumeClaim
required: true
- name: BUCKET_DIR
description: "Bucket and directory to synchronize to. The format should be <bucket>/path/path2"
displayName: Bucket and directory
required: true
- name: S3HOST
description: "Host name for the S3 server"
displayName: Host name
required: true
value: "object.pouta.csc.fi"
- name: SCHEDULE
description: >
When to run the cronjob, see https://en.wikipedia.org/wiki/Cron for reference
displayName: Schedule
required: true
value: "30 * * * *"