-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkapua-template.yaml
709 lines (708 loc) · 18 KB
/
kapua-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
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
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
apiVersion: v1
kind: Template
metadata:
annotations:
description: >-
A template for KAPUA server.
Modular IoT cloud platform to manage and integrate devices and their data.
A solid integrated foundation of IoT services for any IoT application.
.
see https://www.eclipse.org/kapua/
iconClass: icon-redis
openshift.io/display-name: 'KAPUA'
tags: 'iot,amq,IOT'
version: 0.1.0
name: kapua-template
parameters:
- name: ELASTIC_SEARCH_MEMORY
displayName: ElasticSearch Memory
descrption: The minimum and maximun Java heap space for Elasticsearch
value: '512m'
- name: ELASTIC_SEARCH_VOLUME_SIZE
displayName: ElasticSearch Volume Capacity
description: The size for the ElasicSearch Volume
value: 10Gi
- name: KAPUA_BROKER_VOLUME_SIZE
displayName: KAPUA Broker Volume Capacity
description: The size for the KAPUA Broker Volume
value: 5Gi
- name: KAPUA_SQL_VOLUME_SIZE
displayName: KAPUA SQL Volume Capacity
description: The size for the KAPUA SQL Volume
value: 1Gi
objects:
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: elasticsearch
pod: elasticsearch
name: elasticsearch
spec:
replicas: 1
selector:
app: elasticsearch
deploymentconfig: elasticsearch
pod: elasticsearch
strategy:
activeDeadlineSeconds: 21600
recreateParams:
timeoutSeconds: 600
resources: {}
type: Recreate
template:
metadata:
labels:
app: elasticsearch
deploymentconfig: elasticsearch
pod: elasticsearch
spec:
containers:
- command:
- elasticsearch
- -Etransport.host=_site_
- -Ecluster.name=kapua-datastore
- -Ediscovery.type=single-node
env:
- name: ES_JAVA_OPTS
value: "-Xms${ELASTIC_SEARCH_MEMORY} -Xmx${ELASTIC_SEARCH_MEMORY}"
image: elasticsearch
imagePullPolicy: Always
name: elasticsearch
ports:
- containerPort: 9200
protocol: TCP
- containerPort: 9300
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 9200
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: elasticsearch-storage
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: elasticsearch-storage
persistentVolumeClaim:
claimName: elasticsearch-volume
test: false
triggers:
- imageChangeParams:
automatic: true
containerNames:
- elasticsearch
from:
kind: ImageStreamTag
name: elasticsearch:latest
type: ImageChange
- type: ConfigChange
- apiVersion: v1
kind: DeploymentConfig
metadata:
creationTimestamp: null
labels:
app: kapua
name: kapua-api
spec:
replicas: 1
selector:
app: kapua
deploymentconfig: kapua-api
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: kapua
deploymentconfig: kapua-api
spec:
containers:
- env:
- name: JAVA_OPTS
value: -Xmx1G
-Dcommons.db.connection.host=$KAPUA_SQL_SERVICE_HOST
-Dcommons.db.connection.port=$KAPUA_SQL_PORT_3306_TCP_PORT
-Dcommons.db.schema.update=true
-Dbroker.host=$KAPUA_BROKER_SERVICE_HOST
-Ddatastore.elasticsearch.nodes=$ELASTICSEARCH_PORT_9200_TCP_ADDR
-javaagent:/jolokia-jvm-agent.jar=port=8778,protocol=https,caCert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt,clientPrincipal=cn=system:master-proxy,useSslClientAuthentication=true,extraClientCheck=true,host=0.0.0.0,discoveryEnabled=false,user=jolokia,password=kf5bPHhJ3r4lvNE
image: kapua/kapua-api@sha256:1557099940edf68f87ab2c0d0bcc76fe19a9532e13b9f2fcd139f10c9f3ea61f
imagePullPolicy: Always
name: kapua-api
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8778
protocol: TCP
name: jolokia
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 8080
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- kapua-api
from:
kind: ImageStreamTag
name: kapua-api:latest
type: ImageChange
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: kapua
pod: kapua-broker
name: kapua-broker
spec:
replicas: 1
selector:
app: kapua
deploymentconfig: kapua-broker
pod: kapua-broker
strategy:
activeDeadlineSeconds: 21600
recreateParams:
timeoutSeconds: 600
resources: {}
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
app: kapua
deploymentconfig: kapua-broker
pod: kapua-broker
spec:
containers:
- env:
- name: ACTIVEMQ_OPTS
value: -Dcommons.db.connection.host=$KAPUA_SQL_SERVICE_HOST
-Dcommons.db.connection.port=$KAPUA_SQL_PORT_3306_TCP_PORT
-Dcommons.db.schema.update=true
-Dmetrics.enable.jmx=true
-Ddatastore.elasticsearch.nodes=$ELASTICSEARCH_PORT_9200_TCP_ADDR
-Dcertificate.jwt.private.key=file:///home/kapua/key.pk8
-Dcertificate.jwt.certificate=file:///home/kapua/cert.pem
-javaagent:/jolokia-jvm-agent.jar=port=8778,protocol=https,caCert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt,clientPrincipal=cn=system:master-proxy,useSslClientAuthentication=true,extraClientCheck=true,host=0.0.0.0,discoveryEnabled=false,user=jolokia,password=kf5bPHhJ3r4lvNE
image: kapua/kapua-broker
imagePullPolicy: Always
name: kapua-broker
ports:
- containerPort: 1883
protocol: TCP
- containerPort: 8778
name: jolokia
protocol: TCP
- containerPort: 8883
protocol: TCP
- containerPort: 61614
protocol: TCP
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 1883
timeoutSeconds: 1
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /maven/data
name: kapua-broker-storage
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: kapua-broker-storage
persistentVolumeClaim:
claimName: kapua-broker-volume
test: false
triggers:
- imageChangeParams:
automatic: true
containerNames:
- kapua-broker
from:
kind: ImageStreamTag
name: kapua-broker:latest
type: ImageChange
- type: ConfigChange
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: kapua
pod: kapua-console
name: kapua-console
spec:
replicas: 1
selector:
app: kapua
deploymentconfig: kapua-console
pod: kapua-console
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: kapua
deploymentconfig: kapua-console
pod: kapua-console
spec:
containers:
- env:
- name: JAVA_OPTS
value: -Xmx1G
-Dcommons.db.connection.host=$KAPUA_SQL_SERVICE_HOST
-Dcommons.db.connection.port=$KAPUA_SQL_PORT_3306_TCP_PORT
-Dcommons.db.schema.update=true -Dbroker.host=$KAPUA_BROKER_SERVICE_HOST
-Ddatastore.elasticsearch.nodes=$ELASTICSEARCH_PORT_9200_TCP_ADDR
-Dcertificate.jwt.private.key=file:///home/kapua/key.pk8
-Dcertificate.jwt.certificate=file:///home/kapua/cert.pem
-javaagent:/jolokia-jvm-agent.jar=port=8778,protocol=https,caCert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt,clientPrincipal=cn=system:master-proxy,useSslClientAuthentication=true,extraClientCheck=true,host=0.0.0.0,discoveryEnabled=false,user=jolokia,password=kf5bPHhJ3r4lvNE
envFrom:
image: kapua/kapua-console
imagePullPolicy: Always
name: kapua-console
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8778
protocol: TCP
name: jolokia
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 8080
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- kapua-console
from:
kind: ImageStreamTag
name: kapua-console:latest
type: ImageChange
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: kapua
pod: kapua-sql
name: kapua-sql
spec:
replicas: 1
selector:
app: kapua
deploymentconfig: kapua-sql
pod: kapua-sql
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: kapua
deploymentconfig: kapua-sql
pod: kapua-sql
spec:
containers:
- image: kapua/kapua-sql
imagePullPolicy: Always
name: kapua-sql
ports:
- containerPort: 3306
protocol: TCP
- containerPort: 8181
protocol: TCP
- containerPort: 8778
protocol: TCP
name: jolokia
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 3306
timeoutSeconds: 1
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/h2/data
name: kapua-sql-storage
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: kapua-sql-storage
persistentVolumeClaim:
claimName: kapua-sql-volume
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- kapua-sql
from:
kind: ImageStreamTag
name: kapua-sql:latest
type: ImageChange
- apiVersion: v1
kind: Service
metadata:
labels:
app: elasticsearch
pod: elasticsearch
name: elasticsearch
spec:
ports:
- name: 9200-tcp
port: 9200
protocol: TCP
targetPort: 9200
- name: 9300-tcp
port: 9300
protocol: TCP
targetPort: 9300
selector:
deploymentconfig: elasticsearch
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Service
metadata:
labels:
app: kapua-api
name: kapua-api
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
- name: jolokia
port: 8778
protocol: TCP
targetPort: 8778
selector:
deploymentconfig: kapua-api
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Service
metadata:
labels:
app: kapua
pod: kapua-broker
name: kapua-broker
spec:
ports:
- name: mqtt-tcp
port: 1883
protocol: TCP
targetPort: 1883
- name: jolokia
port: 8778
protocol: TCP
targetPort: 8778
- name: 8883-tcp
port: 8883
protocol: TCP
targetPort: 8883
- name: mqtt-websocket-tcp
port: 61614
protocol: TCP
targetPort: 61614
selector:
deploymentconfig: kapua-broker
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Service
metadata:
labels:
app: kapua
pod: kapua-console
name: kapua-console
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
- name: jolokia
port: 8778
protocol: TCP
targetPort: 8778
selector:
deploymentconfig: kapua-console
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Service
metadata:
labels:
app: kapua
pod: kapua-sql
name: kapua-sql
spec:
ports:
- name: 3306-tcp
port: 3306
protocol: TCP
targetPort: 3306
- name: 8181-tcp
port: 8181
protocol: TCP
targetPort: 8181
- name: jolokia
port: 8778
protocol: TCP
targetPort: 8778
selector:
deploymentconfig: kapua-sql
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Route
metadata:
labels:
app: kapua-api
name: kapua-api
spec:
port:
targetPort: 8080-tcp
to:
kind: Service
name: kapua-api
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: Route
metadata:
labels:
app: kapua
pod: kapua-broker
name: kapua-broker
spec:
port:
targetPort: mqtt-websocket-tcp
to:
kind: Service
name: kapua-broker
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: Route
metadata:
labels:
app: kapua
pod: kapua-console
name: kapua-console
spec:
port:
targetPort: 8080-tcp
to:
kind: Service
name: kapua-console
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: elasticsearch-volume
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "${ELASTIC_SEARCH_VOLUME_SIZE}"
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: kapua-broker-volume
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "${KAPUA_BROKER_VOLUME_SIZE}"
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: kapua-sql-volume
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "${KAPUA_SQL_VOLUME_SIZE}"
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: kapua-api
name: kapua-api
spec:
lookupPolicy:
local: false
tags:
- from:
kind: DockerImage
name: kapua/kapua-api
importPolicy: {}
name: latest
referencePolicy:
type: Source
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: kapua
pod: kapua-broker
name: kapua-broker
spec:
lookupPolicy:
local: false
tags:
- from:
kind: DockerImage
name: kapua/kapua-broker
importPolicy: {}
name: latest
referencePolicy:
type: Source
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: kapua
pod: kapua-console
name: kapua-console
spec:
lookupPolicy:
local: false
tags:
- from:
kind: DockerImage
name: kapua/kapua-console
importPolicy: {}
name: latest
referencePolicy:
type: Source
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: kapua
pod: kapua-sql
name: kapua-sql
spec:
lookupPolicy:
local: false
tags:
- from:
kind: DockerImage
name: kapua/kapua-sql
importPolicy: {}
name: latest
referencePolicy:
type: Source
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: elasticsearch
pod: elasticsearch
name: elasticsearch
spec:
lookupPolicy:
local: false
tags:
- from:
kind: DockerImage
name: elasticsearch
importPolicy: {}
name: latest
referencePolicy:
type: Source