Repository navigation
Expand file tree
/
Copy pathupsilon-on-openshift.yaml
More file actions
481 lines (475 loc) · 12.3 KB
/
Copy pathupsilon-on-openshift.yaml
File metadata and controls
481 lines (475 loc) · 12.3 KB
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
---
apiVersion: v1
kind: Template
metadata:
name: upsilon-on-openshift
annotations:
description: "Upsilon Project on OpenShift"
tags: "instant-app"
iconClass: "fa fa-cogs"
parameters:
- name: SYSTEM_ID
description: The Upsilon System ID
value: default
required: true
- name: MYSQL_PASSWORD
displayName: MySQL User Password
generate: expression
from: "[a-zA-Z0-0]{12}"
- name: MYSQL_ROOT_PASSWORD
displayName: MySQL Root Password
generate: expression
from: "[a-zA-Z0-0]{12}"
- name: PASSWORD_SALT
displayName: Password Salt
generate: expression
from: "[a-zA-Z0-0]{12}"
objects:
- apiVersion: v1
kind: Service
metadata:
name: upsilon-web
spec:
ports:
- port: 80
targetPort: 8080
selector:
deploymentconfig: upsilon-web
- apiVersion: v1
kind: Service
metadata:
name: upsilon-drone
spec:
ports:
- port: 4000
targetPort: 4000
selector:
deploymentconfig: upsilon-drone
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: upsilon-drone
spec:
replicas: 1
selector:
deploymentconfig: upsilon-drone
strategy:
type: Recreate
template:
metadata:
labels:
deploymentconfig: upsilon-drone
spec:
containers:
- image: upsilonproject/drone:latest
name: upsilon-drone
ports:
- containerPort: 4000
protocol: TCP
env:
- name: UPSILON_CONFIG_SYSTEM_AMQPHOST
value: upsilon
- name: UPSILON_IDENTIFIER
value: unnamed-upsilon-drone
livenessProbe:
httpGet:
path: /
port: 4000
scheme: HTTP
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: upsilon-web
spec:
replicas: 1
selector:
deploymentconfig: upsilon-web
strategy:
type: Recreate
template:
metadata:
labels:
deploymentconfig: upsilon-web
spec:
containers:
- image: upsilonproject/web:latest
name: upsilon-web
ports:
- containerPort: 80
protocol: TCP
env:
- name: CFG_DB_DSN
value: "mysql:host=mysql;dbname=upsilon"
- name: CFG_DB_USER
valueFrom:
secretKeyRef:
name: mysql
key: database-user
- name: CFG_DB_PASS
valueFrom:
secretKeyRef:
name: mysql
key: database-password
- name: CFG_PASSWORD_SALT
valueFrom:
secretKeyRef:
name: mysql
key: local-password-salt
livenessProbe:
httpGet:
path: /
port: 8080
scheme: HTTP
initialDelaySeconds: 10
timeoutSeconds: 3
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
volumeMounts:
- mountPath: /etc/upsilon-web/
name: web-cfg
volumes:
- configMap:
defaultMode: 420
name: web
name: web-cfg
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- upsilon-web
from:
kind: ImageStreamTag
name: upsilon-web:latest
type: ImageChange
- apiVersion: v1
kind: ImageStream
metadata:
name: upsilon-drone
spec:
dockerImageRepository: upsilonproject/drone
- apiVersion: v1
kind: Route
metadata:
name: upsilon-drone
spec:
to:
kind: Service
name: upsilon-drone
- apiVersion: v1
kind: ImageStream
metadata:
name: upsilon-web
spec:
dockerImageRepository: upsilonproject/web
- apiVersion: v1
kind: Route
metadata:
name: upsilon-web
labels:
app: upsilon
spec:
to:
kind: Service
name: upsilon-web
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: upsilon-custodian
spec:
replicas: 1
selector:
deploymentconfig: upsilon-custodian
strategy:
type: Recreate
template:
metadata:
labels:
deploymentconfig: upsilon-custodian
spec:
containers:
- image: upsilonproject/custodian:latest
name: upsilon-custodian
volumeMounts:
- mountPath: /etc/upsilon-custodian
name: custodian-cfg
volumes:
- configMap:
defaultMode: 420
name: custodian
name: custodian-cfg
- apiVersion: v1
kind: ImageStream
metadata:
name: upsilon-custodian
spec:
dockerImageRepository: upsilonproject/custodian
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: upsilon-reactor
spec:
replicas: 1
selector:
deploymentconfig: upsilon-reactor
strategy:
type: Recreate
template:
metadata:
labels:
deploymentconfig: upsilon-reactor
spec:
containers:
- image: upsilonproject/reactor:latest
name: upsilon-reactor
volumeMounts:
- mountPath: /etc/upsilon-reactor
name: reactor-cfg
volumes:
- configMap:
defaultMode: 420
name: reactor
name: reactor-cfg
- apiVersion: v1
kind: ImageStream
metadata:
name: upsilon-reactor
spec:
dockerImageRepository: upsilonproject/reactor
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: upsilon-amqp
spec:
replicas: 1
selector:
deploymentconfig: upsilon-amqp
strategy:
type: Recreate
template:
metadata:
labels:
deploymentconfig: upsilon-amqp
spec:
containers:
- image: luiscoms/openshift-rabbitmq:management
name: upsilon-amqp
ports:
- containerPort: 15672
protocol: TCP
- containerPort: 5672
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 15672
scheme: HTTP
initialDelaySeconds: 20
timeoutSeconds: 5
periodSeconds: 10
successThreshold: 1
failureThreshhold: 3
readinessProbe:
httpGet:
path: /
port: 15672
scheme: HTTP
initialDelaySeconds: 20
timeoutSeconds: 5
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
- apiVersion: v1
kind: ImageStream
metadata:
name: upsilon-amqp
spec:
dockerImageRepository: luiscoms/openshift-rabbitmq
- apiVersion: v1
kind: Route
metadata:
name: amqp-mgmt
spec:
to:
kind: Service
name: amqp-mgmt
- apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
ports:
- port: 3306
targetPort: 3306
selector:
deploymentconfig: mysql
- apiVersion: v1
kind: Service
metadata:
name: amqp-mgmt
spec:
ports:
- port: 15672
targetPort: 15672
selector:
deploymentconfig: upsilon-amqp
- apiVersion: v1
kind: Service
metadata:
name: upsilon
spec:
ports:
- port: 5672
targetPort: 5672
selector:
deploymentconfig: upsilon-amqp
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: mysql
spec:
replicas: 1
strategy:
type: Recreate
triggers:
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- mysql
from:
kind: ImageStreamTag
namespace: openshift
name: 'mysql:5.7'
template:
metadata:
labels:
name: mysql
spec:
volumes:
- name: mysql-data
persistentVolumeClaim:
claimName: mysql
containers:
- name: mysql
image: >-
centos/mysql-57-centos7@sha256:54444d4e5c358aeb276b53889a9d714b410364b78fb5ca98791589ba0875762a
ports:
- containerPort: 3306
protocol: TCP
env:
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mysql
key: database-user
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mysql
key: database-password
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql
key: database-root-password
- name: MYSQL_DATABASE
value: upsilon
resources:
limits:
memory: 512Mi
volumeMounts:
- name: mysql-data
mountPath: /var/lib/mysql/data
livenessProbe:
tcpSocket:
port: 3306
initialDelaySeconds: 180
timeoutSeconds: 5
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
readinessProbe:
exec:
command:
- /bin/sh
- '-i'
- '-c'
- >-
MYSQL_PWD="$MYSQL_PASSWORD" mysql -h 127.0.0.1 -u
upsilon -D upsilon -e 'SELECT 1'
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
terminationMessagePath: /dev/termination-log
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
- apiVersion: v1
kind: ConfigMap
metadata:
name: web
data:
config.php: |+
<?php
// The default session save path needs to be set for OpenShift.
session_save_path('/tmp/');
// Run the upsilon-web installer and copy and paste the
// completed config.php below this line;
// ---
?>
- apiVersion: v1
kind: ConfigMap
metadata:
name: reactor
data:
reactor.cfg: |+
[amqp]
host=upsilon
queue=upsilon-reactor-recv
[respond_all_results]
listen=SERVICE_CHECK_RESULT
filter=karma=bad
react=log
- apiVersion: v1
kind: ConfigMap
metadata:
name: custodian
data:
defaults.cfg: |+
[database]
user=upsilon
pass=${MYSQL_PASSWORD}
host=mysql
[amqp]
host=upsilon
exchange=ex_upsilon
queue=custodian
- apiVersion: v1
kind: Secret
metadata:
name: mysql
stringData:
database-user: "upsilon"
database-password: "${MYSQL_PASSWORD}"
database-root-password: "${MYSQL_ROOT_PASSWORD}"
local-password-salt: "${PASSWORD_SALT}"
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql
spec:
resources:
requests:
storage: 1Gi
accessModes:
- "ReadWriteOnce"