-
Notifications
You must be signed in to change notification settings - Fork 5
/
limesurvey-bcgov.dc.yaml
318 lines (318 loc) · 10.2 KB
/
limesurvey-bcgov.dc.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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
---
kind: Template
apiVersion: template.openshift.io/v1
metadata:
name: nrmlimesurvey-app-dc
parameters:
- description: The OpenShift Namespace where the ImageStream resides.
displayName: Namespace
name: IS_NAMESPACE
value: 245e18-tools
- description: The OpenShift ImageStream name.
displayName: Image Stream
name: IS_NAME
value: limesurvey-bcgov
- description: Version of LimeSurvey image to be used (e.g. v.3.16).
displayName: Version of LimeSurvey
name: IS_VERSION
value: 5.3.21
- description: The short-name of the Survey Service, lower-case with hyphen.
displayName: LimeSurvey Acronym
name: SURVEY_NAME
required: true
value: nrm
- description: The disk space reserved for LimeSurvey uploads.
displayName: Upload Folder size
name: UPLOAD_FOLDER_CAPACITY
value: 1Gi
- description: The account name for the default LimeSurvey Administrator.
displayName: Administrator Account Name
name: ADMIN_USER
value: admin
- description: The descriptive name for the default LimeSurvey Administrator.
displayName: Administrator Display Name
name: ADMIN_NAME
value: Administrator
- description: Password for the default LimeSurvey Administrator.
displayName: Administrator Password
from: "[a-zA-Z0-9]{16}"
generate: expression
name: ADMIN_PASSWORD
required: true
- description: The email address for the default LimeSurvey Administrator.
displayName: Administrator Email Address
name: ADMIN_EMAIL
required: true
- description: The type of relational database (pgsql / mysql ); currently only pgsql is supported
displayName: Database Type
name: DB_TYPE
value: pgsql
- name: CPU_LIMIT
value: 200m
- name: MEMORY_LIMIT
value: 512Mi
- name: CPU_REQUEST
value: 50m
- name: MEMORY_REQUEST
value: 200Mi
- name: REPLICA_MIN
value: "2"
- name: REPLICA_MAX
value: "3"
objects:
- kind: Secret
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-app"
labels:
app: "${SURVEY_NAME}limesurvey"
annotations:
description: Application Administrator credentials and name.
template.openshift.io/expose-admin_username: "{.data['admin-user']}"
template.openshift.io/expose-admin_name: "{.data['admin-name']}"
template.openshift.io/expose-admin_password: "{.data['admin-password']}"
template.openshift.io/expose-admin_email: "{.data['admin-email']}"
stringData:
admin-user: "${ADMIN_USER}"
admin-name: "${ADMIN_NAME}"
admin-password: "${ADMIN_PASSWORD}"
admin-email: "${ADMIN_EMAIL}"
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-app-upload"
labels:
app: "${SURVEY_NAME}limesurvey"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: "${UPLOAD_FOLDER_CAPACITY}"
storageClassName: netapp-file-standard
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-app-config"
labels:
app: "${SURVEY_NAME}limesurvey"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 128Mi
storageClassName: netapp-file-standard
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-app-plugins"
labels:
app: "${SURVEY_NAME}limesurvey"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 128Mi
storageClassName: netapp-file-standard
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-app"
generation: 1
labels:
app: "${SURVEY_NAME}limesurvey"
annotations: {}
spec:
strategy:
type: Rolling
rollingParams:
updatePeriodSeconds: 1
intervalSeconds: 1
timeoutSeconds: 600
maxUnavailable: 25%
maxSurge: 25%
resources: {}
activeDeadlineSeconds: 21600
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- "${SURVEY_NAME}limesurvey-app"
from:
kind: ImageStreamTag
namespace: "${IS_NAMESPACE}"
name: "${IS_NAME}:${IS_VERSION}"
replicas: "${{REPLICA_MIN}}"
revisionHistoryLimit: 10
test: false
selector:
app: "${SURVEY_NAME}limesurvey"
deploymentconfig: "${SURVEY_NAME}limesurvey-app"
template:
metadata:
labels:
app: "${SURVEY_NAME}limesurvey"
deploymentconfig: "${SURVEY_NAME}limesurvey-app"
annotations: {}
spec:
volumes:
- name: "${SURVEY_NAME}limesurvey-app-upload"
persistentVolumeClaim:
claimName: "${SURVEY_NAME}limesurvey-app-upload"
- name: "${SURVEY_NAME}limesurvey-app-config"
persistentVolumeClaim:
claimName: "${SURVEY_NAME}limesurvey-app-config"
- name: "${SURVEY_NAME}limesurvey-app-plugins"
persistentVolumeClaim:
claimName: "${SURVEY_NAME}limesurvey-app-plugins"
containers:
- name: "${SURVEY_NAME}limesurvey-app"
image: " "
command: ["/bin/sh"]
args: ["-c", "docker-entrypoint.sh apache2-foreground"]
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8443
protocol: TCP
env:
- name: ADMIN_USER
valueFrom:
secretKeyRef:
name: "${SURVEY_NAME}limesurvey-app"
key: admin-user
- name: ADMIN_NAME
valueFrom:
secretKeyRef:
name: "${SURVEY_NAME}limesurvey-app"
key: admin-name
- name: ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: "${SURVEY_NAME}limesurvey-app"
key: admin-password
- name: ADMIN_EMAIL
valueFrom:
secretKeyRef:
name: "${SURVEY_NAME}limesurvey-app"
key: admin-email
- name: DB_TYPE
value: "${DB_TYPE}"
- name: POSTGRESQL_USERNAME
valueFrom:
secretKeyRef:
name: "${SURVEY_NAME}limesurvey-postgresql"
key: database-user
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
name: "${SURVEY_NAME}limesurvey-postgresql"
key: database-password
- name: POSTGRESQL_DB_NAME
valueFrom:
secretKeyRef:
name: "${SURVEY_NAME}limesurvey-postgresql"
key: database-name
- name: POSTGRESQL_DB_HOST
value: "${SURVEY_NAME}limesurvey-postgresql"
- name: POSTGRESQL_PORT
value: "5432"
resources:
limits:
cpu: "${CPU_LIMIT}"
memory: "${MEMORY_LIMIT}"
requests:
cpu: "${CPU_REQUEST}"
memory: "${MEMORY_REQUEST}"
volumeMounts:
- name: "${SURVEY_NAME}limesurvey-app-upload"
mountPath: "/var/www/html/upload"
- name: "${SURVEY_NAME}limesurvey-app-config"
mountPath: "/var/www/html/config"
- name: "${SURVEY_NAME}limesurvey-app-plugins"
mountPath: "/var/www/html/plugins"
livenessProbe:
httpGet:
path: "/"
port: 8080
scheme: HTTP
initialDelaySeconds: 60
timeoutSeconds: 5
periodSeconds: 30
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: "/"
port: 8080
scheme: HTTP
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 30
successThreshold: 1
failureThreshold: 10
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: File
imagePullPolicy: Always
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
- apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: "${SURVEY_NAME}limesurvey-app"
labels:
app: "${SURVEY_NAME}limesurvey"
spec:
maxReplicas: "${{REPLICA_MAX}}"
minReplicas: "${{REPLICA_MIN}}"
scaleTargetRef:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
name: "${SURVEY_NAME}limesurvey-app"
targetCPUUtilizationPercentage: 95
- kind: Service
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-app"
labels:
app: "${SURVEY_NAME}limesurvey"
annotations:
description: Exposes and load balances the application pods
spec:
ports:
- name: web
protocol: TCP
port: 8080
targetPort: 8080
selector:
app: "${SURVEY_NAME}limesurvey"
deploymentconfig: "${SURVEY_NAME}limesurvey-app"
type: ClusterIP
sessionAffinity: None
status:
loadBalancer: {}
- kind: Route
apiVersion: v1
metadata:
name: "${SURVEY_NAME}limesurvey-app"
creationTimestamp:
labels:
app: "${SURVEY_NAME}limesurvey"
spec:
host: "${SURVEY_NAME}limesurvey.apps.silver.devops.gov.bc.ca"
to:
kind: Service
name: "${SURVEY_NAME}limesurvey-app"
weight: 100
port:
targetPort: web
tls:
termination: edge
wildcardPolicy: None