-
Notifications
You must be signed in to change notification settings - Fork 15
/
backup-cronjob-template.yaml
107 lines (107 loc) · 4.01 KB
/
backup-cronjob-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
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
107
---
apiVersion: v1
kind: Template
metadata:
name: integreatly-cronjob-backup-template
annotations:
description: 'Cronjob for backing up integreatly data'
objects:
- apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: ${NAME}
labels:
monitoring-key: middleware
spec:
schedule: ${CRON_SCHEDULE}
concurrencyPolicy: ${CONCURRENCY_POLICY}
jobTemplate:
spec:
template:
metadata:
name: ${NAME}
labels:
monitoring-key: middleware
cronjob-name: ${NAME}
spec:
serviceAccountName: "${SERVICEACCOUNT}"
containers:
- name: backup-cronjob
image: "${IMAGE}"
imagePullPolicy: Always
command:
- "/opt/intly/tools/entrypoint.sh"
- "-c"
- "${COMPONENT}"
- '-b'
- "${BACKEND}"
- "-e"
- "${ENCRYPTION}"
- "-d"
- "${DEBUG}"
env:
- name: BACKEND_SECRET_NAME
value: "${BACKEND_SECRET_NAME}"
- name: BACKEND_SECRET_NAMESPACE
value: "${BACKEND_SECRET_NAMESPACE}"
- name: ENCRYPTION_SECRET_NAME
value: "${ENCRYPTION_SECRET_NAME}"
- name: ENCRYPTION_SECRET_NAMESPACE
value: "${ENCRYPTION_SECRET_NAMESPACE}"
- name: COMPONENT_SECRET_NAME
value: "${COMPONENT_SECRET_NAME}"
- name: COMPONENT_SECRET_NAMESPACE
value: "${COMPONENT_SECRET_NAMESPACE}"
- name: PRODUCT_NAME
value: "${PRODUCT_NAME}"
- name: PRODUCT_NAMESPACE_PREFIX
value: "${PRODUCT_NAMESPACE_PREFIX}"
restartPolicy: Never
parameters:
- name: NAME
description: Unique job name to be used in several resource name(s)
value: integreatly-cronjob-backup
- name: PRODUCT_NAME
description: Middleware product name to have its data archived
required: true
- name: COMPONENT
description: Component name to run the backup
required: true
- name: PRODUCT_NAMESPACE_PREFIX
description: Namespace prefix for individual product namespaces. Empty by default. Planned to be 'openshift-' for RHMI.
value: ''
- name: BACKEND
description: Backend engine to upload the component archive
value: s3
- name: ENCRYPTION
description: Encryption engine to encrypt component archive before uploading it
- name: COMPONENT_SECRET_NAME
description: Component secret name to create environment variables from
- name: COMPONENT_SECRET_NAMESPACE
description: If the component secret is not in default, put it's namespace here
value: default
- name: BACKEND_SECRET_NAME
description: Backend secret name to create environment variables from
required: true
- name: BACKEND_SECRET_NAMESPACE
description: Backend secret namespace to create environment variables from
value: default
- name: ENCRYPTION_SECRET_NAME
description: Encryption secret name to create environment variables from
- name: ENCRYPTION_SECRET_NAMESPACE
description: Encryption secret namespace to create environment variables from
value: default
- name: CRON_SCHEDULE
description: 'Job schedule in Cron Format [Default is to trigger a job every minute for development purposes]'
value: '*/1 * * * *'
- name: IMAGE
description: 'Backup docker image URL'
value: 'quay.io/integreatly/backup-container:master'
- name: SERVICEACCOUNT
description: 'The service account used by the backup job'
value: backupjob
- name: DEBUG
description: "Debug flag to sleep the job pod after its execution"
- name: CONCURRENCY_POLICY
description: The concurrency policy of the CronJob
value: Forbid