-
Notifications
You must be signed in to change notification settings - Fork 4
/
apache-kafka-no-monitoring-openshift-template.yaml
1020 lines (963 loc) · 45.1 KB
/
apache-kafka-no-monitoring-openshift-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
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##comienzo Template
apiVersion: v1
kind: Template
metadata:
name: kafka-zookeeper-openshift-no-monitoring-mvilche
labels:
template: kafka-zookeeper-openshift-no-monitoring-mvilche
autor: "Martin_Fabrizzio_Vilche"
annotations:
openshift.io/display-name: "kafka-zookeeper-openshift-no-monitoring-mvilche"
iconClass: "icon-github"
description: >-
APACHE KAFKA + ZOOKEEPER + KAFKA MANAGER WEB
Martin Fabrizzio Vilche.
https://github.com/mvilche.
openshift.io/provider-display-name: "Martin Fabrizzio Vilche"
openshift.io/documentation-url: "https://github.com/mvilche/wildfly-s2i.git"
openshift.io/support-url: "https://github.com/mvilche/wildfly-s2i.git"
message: >-
Los servicios iniciarán en un par de minutos...
Martin Fabrizzio Vilche
objects:
############################## ZOOKEPEER
- apiVersion: v1
data:
zoo.cfg: |-
tickTime=2000
dataDir=/opt/zookeeper-data
clientPort=2181
initLimit=5
syncLimit=2
server.1=zookeeper-0.zookeeper.${NAMESPACE}.svc.cluster.local:2888:3888
server.2=zookeeper-1.zookeeper.${NAMESPACE}.svc.cluster.local:2888:3888
server.3=zookeeper-2.zookeeper.${NAMESPACE}.svc.cluster.local:2888:3888
autopurge.snapRetainCount=3
autopurge.purgeInterval=24
log4j.properties: |-
zookeeper.root.logger=INFO, CONSOLE
zookeeper.console.threshold=INFO
zookeeper.log.dir=.
zookeeper.log.file=zookeeper.log
zookeeper.log.threshold=INFO
zookeeper.log.maxfilesize=256MB
zookeeper.log.maxbackupindex=20
zookeeper.tracelog.dir=${zookeeper.log.dir}
zookeeper.tracelog.file=zookeeper_trace.log
log4j.rootLogger=${zookeeper.root.logger}
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.file}
log4j.appender.ROLLINGFILE.MaxFileSize=${zookeeper.log.maxfilesize}
log4j.appender.ROLLINGFILE.MaxBackupIndex=${zookeeper.log.maxbackupindex}
log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
log4j.appender.TRACEFILE=org.apache.log4j.FileAppender
log4j.appender.TRACEFILE.Threshold=TRACE
log4j.appender.TRACEFILE.File=${zookeeper.tracelog.dir}/${zookeeper.tracelog.file}
log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L][%x] - %m%n
kind: ConfigMap
metadata:
name: zookeeper
- apiVersion: v1
kind: Service
metadata:
name: zookeeper
labels:
app: kafka-zookeeper-kafkamanager
spec:
ports:
- port: 2888
name: server
- port: 3888
name: leader-election
- port: 2181
name: client
- port: 8080
name: http
clusterIP: None
selector:
service: zookeeper
- apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: zookeeper
spec:
selector:
matchLabels:
app: kafka-zookeeper-kafkamanager
podManagementPolicy: Parallel
serviceName: zookeeper
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1500Mi
replicas: 3
template:
metadata:
annotations:
alpha.image.policy.openshift.io/resolve-names: '*'
labels:
app: kafka-zookeeper-kafkamanager
service: zookeeper
spec:
containers:
- env:
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: JVMFLAGS
value: -Dlogging.level=INFO -XX:+PrintFlagsFinal -Djava.awt.headless=true -XX:+UseContainerSupport -XX:MaxRAMPercentage=90.0 -Dfile.encoding=UTF8 -XX:+ExitOnOutOfMemoryError -Djava.net.preferIPv4Stack=true
- name: JAVA_OPTS
value: -Dlogging.level=INFO -XX:+PrintFlagsFinal -Djava.awt.headless=true -XX:+UseContainerSupport -XX:MaxRAMPercentage=90.0 -Dfile.encoding=UTF8 -XX:+ExitOnOutOfMemoryError -Djava.net.preferIPv4Stack=true
name: zookeeper
image: "zookeeper:3.6.0"
imagePullPolicy: Always
command:
- bash
- "-c"
- |
export HOST=`hostname -s`
if [[ $HOST =~ (.*)-([0-9]+)$ ]]; then
NAME=${BASH_REMATCH[1]}
ORD=${BASH_REMATCH[2]}
else
echo "ERROR OBTENIENDO HOSTNAME $HOST"
exit 1
fi
MY_ID=$((ORD+1))
if [ ! -f /opt/zookeeper-data/myid ]; then
echo $MY_ID >> /opt/zookeeper-data/myid
fi
/opt/zookeeper/bin/zkServer.sh start-foreground /opt/zookeeper/conf/zoo.cfg
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1500Mi
ports:
- containerPort: 2181
name: client
- containerPort: 2888
name: server
- containerPort: 3888
name: leader-election
- containerPort: 8080
name: http
volumeMounts:
- name: data
mountPath: /opt/zookeeper-data
- name: configmap
mountPath: /opt/zookeeper/conf
livenessProbe:
exec:
command:
- bash
- "-c"
- |
nc -z -v -w5 127.0.0.1 2181
if [ "$?" == 0 ]; then
exit 0
else
exit 1
fi
initialDelaySeconds: 90
timeoutSeconds: 5
readinessProbe:
exec:
command:
- bash
- "-c"
- |
nc -z -v -w5 127.0.0.1 2181
if [ "$?" == 0 ]; then
exit 0
else
exit 1
fi
initialDelaySeconds: 30
timeoutSeconds: 15
resources:
requests:
cpu: 500m
memory: 128Mi
limits:
cpu: 1
memory: 512Mi
volumes:
- name: configmap
configMap:
name: zookeeper
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi
############################## FIN ZOOKEEPER
##############################KAFKA
- apiVersion: v1
kind: Service
metadata:
name: kafka
labels:
app: kafka-zookeeper-kafkamanager
spec:
ports:
- port: 9092
name: server1
clusterIP: None
selector:
service: kafka
- apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: kafka
spec:
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
app: kafka-zookeeper-kafkamanager
serviceName: kafka
replicas: 3
template:
metadata:
annotations:
alpha.image.policy.openshift.io/resolve-names: '*'
labels:
app: kafka-zookeeper-kafkamanager
service: kafka
spec:
containers:
- env:
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: KAFKA_HEAP_OPTS
value: -Dlogging.level=INFO -XX:+PrintFlagsFinal -Djava.awt.headless=true -XX:+UseContainerSupport -XX:MaxRAMPercentage=90.0 -Dfile.encoding=UTF8 -XX:+ExitOnOutOfMemoryError -Djava.net.preferIPv4Stack=true
- name: JAVA_OPTS
value: -Dlogging.level=INFO -XX:+PrintFlagsFinal -Djava.awt.headless=true -XX:+UseContainerSupport -XX:MaxRAMPercentage=90.0 -Dfile.encoding=UTF8 -XX:+ExitOnOutOfMemoryError -Djava.net.preferIPv4Stack=true
- name: JMX_PORT
value: '9999'
name: kafka
image: "kafka:2.4.1"
imagePullPolicy: Always
command:
- bash
- "-c"
- |
rm -rf /opt/kafka-storage/.lock
/opt/checkZoo zookeeper
/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties --override broker.id=${HOSTNAME##*-} \
--override listeners=PLAINTEXT://:9092 \
--override zookeeper.connect=zookeeper-0.zookeeper.$NAMESPACE.svc.cluster.local:2181,zookeeper-1.zookeeper.$NAMESPACE.svc.cluster.local:2181,zookeeper-2.zookeeper.$NAMESPACE.svc.cluster.local:2181 \
--override log.dirs=/opt/kafka-storage \
--override auto.create.topics.enable=true \
--override auto.leader.rebalance.enable=true \
--override background.threads=10 \
--override compression.type=producer \
--override delete.topic.enable=true \
--override leader.imbalance.check.interval.seconds=300 \
--override leader.imbalance.per.broker.percentage=10 \
--override log.flush.interval.messages=9223372036854775807 \
--override log.flush.offset.checkpoint.interval.ms=60000 \
--override log.flush.scheduler.interval.ms=9223372036854775807 \
--override log.retention.bytes=-1 \
--override log.retention.hours=168 \
--override log.roll.hours=168 \
--override log.roll.jitter.hours=0 \
--override log.segment.bytes=1073741824 \
--override log.segment.delete.delay.ms=60000 \
--override message.max.bytes=1000012 \
--override min.insync.replicas=1 \
--override num.io.threads=8 \
--override num.network.threads=3 \
--override num.recovery.threads.per.data.dir=1 \
--override num.replica.fetchers=1 \
--override offset.metadata.max.bytes=4096 \
--override offsets.commit.required.acks=-1 \
--override offsets.commit.timeout.ms=5000 \
--override offsets.load.buffer.size=5242880 \
--override offsets.retention.check.interval.ms=600000 \
--override offsets.retention.minutes=143200 \
--override offsets.topic.compression.codec=0 \
--override offsets.topic.num.partitions=50 \
--override offsets.topic.replication.factor=3 \
--override offsets.topic.segment.bytes=104857600 \
--override queued.max.requests=500 \
--override quota.consumer.default=9223372036854775807 \
--override quota.producer.default=9223372036854775807 \
--override replica.fetch.min.bytes=1 \
--override replica.fetch.wait.max.ms=500 \
--override replica.high.watermark.checkpoint.interval.ms=5000 \
--override replica.lag.time.max.ms=10000 \
--override replica.socket.receive.buffer.bytes=65536 \
--override replica.socket.timeout.ms=30000 \
--override request.timeout.ms=30000 \
--override socket.receive.buffer.bytes=102400 \
--override socket.request.max.bytes=104857600 \
--override socket.send.buffer.bytes=102400 \
--override unclean.leader.election.enable=true \
--override zookeeper.session.timeout.ms=6000 \
--override zookeeper.set.acl=false \
--override broker.id.generation.enable=true \
--override connections.max.idle.ms=600000 \
--override controlled.shutdown.enable=false \
--override controlled.shutdown.max.retries=3 \
--override controlled.shutdown.retry.backoff.ms=5000 \
--override controller.socket.timeout.ms=30000 \
--override default.replication.factor=1 \
--override fetch.purgatory.purge.interval.requests=1000 \
--override group.max.session.timeout.ms=300000 \
--override group.min.session.timeout.ms=6000 \
--override log.cleaner.backoff.ms=15000 \
--override log.cleaner.dedupe.buffer.size=134217728 \
--override log.cleaner.delete.retention.ms=86400000 \
--override log.cleaner.enable=true \
--override log.cleaner.io.buffer.load.factor=0.9 \
--override log.cleaner.io.buffer.size=524288 \
--override log.cleaner.io.max.bytes.per.second=1.7976931348623157E308 \
--override log.cleaner.min.cleanable.ratio=0.5 \
--override log.cleaner.min.compaction.lag.ms=0 \
--override log.cleaner.threads=1 \
--override log.cleanup.policy=delete \
--override log.index.interval.bytes=4096 \
--override log.index.size.max.bytes=10485760 \
--override log.message.timestamp.difference.max.ms=9223372036854775807 \
--override log.message.timestamp.type=CreateTime \
--override log.preallocate=false \
--override log.retention.check.interval.ms=300000 \
--override max.connections.per.ip=2147483647 \
--override num.partitions=1 \
--override producer.purgatory.purge.interval.requests=1000 \
--override replica.fetch.backoff.ms=1000 \
--override replica.fetch.max.bytes=1048576 \
--override replica.fetch.response.max.bytes=10485760 \
--override reserved.broker.max.id=1000
livenessProbe:
exec:
command:
- bash
- "-c"
- |
JMX_PORT= /opt/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --list > /dev/null 2>&1
if [[ $? -eq 0 ]]; then
echo -e "\033[32mKafka server is running, :-)\033[0m"
exit 0
else
echo -e "\033[31mKafka server is not running, :-(\033[0m"
exit 1
fi
initialDelaySeconds: 60
timeoutSeconds: 5
readinessProbe:
exec:
command:
- bash
- "-c"
- |
nc -z -v -w5 127.0.0.1 9092
if [ "$?" == 0 ]; then
exit 0
else
exit 1
fi
initialDelaySeconds: 90
timeoutSeconds: 5
resources:
requests:
cpu: 500m
memory: 300Mi
limits:
cpu: 1000m
memory: 1000Mi
ports:
- containerPort: 9092
name: server1
volumeMounts:
- name: data
mountPath: /opt/kafka-storage
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi
#####################FIN KAFKA
###################BUILDCONFIGS
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: kafka-zookeeper-kafkamanager
build: kafka
name: kafka
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: 'kafka:2.4.1'
postCommit: {}
resources: {}
runPolicy: Serial
source:
contextDir: kafka
git:
ref: production
uri: 'https://github.com/mvilche/apache-kafka-openshift.git'
type: Git
strategy:
dockerStrategy:
dockerfilePath: Dockerfile
type: Docker
successfulBuildsHistoryLimit: 5
triggers:
- type: ConfigChange
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: kafka-zookeeper-kafkamanager
name: kafka
tag: 2.4.1
spec:
lookupPolicy:
local: true
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: kafka-zookeeper-kafkamanager
build: zookeeper
name: zookeeper
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: 'zookeeper:3.6.0'
postCommit: {}
resources: {}
runPolicy: Serial
source:
contextDir: zookeeper
git:
ref: production
uri: 'https://github.com/mvilche/apache-kafka-openshift.git'
type: Git
strategy:
dockerStrategy:
dockerfilePath: Dockerfile
type: Docker
successfulBuildsHistoryLimit: 5
triggers:
- type: ConfigChange
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: kafka-zookeeper-kafkamanager
name: zookeeper
tag: 3.6.0
spec:
lookupPolicy:
local: true
########################
##################### KAFKA MANAGER
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: kafka-zookeeper-kafkamanager
name: "kafka-manager"
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app: kafka-zookeeper-kafkamanager
deploymentconfig: kafka-manager
strategy:
activeDeadlineSeconds: 21600
resources:
requests:
cpu: 200m
memory: 200Mi
limits:
cpu: 1000m
memory: 1000Mi
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: kafka-zookeeper-kafkamanager
deploymentconfig: kafka-manager
spec:
containers:
- initContainers:
- name: wait-zookeeper
image: kafka:2.4.1
command: ['bash', '-c', 'until nc -z -v -w5 zookeeper-0.zookeeper.${NAMESPACE}.svc.cluster.local:2181 2181; do echo waiting for zookeeper; sleep 5; done;']
env:
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: JAVA_OPTS
value: -Dlogging.level=INFO -Djava.awt.headless=true -XX:MaxRAMFraction=1 -Dfile.encoding=UTF8 -XX:+ExitOnOutOfMemoryError -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.net.preferIPv4Stack=true
image: "kafka-manager:latest"
imagePullPolicy: Always
name: kafka-manager
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 60
periodSeconds: 20
successThreshold: 1
httpGet:
port: 9000
path: /
timeoutSeconds: 15
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 60
periodSeconds: 20
successThreshold: 1
httpGet:
port: 9000
path: /
timeoutSeconds: 15
resources:
requests:
cpu: 250m
memory: 200Mi
limits:
cpu: 1000m
memory: 800Mi
ports:
- containerPort: 9000
protocol: TCP
lifecycle:
postStart:
exec:
command:
- bash
- "-c"
- |
OK=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:9000/)
while [ $OK != 200 ]; do
echo "aun no activo"
let OK=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:9000/)
done
curl -d "name=openshift&zkHosts=zookeeper-0.zookeeper.${NAMESPACE}.svc.cluster.local%3A2181%2Czookeeper-1.zookeeper.${NAMESPACE}.svc.cluster.local%3A2181%2Czookeeper-2.zookeeper.${NAMESPACE}.svc.cluster.local%3A2181&kafkaVersion=2.2.0&jmxEnabled=true&jmxUser=&jmxPass=&tuning.brokerViewUpdatePeriodSeconds=30&tuning.clusterManagerThreadPoolSize=2&tuning.clusterManagerThreadPoolQueueSize=100&tuning.kafkaCommandThreadPoolSize=2&tuning.kafkaCommandThreadPoolQueueSize=100&tuning.logkafkaCommandThreadPoolSize=2&tuning.logkafkaCommandThreadPoolQueueSize=100&tuning.logkafkaUpdatePeriodSeconds=30&tuning.partitionOffsetCacheTimeoutSecs=5&tuning.brokerViewThreadPoolSize=3&tuning.brokerViewThreadPoolQueueSize=1000&tuning.offsetCacheThreadPoolSize=3&tuning.offsetCacheThreadPoolQueueSize=1000&tuning.kafkaAdminClientThreadPoolSize=3&tuning.kafkaAdminClientThreadPoolQueueSize=1000&tuning.kafkaManagedOffsetMetadataCheckMillis=30000&tuning.kafkaManagedOffsetGroupCacheSize=1000000&tuning.kafkaManagedOffsetGroupExpireDays=7&securityProtocol=PLAINTEXT&saslMechanism=DEFAULT&jaasConfig=" -X POST http://localhost:9000/clusters || exit 0
volumeMounts:
- name: kafka-manager
mountPath: /opt/kafka-manager-2.0.0.2/conf
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
volumes:
- name: kafka-manager
configMap:
name: kafka-manager
restartPolicy: Always
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- kafka-manager
from:
kind: ImageStreamTag
name: "kafka-manager:latest"
type: ImageChange
- apiVersion: v1
kind: Service
metadata:
labels:
app: kafka-zookeeper-kafkamanager
name: kafka-manager
spec:
ports:
- name: http
port: 9000
protocol: TCP
targetPort: 9000
selector:
app: kafka-zookeeper-kafkamanager
deploymentconfig: kafka-manager
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Route
metadata:
labels:
app: kafka-zookeeper-kafkamanager
name: kafka-manager-http
spec:
port:
targetPort: http
to:
kind: Service
name: kafka-manager
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: kafka-zookeeper-kafkamanager
build: kafka-manager-sbt
name: kafka-manager-sbt
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: 'kafka-manager-sbt:latest'
postCommit: {}
resources: {}
runPolicy: Serial
source:
contextDir: kafka-manager
git:
ref: production
uri: 'https://github.com/mvilche/apache-kafka-openshift.git'
type: Git
strategy:
dockerStrategy:
dockerfilePath: Dockerfile
type: Docker
successfulBuildsHistoryLimit: 5
triggers:
- type: ConfigChange
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: kafka-zookeeper-kafkamanager
name: kafka-manager-sbt
spec:
lookupPolicy:
local: true
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: kafka-zookeeper-kafkamanager
name: kafka-manager
spec:
completionDeadlineSeconds: 1800
output:
to:
kind: ImageStreamTag
name: kafka-manager:latest
source:
type: Dockerfile
dockerfile: |-
FROM alpine:3.10
USER root
RUN apk add --update --no-cache shadow busybox-suid openjdk8 bash curl && mkdir -p /opt
COPY kafka-manager-2.0.0.2 /opt/kafka-manager-2.0.0.2
RUN adduser -u 1001 -D -h /opt/kafka-manager-2.0.0.2 app && usermod -aG 0 app && \
chown 1001:0 -R /opt && \
chgrp -R 0 /opt && \
chmod +x /opt/kafka-manager-2.0.0.2/bin/* && \
chmod -R g=u /opt
USER 1001
ENV HOME /opt/kafka-manager-2.0.0.2
CMD ["/opt/kafka-manager-2.0.0.2/bin/kafka-manager", "-Dconfig.file=/opt/kafka-manager-2.0.0.2/conf/application.conf", "-Dapplication.home=/opt/kafka-manager-2.0.0.2"]
images:
- from:
kind: ImageStreamTag
name: kafka-manager-sbt:latest
paths:
- sourcePath: /opt/kafka-manager/target/universal/kafka-manager-2.0.0.2
destinationDir: "."
strategy:
type: Docker
triggers:
- type: "imageChange"
imageChange:
from:
kind: "ImageStreamTag"
name: "kafka-manager-sbt:latest"
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: kafka-zookeeper-kafkamanager
name: kafka-manager
spec:
lookupPolicy:
local: true
- apiVersion: v1
data:
routes: |-
# Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
# See accompanying LICENSE file.
#
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# Home page
GET / controllers.Application.index
GET /clusters/:c controllers.Cluster.cluster(c:String)
GET /clusters/:c/topics controllers.Topic.topics(c:String)
GET /clusters/:c/topics/addPartitions controllers.Topic.addPartitionsToMultipleTopics(c:String)
POST /clusters/:c/topics/addPartitions controllers.Topic.handleAddPartitionsToMultipleTopics(c:String)
GET /clusters/:c/topics/:t controllers.Topic.topic(c:String, t:String, force:Boolean ?= false)
GET /clusters/:c/logkafkas controllers.Logkafka.logkafkas(c:String)
GET /clusters/:c/logkafkas/:h/:l controllers.Logkafka.logkafka(c:String, h:String, l:String)
GET /clusters/:c/brokers controllers.Cluster.brokers(c: String)
GET /clusters/:c/brokers/:b controllers.Cluster.broker(c: String, b:Int)
GET /clusters/:c/consumers controllers.Consumer.consumers(c: String)
GET /clusters/:c/consumers/:g/type/:ct controllers.Consumer.consumer(c: String, g:String, ct: String)
GET /clusters/:c/consumers/:g/topic/:t/type/:ct controllers.Consumer.consumerAndTopic(c: String, g:String, t:String, ct: String)
GET /clusters/:c/leader controllers.PreferredReplicaElection.preferredReplicaElection(c:String)
POST /clusters/:c/leader controllers.PreferredReplicaElection.handleRunElection(c:String)
GET /clusters/:c/assignment controllers.ReassignPartitions.reassignPartitions(c:String)
POST /clusters/:c/assignment controllers.ReassignPartitions.handleOperation(c:String,t:String)
GET /clusters/:c/assignment/confirm controllers.ReassignPartitions.confirmAssignment(c:String,t:String)
POST /clusters/:c/assignment/generate controllers.ReassignPartitions.handleGenerateAssignment(c:String,t:String)
GET /clusters/:c/assignments/confirm controllers.ReassignPartitions.confirmMultipleAssignments(c:String)
POST /clusters/:c/assignments/generate controllers.ReassignPartitions.handleGenerateMultipleAssignments(c:String)
#GET /clusters/:c/assignments/manual controllers.ReassignPartitions.manualMultipleAssignments(c:String)
#POST /clusters/:c/assignments/manual controllers.ReassignPartitions.handleManualAssignment(c:String)
GET /clusters/:c/assignments/run controllers.ReassignPartitions.runMultipleAssignments(c:String)
POST /clusters/:c/assignments/run controllers.ReassignPartitions.handleRunMultipleAssignments(c:String)
GET /addCluster controllers.Cluster.addCluster
GET /updateCluster controllers.Cluster.updateCluster(c: String)
POST /clusters controllers.Cluster.handleAddCluster
POST /clusters/:c controllers.Cluster.handleUpdateCluster(c:String)
GET /clusters/:c/createTopic controllers.Topic.createTopic(c:String)
POST /clusters/:c/topics/create controllers.Topic.handleCreateTopic(c:String)
GET /clusters/:c/topics/:t/confirm_delete controllers.Topic.confirmDeleteTopic(c:String,t:String)
POST /clusters/:c/topics/delete controllers.Topic.handleDeleteTopic(c:String,t:String)
GET /clusters/:c/topics/:t/addPartitions controllers.Topic.addPartitions(c:String,t:String)
POST /clusters/:c/topics/:t/addPartitions controllers.Topic.handleAddPartitions(c:String,t:String)
GET /clusters/:c/topics/:t/updateConfig controllers.Topic.updateConfig(c:String,t:String)
POST /clusters/:c/topics/:t/updateConfig controllers.Topic.handleUpdateConfig(c:String,t: String)
GET /clusters/:c/topics/:t/assignments/manual controllers.ReassignPartitions.manualAssignments(c:String, t:String)
POST /clusters/:c/topics/:t/assignments/manual controllers.ReassignPartitions.handleManualAssignment(c:String, t: String)
GET /clusters/:c/createLogkafka controllers.Logkafka.createLogkafka(c:String)
POST /clusters/:c/logkafkas/create controllers.Logkafka.handleCreateLogkafka(c:String)
POST /clusters/:c/logkafkas/delete controllers.Logkafka.handleDeleteLogkafka(c:String, h:String, l:String)
GET /clusters/:c/logkafkas/:h/:l/updateConfig controllers.Logkafka.updateConfig(c:String, h:String, l:String)
POST /clusters/:c/logkafkas/:h/:l/updateConfig controllers.Logkafka.handleUpdateConfig(c:String, h:String, l:String)
POST /clusters/:c/logkafkas/:h/:l/disableConfig controllers.Logkafka.handleDisableConfig(c:String, h:String, l:String)
POST /clusters/:c/logkafkas/:h/:l/enableConfig controllers.Logkafka.handleEnableConfig(c:String, h:String, l:String)
GET /api/status/:c/brokers controllers.api.KafkaStateCheck.brokers(c:String)
GET /api/status/:c/brokers/extended controllers.api.KafkaStateCheck.brokersExtended(c:String)
GET /api/status/:c/topics controllers.api.KafkaStateCheck.topics(c:String)
GET /api/status/:c/topicIdentities controllers.api.KafkaStateCheck.topicIdentities(c:String)
GET /api/status/clusters controllers.api.KafkaStateCheck.clusters
GET /api/status/:c/:t/underReplicatedPartitions controllers.api.KafkaStateCheck.underReplicatedPartitions(c:String,t:String)
GET /api/status/:c/:t/unavailablePartitions controllers.api.KafkaStateCheck.unavailablePartitions(c:String,t:String)
GET /api/status/:cluster/:consumer/:topic/:consumerType/topicSummary controllers.api.KafkaStateCheck.topicSummaryAction(cluster:String, consumer:String, topic:String, consumerType:String)
GET /api/status/:cluster/:consumer/:consumerType/groupSummary controllers.api.KafkaStateCheck.groupSummaryAction(cluster:String, consumer:String, consumerType:String)
GET /api/status/:cluster/consumersSummary controllers.api.KafkaStateCheck.consumersSummaryAction(cluster:String)
# Versioned Assets
GET /vassets/*file controllers.Assets.versioned(path="/public", file: Asset)
# Unversioned Assets
GET /assets/*file controllers.Assets.at(path="/public", file)
# Ping / Health Check
GET /api/health controllers.ApiHealth.ping
logger.xml: |-
<configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${application.home}/logs/application.log</file>
<encoder>
<pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${application.home}/logs/application.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>5</maxHistory>
<totalSizeCap>5GB</totalSizeCap>
</rollingPolicy>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date - [%level] %logger{15} - %message%n%xException{10}</pattern>
</encoder>
</appender>
<appender name="ASYNCFILE" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE" />
</appender>
<appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="STDOUT" />
</appender>
<logger name="play" level="INFO" />
<logger name="application" level="INFO" />
<logger name="kafka.manager" level="INFO" />
<!-- Off these ones as they are annoying, and anyway we manage configuration ourself -->
<logger name="com.avaje.ebean.config.PropertyMapLoader" level="OFF" />
<logger name="com.avaje.ebeaninternal.server.core.XmlConfigLoader" level="OFF" />
<logger name="com.avaje.ebeaninternal.server.lib.BackgroundThread" level="OFF" />
<logger name="com.gargoylesoftware.htmlunit.javascript" level="OFF" />
<logger name="org.apache.zookeeper" level="INFO"/>
<root level="WARN">
<appender-ref ref="ASYNCFILE" />
<appender-ref ref="ASYNCSTDOUT" />
</root>
</configuration>
/kafka-manager/target/universal/kafka-manager-2.0.0.2/conf # ^C
/kafka-manager/target/universal/kafka-manager-2.0.0.2/conf # ls
application.conf consumer.properties logback.xml logger.xml routes
/kafka-manager/target/universal/kafka-manager-2.0.0.2/conf # cat logger.xml
<configuration>
<conversionRule conversionWord="coloredLevel" converterClass="play.api.Logger$ColoredLevel" />
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${application.home}/logs/application.log</file>
<encoder>
<pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${application.home}/logs/application.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>5</maxHistory>
<totalSizeCap>5GB</totalSizeCap>
</rollingPolicy>
</appender>
<logger name="play" level="INFO" />
<logger name="application" level="DEBUG" />
<!-- Off these ones as they are annoying, and anyway we manage configuration ourself -->
<logger name="com.avaje.ebean.config.PropertyMapLoader" level="OFF" />
<logger name="com.avaje.ebeaninternal.server.core.XmlConfigLoader" level="OFF" />
<logger name="com.avaje.ebeaninternal.server.lib.BackgroundThread" level="OFF" />
<logger name="com.gargoylesoftware.htmlunit.javascript" level="OFF" />
<logger name="org.apache.zookeeper" level="INFO"/>
<logger name="akka" level="INFO" />
<logger name="kafka" level="INFO" />
<root level="INFO">
<appender-ref ref="FILE" />
</root>
</configuration>
logback.xml: |-
<configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${application.home}/logs/application.log</file>
<encoder>
<pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${application.home}/logs/application.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>5</maxHistory>
<totalSizeCap>5GB</totalSizeCap>
</rollingPolicy>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date - [%level] %logger{15} - %message%n%xException{10}</pattern>
</encoder>
</appender>
<appender name="ASYNCFILE" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE" />
</appender>
<appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="STDOUT" />
</appender>
<logger name="play" level="INFO" />
<logger name="application" level="INFO" />
<logger name="kafka.manager" level="INFO" />
<!-- Off these ones as they are annoying, and anyway we manage configuration ourself -->
<logger name="com.avaje.ebean.config.PropertyMapLoader" level="OFF" />
<logger name="com.avaje.ebeaninternal.server.core.XmlConfigLoader" level="OFF" />
<logger name="com.avaje.ebeaninternal.server.lib.BackgroundThread" level="OFF" />
<logger name="com.gargoylesoftware.htmlunit.javascript" level="OFF" />
<logger name="org.apache.zookeeper" level="INFO"/>
<root level="WARN">
<appender-ref ref="ASYNCFILE" />
<appender-ref ref="ASYNCSTDOUT" />
</root>
</configuration>
consumer.properties: |-
security.protocol=PLAINTEXT
key.deserializer=org.apache.kafka.common.serialization.ByteArrayDeserializer
value.deserializer=org.apache.kafka.common.serialization.ByteArrayDeserializer
application.conf: |-
play.crypto.secret="^<csmm5Fx4d=r2HEX8pelM3iBkFVv?k[mc;IZE<_Qoq8EkX_/7@Zt6dP05Pzea3U"
play.crypto.secret=${?APPLICATION_SECRET}
play.http.session.maxAge="1h"
play.i18n.langs=["en"]
play.http.requestHandler = "play.http.DefaultHttpRequestHandler"
play.http.context = "/"
play.application.loader=loader.KafkaManagerLoader
kafka-manager.zkhosts="zookeeper-0.zookeeper.${NAMESPACE}.svc.cluster.local:2181,zookeeper-1.zookeeper.${NAMESPACE}.svc.cluster.local:2181,zookeeper-2.zookeeper.${NAMESPACE}.svc.cluster.local:2181"
kafka-manager.zkhosts=${?ZK_HOSTS}
pinned-dispatcher.type="PinnedDispatcher"
pinned-dispatcher.executor="thread-pool-executor"
application.features=["KMClusterManagerFeature","KMTopicManagerFeature","KMPreferredReplicaElectionFeature","KMReassignPartitionsFeature"]
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
loglevel = "INFO"
}
akka.logger-startup-timeout = 60s
basicAuthentication.enabled=false
basicAuthentication.enabled=${?KAFKA_MANAGER_AUTH_ENABLED}
basicAuthentication.ldap.enabled=false
basicAuthentication.ldap.enabled=${?KAFKA_MANAGER_LDAP_ENABLED}
basicAuthentication.ldap.server=""
basicAuthentication.ldap.server=${?KAFKA_MANAGER_LDAP_SERVER}
basicAuthentication.ldap.port=389
basicAuthentication.ldap.port=${?KAFKA_MANAGER_LDAP_PORT}
basicAuthentication.ldap.username=""
basicAuthentication.ldap.username=${?KAFKA_MANAGER_LDAP_USERNAME}
basicAuthentication.ldap.password=""
basicAuthentication.ldap.password=${?KAFKA_MANAGER_LDAP_PASSWORD}
basicAuthentication.ldap.search-base-dn=""
basicAuthentication.ldap.search-base-dn=${?KAFKA_MANAGER_LDAP_SEARCH_BASE_DN}
basicAuthentication.ldap.search-filter="(uid=$capturedLogin$)"
basicAuthentication.ldap.search-filter=${?KAFKA_MANAGER_LDAP_SEARCH_FILTER}
basicAuthentication.ldap.connection-pool-size=10
basicAuthentication.ldap.connection-pool-size=${?KAFKA_MANAGER_LDAP_CONNECTION_POOL_SIZE}
basicAuthentication.ldap.ssl=false
basicAuthentication.ldap.ssl=${?KAFKA_MANAGER_LDAP_SSL}
basicAuthentication.username="admin"
basicAuthentication.username=${?KAFKA_MANAGER_USERNAME}