Skip to content

Commit 563872b

Browse files
committed
Merge branch 'feature-dedupe-backup-redis' into temp-feature-all-1.22
2 parents 3bd7c9c + b0db3f0 commit 563872b

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: "sync-{{'up' if is_upload else 'down'}}-{{ id }}"
5+
labels:
6+
role: sync-local-remote
7+
coll: {{ id }}
8+
9+
spec:
10+
ttlSecondsAfterFinished: 0
11+
backoffLimit: 3
12+
template:
13+
metadata:
14+
labels:
15+
role: sync-local-remote
16+
coll: {{ id }}
17+
18+
spec:
19+
securityContext:
20+
runAsNonRoot: true
21+
runAsUser: 999
22+
runAsGroup: 999
23+
fsGroup: 999
24+
25+
restartPolicy: Never
26+
podFailurePolicy:
27+
rules:
28+
- action: FailJob
29+
onExitCodes:
30+
containerName: rclone
31+
operator: NotIn
32+
values: [0]
33+
volumes:
34+
- name: thedata
35+
persistentVolumeClaim:
36+
claimName: "{{ pvc_name }}"
37+
38+
containers:
39+
- name: rclone
40+
image: rclone/rclone:latest
41+
volumeMounts:
42+
- name: thedata
43+
mountPath: "/data"
44+
{% if is_upload %}
45+
readOnly: true
46+
{% endif %}
47+
48+
env:
49+
- name: RCLONE_CONFIG_REMOTE_TYPE
50+
value: "s3"
51+
52+
- name: RCLONE_CONFIG_REMOTE_ACCESS_KEY_ID
53+
valueFrom:
54+
secretKeyRef:
55+
name: "{{ storage_secret_name }}"
56+
key: STORE_ACCESS_KEY
57+
58+
- name: RCLONE_CONFIG_REMOTE_SECRET_ACCESS_KEY
59+
valueFrom:
60+
secretKeyRef:
61+
name: "{{ storage_secret_name }}"
62+
key: STORE_SECRET_KEY
63+
64+
- name: RCLONE_CONFIG_REMOTE_REGION
65+
valueFrom:
66+
secretKeyRef:
67+
name: "{{ storage_secret_name }}"
68+
key: STORE_REGION
69+
70+
- name: RCLONE_CONFIG_REMOTE_PROVIDER
71+
valueFrom:
72+
secretKeyRef:
73+
name: "{{ storage_secret_name }}"
74+
key: STORE_S3_PROVIDER
75+
76+
- name: RCLONE_CONFIG_REMOTE_ENDPOINT
77+
value: "{{ storage_endpoint }}"
78+
79+
{% if is_upload %}
80+
command: ["rclone", "-vv", "copyto", "--checksum", "/data/{{ local_file }}", "remote:{{ remote_file_path }}"]
81+
{% else %}
82+
command: ["rclone", "-vv", "copyto", "--checksum", "remote:{{ remote_file_path }}", "/data/{{ local_file }}"]
83+
{% endif %}
84+
resources:
85+
limits:
86+
memory: "200Mi"
87+
88+
requests:
89+
memory: "200Mi"
90+
cpu: "50m"

0 commit comments

Comments
 (0)