-
Notifications
You must be signed in to change notification settings - Fork 2
/
sris-schedule-job.yml
178 lines (174 loc) · 5.17 KB
/
sris-schedule-job.yml
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
apiVersion: template.openshift.io/v1
kind: Template
labels:
template: "${APP_NAME}-template"
app: "${APP_NAME}"
metadata:
name: "${APP_NAME}-template"
parameters:
- name: APP_NAME
description: Application name
value: sris
- name: TAG
description: The identifying tag for this specific deployment
required: true
- name: NAMESPACE
description: Target namespace reference (i.e. 'k8vopl-dev')
required: true
- name: CHEFS_MAIL_FORM_ID
description: Mail Form ID
required: true
- name: CHEFS_MAIL_FORM_VERSION
description: Mail Form version number
required: true
- name: RCV_LAYER_ID
description:
required: true
- name: CHES_URL
description: The email service url
required: true
- name: CHEFS_MAIL_API_KEY
description: The API key for email form
required: true
- name: SRC_LAYER_ID
description: The source layer ID
required: true
- name: HV_CSV_ID
description: High Volume CSV ID
required: true
- name: WEB_MAP_APP_ID
description: Web Map App ID
required: true
- name: CHES_API_OAUTH_SECRET
description: secret to connect to email api.
required: true
- name: RCV_CSV_ID
description: Rcv csv id
required: true
- name: SRC_CSV_ID
description: Application name
required: true
- name: MAPHUB_USER
description: MapHub User
required: true
- name: CHEFS_HV_FORM_ID
description: High Volume Form ID.
required: true
- name: CHEFS_HV_FORM_VERSION
description: High Volume Form version number.
required: true
- name: MAPHUB_PASS
description: map hub password.
required: true
- name: CHEFS_API_URL
description: Chefs API URL
required: true
- name: AUTH_URL
description: Authorization url.
required: true
- name: CHEFS_SOILS_FORM_ID
description: Soil Form ID.
required: true
- name: CHEFS_SOILS_FORM_VERSION
description: Soil Form version number.
required: true
- name: HV_LAYER_ID
description: High Volume Layer ID.
required: true
- name: CHEFS_HV_API_KEY
description: High Volume API key.
required: true
- name: CHEFS_SOILS_API_KEY
description: Soils API Key
required: true
- name: LOGLEVEL
description: Logging level
required: true
- name: NOTICE_STANDARD_TIME
description: Notification processing interval time
required: true
- name: AGOL_UPDATE_FLAG
description: FLAG to control, whether AGOL should be updated or not.
required: true
- name: EMAIL_NOTIFY_FLAG
description: FLAG to control, retrieval of subscribers from CHEFs and notifying them via CHES.
required: true
- name: TIMEOUT_SECONDS
description: Timeout to AGOL API call
required: true
- name: CHEFS_API_TIMEOUT
description: Timeout to CHEFS API call
required: true
- name: CHES_API_TIMEOUT
description: Timeout to CHES API call
required: true
objects:
- kind: ConfigMap
apiVersion: v1
metadata:
name: ${APP_NAME}-configmap
labels:
app: ${APP_NAME}
data:
CHEFS_MAIL_FORM_ID: ${CHEFS_MAIL_FORM_ID}
CHEFS_MAIL_FORM_VERSION: ${CHEFS_MAIL_FORM_VERSION}
RCV_LAYER_ID: ${RCV_LAYER_ID}
CHES_URL: ${CHES_URL}
CHEFS_MAIL_API_KEY: ${CHEFS_MAIL_API_KEY}
SRC_LAYER_ID: ${SRC_LAYER_ID}
HV_CSV_ID: ${HV_CSV_ID}
WEB_MAP_APP_ID: ${WEB_MAP_APP_ID}
CHES_API_OAUTH_SECRET: ${CHES_API_OAUTH_SECRET}
RCV_CSV_ID: ${RCV_CSV_ID}
SRC_CSV_ID: ${SRC_CSV_ID}
MAPHUB_USER: ${MAPHUB_USER}
CHEFS_HV_FORM_ID: ${CHEFS_HV_FORM_ID}
CHEFS_HV_FORM_VERSION: ${CHEFS_HV_FORM_VERSION}
MAPHUB_PASS: ${MAPHUB_PASS}
CHEFS_API_URL: ${CHEFS_API_URL}
AUTH_URL: ${AUTH_URL}
CHEFS_SOILS_FORM_ID: ${CHEFS_SOILS_FORM_ID}
CHEFS_SOILS_FORM_VERSION: ${CHEFS_SOILS_FORM_VERSION}
HV_LAYER_ID: ${HV_LAYER_ID}
CHEFS_HV_API_KEY: ${CHEFS_HV_API_KEY}
CHEFS_SOILS_API_KEY: ${CHEFS_SOILS_API_KEY}
LOGLEVEL: ${LOGLEVEL}
NOTICE_STANDARD_TIME: ${NOTICE_STANDARD_TIME}
AGOL_UPDATE_FLAG: ${AGOL_UPDATE_FLAG}
EMAIL_NOTIFY_FLAG: ${EMAIL_NOTIFY_FLAG}
TIMEOUT_SECONDS: ${TIMEOUT_SECONDS}
CHEFS_API_TIMEOUT: ${CHEFS_API_TIMEOUT}
CHES_API_TIMEOUT: ${CHES_API_TIMEOUT}
- apiVersion: batch/v1
kind: CronJob
metadata:
name: "${APP_NAME}-cron-job"
spec:
schedule: "0 8 * * *"
concurrencyPolicy: "Replace"
startingDeadlineSeconds: 300
suspend: false
successfulJobsHistoryLimit: 30
failedJobsHistoryLimit: 30
jobTemplate:
spec:
activeDeadlineSeconds: 1800
template:
metadata:
labels:
app: "${APP_NAME}"
spec:
containers:
- name: "${APP_NAME}-job"
image: ghcr.io/bcgov/nr-soils-relocation/${APP_NAME}:${TAG}
resources:
requests:
cpu: "100m"
memory: "2Gi"
limits:
cpu: "1.45"
memory: "3.9Gi"
envFrom:
- configMapRef:
name: "${APP_NAME}-configmap"
restartPolicy: OnFailure