forked from confluentinc/cp-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
803 lines (753 loc) · 42.8 KB
/
docker-compose.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
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
version: "2.3"
services:
zookeeper:
#image: confluentinc/cp-zookeeper:5.4.0
image: confluentinc/cp-zookeeper:5.4.0
restart: always
hostname: zookeeper
container_name: zookeeper
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: "2181"
ZOOKEEPER_TICK_TIME: "2000"
KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/zookeeper_jaas.conf
-Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider
-DrequireClientAuthScheme=sasl
volumes:
- ./scripts/security:/etc/kafka/secrets
healthcheck:
test: nc -z localhost 2181
interval: 5s
retries: 5
start_period: 30s
ports:
- "2181:2181"
openldap:
#image: conangoldsmith/cp-demo-ldap
image: rroemhild/test-openldap
hostname: openldap
container_name: openldap
ports:
- "389:389"
privileged: true
command: "bash -c 'apt-get update; apt-get -y install netcat ; /bin/bash /run.sh'"
healthcheck:
test: nc -z localhost 389
interval: 5s
retries: 5
start_period: 30s
kafka1:
image: confluentinc/cp-server:5.4.0
hostname: kafka1
container_name: kafka1
cpus: 0.7
depends_on:
- zookeeper
- openldap
volumes:
- ./conf:/tmp/conf
- ./client-configs:/etc/client-configs
- ./scripts/kafka-registered.sh:/etc/kafka-registered.sh
- ./scripts/security:/etc/kafka/secrets
ports:
- "8090:8090"
- "9091:9091"
- "10091:10091"
- "11091:11091"
healthcheck:
test: nc -z localhost 8090 && nc -z localhost 9091 && /etc/kafka-registered.sh zookeeper:2181
interval: 3s
retries: 15
start_period: 30s
command: "bash -c 'if [ ! -f /etc/kafka/secrets/kafka.kafka1.keystore.jks ]; then echo \"ERROR: Did not find SSL certificates in /etc/kafka/secrets/ (did you remember to run ./scripts/start.sh instead of docker-compose up -d?)\" && exit 1 ; else /etc/confluent/docker/run ; fi'"
environment:
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:SASL_PLAINTEXT,SSL:SSL,OUTSIDE:SASL_SSL
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka1:9091,OUTSIDE://kafka1:10091,SSL://kafka1:11091
KAFKA_SUPER_USERS: User:admin;User:mds;User:professor;User:client;User:schemaregistry;User:restproxy;User:broker;User:connect;User:ANONYMOUS
KAFKA_LOG4J_LOGGERS: "kafka.authorizer.logger=INFO"
KAFKA_LOG4J_ROOT_LOGLEVEL: INFO
# KAFKA_TOOLS_LOG4J_LOGLEVEL: DEBUG
KAFKA_METRIC_REPORTERS: "io.confluent.metrics.reporter.ConfluentMetricsReporter"
KAFKA_BROKER_ID: 1
KAFKA_BROKER_RACK: "r1"
KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN
KAFKA_SASL_ENABLED_MECHANISMS: PLAIN, OAUTHBEARER
KAFKA_LISTENER_NAME_INTERNAL_PLAIN_SASL_JAAS_CONFIG: |
\
org.apache.kafka.common.security.plain.PlainLoginModule required \
username="admin" \
password="admin-secret" \
user_admin="admin-secret" \
user_mds="mds-secret";
# Configure external listener
KAFKA_LISTENER_NAME_OUTSIDE_OAUTHBEARER_SASL_SERVER_CALLBACK_HANDLER_CLASS: io.confluent.kafka.server.plugins.auth.token.TokenBearerValidatorCallbackHandler
KAFKA_LISTENER_NAME_OUTSIDE_OAUTHBEARER_SASL_LOGIN_CALLBACK_HANDLER_CLASS: io.confluent.kafka.server.plugins.auth.token.TokenBearerServerLoginCallbackHandler
KAFKA_LISTENER_NAME_OUTSIDE_OAUTHBEARER_SASL_JAAS_CONFIG: |
\
org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required \
publicKeyPath="/tmp/conf/public.pem";
# KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
# KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 2
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1
CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: "kafka1:9091"
CONFLUENT_METRICS_REPORTER_SECURITY_PROTOCOL: SASL_PLAINTEXT
CONFLUENT_METRICS_REPORTER_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"admin\" \
password=\"admin-secret\";"
CONFLUENT_METRICS_REPORTER_SASL_MECHANISM: PLAIN
CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
CONFLUENT_METRICS_REPORTER_MAX_REQUEST_SIZE: 10485760
# To avoid race condition with control-center
# CONFLUENT_METRICS_REPORTER_TOPIC_CREATE: "false"
CONFLUENT_METRICS_REPORTER_TOPIC_CREATE: "true"
KAFKA_DELETE_TOPIC_ENABLE: "true"
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_JMX_PORT: 9991
KAFKA_SSL_KEYSTORE_FILENAME: kafka.kafka1.keystore.jks
KAFKA_SSL_KEYSTORE_CREDENTIALS: kafka1_keystore_creds
KAFKA_SSL_KEY_CREDENTIALS: kafka1_sslkey_creds
KAFKA_SSL_TRUSTSTORE_FILENAME: kafka.kafka1.truststore.jks
KAFKA_SSL_TRUSTSTORE_CREDENTIALS: kafka1_truststore_creds
KAFKA_ZOOKEEPER_SET_ACL: "true"
# Schema Validation
KAFKA_CONFLUENT_SCHEMA_REGISTRY_URL: http://schemaregistry:8085
KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/broker_jaas.conf
# ======================== CONFIGURE MDS ====================================
# Configure how MDS stores its data in a topic
# supposedly more stuff can be overridden with the same prefix
KAFKA_CONFLUENT_METADATA_TOPIC_REPLICATION_FACTOR: 1
# Configure MDS listener and http server
KAFKA_CONFLUENT_METADATA_SERVER_AUTHENTICATION_METHOD: BEARER
KAFKA_CONFLUENT_METADATA_SERVER_LISTENERS: http://0.0.0.0:8090
KAFKA_CONFLUENT_METADATA_SERVER_ADVERTISED_LISTENERS: http://kafka1:8090
# Configure RBAC token server (authentication)
KAFKA_CONFLUENT_METADATA_SERVER_TOKEN_AUTH_ENABLE: 'true'
KAFKA_CONFLUENT_METADATA_SERVER_TOKEN_MAX_LIFETIME_MS: 3600000
KAFKA_CONFLUENT_METADATA_SERVER_TOKEN_SIGNATURE_ALGORITHM: RS256
KAFKA_CONFLUENT_METADATA_SERVER_TOKEN_KEY_PATH: /tmp/conf/keypair.pem
KAFKA_CONFLUENT_METADATA_SERVER_PUBLIC_KEY_PATH: /tmp/conf/public.pem
# Configure RBAC authorizer
KAFKA_AUTHORIZER_CLASS_NAME: io.confluent.kafka.security.authorizer.ConfluentServerAuthorizer
KAFKA_CONFLUENT_AUTHORIZER_ACCESS_RULE_PROVIDERS: CONFLUENT,ZK_ACL
KAFKA_CONFLUENT_AUTHORIZER_GROUP_PROVIDER: RBAC
# Configure MDS to talk to AD/LDAP
KAFKA_LDAP_JAVA_NAMING_FACTORY_INITIAL: com.sun.jndi.ldap.LdapCtxFactory
KAFKA_LDAP_COM_SUN_JNDI_LDAP_READ_TIMEOUT: 3000
KAFKA_LDAP_JAVA_NAMING_PROVIDER_URL: ldap://openldap:389
# how to authenticate to LDAP
KAFKA_LDAP_JAVA_NAMING_SECURITY_PRINCIPAL: cn=admin,dc=planetexpress,dc=com
KAFKA_LDAP_JAVA_NAMING_SECURITY_CREDENTIALS: GoodNewsEveryone
KAFKA_LDAP_JAVA_NAMING_SECURITY_AUTHENTICATION: simple
# how to locate users and groups
KAFKA_LDAP_SEARCH_MODE: USERS
KAFKA_LDAP_USER_SEARCH_BASE: ou=people,dc=planetexpress,dc=com
KAFKA_LDAP_GROUP_SEARCH_BASE: ou=people,dc=planetexpress,dc=com
KAFKA_LDAP_USER_NAME_ATTRIBUTE: uid
KAFKA_LDAP_USER_OBJECT_CLASS: inetOrgPerson
KAFKA_LDAP_USER_MEMBEROF_ATTRIBUTE: ou
KAFKA_LDAP_GROUP_NAME_ATTRIBUTE: cn
KAFKA_LDAP_GROUP_OBJECT_CLASS: group
# ======================= CONFIGURE METRICS REPORTER =========================
KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
# kafka2:
# image: confluentinc/cp-server:5.4.0
# hostname: kafka2
# container_name: kafka2
# cpus: 0.7
# depends_on:
# - zookeeper
# volumes:
# - ./scripts/security:/etc/kafka/secrets
# ports:
# - "9092:9092"
# - "29092:29092"
# command: "bash -c 'if [ ! -f /etc/kafka/secrets/kafka.kafka2.keystore.jks ]; then echo \"ERROR: Did not find SSL certificates in /etc/kafka/secrets/ (did you remember to run ./scripts/start.sh instead of docker-compose up -d?)\" && exit 1 ; else /etc/confluent/docker/run ; fi'"
# environment:
# KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
# KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: SASL_SSL:SASL_SSL,SSL:SSL,SASL_SSL_HOST:SASL_SSL,PLAINTEXT:PLAINTEXT
# KAFKA_INTER_BROKER_LISTENER_NAME: SASL_SSL
# KAFKA_ADVERTISED_LISTENERS: SASL_SSL://kafka2:9092,SASL_SSL_HOST://localhost:29092,PLAINTEXT://kafka2:10092,SSL://kafka2:11092
# KAFKA_AUTHORIZER_CLASS_NAME: kafka.security.auth.SimpleAclAuthorizer
# KAFKA_SUPER_USERS: User:admin;User:mds;User:professor;User:client;User:schemaregistry;User:restproxy;User:broker;User:connect;User:ANONYMOUS
# KAFKA_LOG4J_LOGGERS: "kafka.authorizer.logger=INFO"
# KAFKA_METRIC_REPORTERS: "io.confluent.metrics.reporter.ConfluentMetricsReporter"
# KAFKA_BROKER_ID: 2
# KAFKA_BROKER_RACK: "r1"
# KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
# KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 2
# CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: "kafka2:9092"
# CONFLUENT_METRICS_REPORTER_SECURITY_PROTOCOL: SASL_SSL
# CONFLUENT_METRICS_REPORTER_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
# username=\"client\" \
# password=\"client-secret\";"
# CONFLUENT_METRICS_REPORTER_SASL_MECHANISM: PLAIN
# CONFLUENT_METRICS_REPORTER_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.client.truststore.jks
# CONFLUENT_METRICS_REPORTER_SSL_TRUSTSTORE_PASSWORD: confluent
# CONFLUENT_METRICS_REPORTER_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.client.keystore.jks
# CONFLUENT_METRICS_REPORTER_SSL_KEYSTORE_PASSWORD: confluent
# CONFLUENT_METRICS_REPORTER_SSL_KEY_PASSWORD: confluent
# CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 2
# CONFLUENT_METRICS_REPORTER_MAX_REQUEST_SIZE: 10485760
# # To avoid race condition with control-center
# CONFLUENT_METRICS_REPORTER_TOPIC_CREATE: "false"
# KAFKA_DELETE_TOPIC_ENABLE: "true"
# KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
# KAFKA_JMX_PORT: 9991
# KAFKA_SASL_ENABLED_MECHANISMS: PLAIN
# KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN
# KAFKA_SSL_KEYSTORE_FILENAME: kafka.kafka2.keystore.jks
# KAFKA_SSL_KEYSTORE_CREDENTIALS: kafka2_keystore_creds
# KAFKA_SSL_KEY_CREDENTIALS: kafka2_sslkey_creds
# KAFKA_SSL_TRUSTSTORE_FILENAME: kafka.kafka2.truststore.jks
# KAFKA_SSL_TRUSTSTORE_CREDENTIALS: kafka2_truststore_creds
# # enables 2-way authentication
# KAFKA_SSL_CLIENT_AUTH: "required"
# KAFKA_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: "HTTPS"
# KAFKA_ZOOKEEPER_SET_ACL: "true"
# # Schema Validation
# KAFKA_CONFLUENT_SCHEMA_REGISTRY_URL: "https://schemaregistry:8085"
# KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/broker_jaas.conf
# -Djavax.net.ssl.trustStore=/etc/kafka/secrets/kafka.kafka2.truststore.jks
# -Djavax.net.ssl.trustStorePassword=confluent
# -Djavax.net.ssl.keyStore=/etc/kafka/secrets/kafka.kafka2.keystore.jks
# -Djavax.net.ssl.keyStorePassword=confluent
connect:
image: confluentinc/cp-server-connect:5.4.0
container_name: connect
cpus: 0.6
restart: always
ports:
- "8083:8083"
depends_on:
- zookeeper
- kafka1
# - kafka2
- schemaregistry
- replicator-for-jar-transfer
volumes:
- ./connect-plugins:/connect-plugins
- mi3:/usr/share/java/kafka-connect-replicator/
- ./connect-plugins/kafka-connect-transform-nullfilter/null-filter-4.0.0-SNAPSHOT.jar:/usr/share/java/kafka-connect-elasticsearch/null-filter-4.0.0-SNAPSHOT.jar
- ./scripts/security:/etc/kafka/secrets
- ./conf:/tmp/conf
- ./connect-source:/tmp/connect-source
- ./connect-sink:/tmp/connect-sink
command: "bash -c 'sleep 10 && \
cp /usr/share/java/kafka-connect-replicator/replicator-rest-extension-*.jar /etc/kafka-connect/jars/ && \
/etc/confluent/docker/run'"
environment:
CUB_CLASSPATH: '/etc/confluent/docker/docker-utils.jar:/usr/share/java/confluent-security/connect/*:/usr/share/java/kafka/*'
# CONNECT_BOOTSTRAP_SERVERS: "kafka1:9091,kafka2:9092"
CONNECT_BOOTSTRAP_SERVERS: "kafka1:10091"
CONNECT_REST_PORT: 8083
CONNECT_LISTENERS: "https://0.0.0.0:8083"
CONNECT_GROUP_ID: "connect"
CONNECT_PRODUCER_CLIENT_ID: "connect-worker-producer"
CONNECT_CONFIG_STORAGE_TOPIC: connect-configs
CONNECT_OFFSET_STORAGE_TOPIC: connect-offsets
CONNECT_STATUS_STORAGE_TOPIC: connect-statuses
# CONNECT_REPLICATION_FACTOR: 2
# CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 2
# CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 2
# CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 2
CONNECT_REPLICATION_FACTOR: 1
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
CONNECT_KEY_CONVERTER: "org.apache.kafka.connect.storage.StringConverter"
CONNECT_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_INTERNAL_KEY_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_INTERNAL_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: "HTTPS"
CONNECT_REST_ADVERTISED_HOST_NAME: "connect"
CONNECT_PLUGIN_PATH: "/usr/share/java,/connect-plugins"
CONNECT_LOG4J_ROOT_LOGLEVEL: INFO
CONNECT_LOG4J_LOGGERS: org.reflections=ERROR
CLASSPATH: /usr/share/java/monitoring-interceptors/monitoring-interceptors-5.4.0-SNAPSHOT.jar
CONNECT_REST_EXTENSION_CLASSES: io.confluent.connect.replicator.monitoring.ReplicatorMonitoringExtension
# Connect worker
CONNECT_SECURITY_PROTOCOL: SASL_SSL
CONNECT_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"client\" \
password=\"client-secret\";"
CONNECT_SASL_MECHANISM: PLAIN
CONNECT_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.truststore.jks
CONNECT_SSL_TRUSTSTORE_PASSWORD: confluent
CONNECT_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.keystore.jks
CONNECT_SSL_KEYSTORE_PASSWORD: confluent
# Connect producer
CONNECT_PRODUCER_SECURITY_PROTOCOL: SASL_SSL
CONNECT_PRODUCER_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"client\" \
password=\"client-secret\";"
CONNECT_PRODUCER_SASL_MECHANISM: PLAIN
CONNECT_PRODUCER_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.truststore.jks
CONNECT_PRODUCER_SSL_TRUSTSTORE_PASSWORD: confluent
CONNECT_PRODUCER_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.keystore.jks
CONNECT_PRODUCER_SSL_KEYSTORE_PASSWORD: confluent
CONNECT_PRODUCER_SSL_KEY_PASSWORD: confluent
CONNECT_PRODUCER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor"
CONNECT_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SECURITY_PROTOCOL: SASL_SSL
CONNECT_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"client\" \
password=\"client-secret\";"
CONNECT_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SASL_MECHANISM: PLAIN
CONNECT_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.truststore.jks
CONNECT_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_TRUSTSTORE_PASSWORD: confluent
CONNECT_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.keystore.jks
CONNECT_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEYSTORE_PASSWORD: confluent
CONNECT_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEY_PASSWORD: confluent
# Connect consumer
CONNECT_CONSUMER_SECURITY_PROTOCOL: SASL_SSL
CONNECT_CONSUMER_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"client\" \
password=\"client-secret\";"
CONNECT_CONSUMER_SASL_MECHANISM: PLAIN
CONNECT_CONSUMER_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.truststore.jks
CONNECT_CONSUMER_SSL_TRUSTSTORE_PASSWORD: confluent
CONNECT_CONSUMER_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.keystore.jks
CONNECT_CONSUMER_SSL_KEYSTORE_PASSWORD: confluent
CONNECT_CONSUMER_SSL_KEY_PASSWORD: confluent
CONNECT_CONSUMER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor"
CONNECT_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SECURITY_PROTOCOL: SASL_SSL
CONNECT_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"client\" \
password=\"client-secret\";"
CONNECT_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SASL_MECHANISM: PLAIN
CONNECT_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.truststore.jks
CONNECT_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_TRUSTSTORE_PASSWORD: confluent
CONNECT_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.keystore.jks
CONNECT_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEYSTORE_PASSWORD: confluent
CONNECT_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEY_PASSWORD: confluent
# KAFKA_OPTS required for ReplicatorMonitoringExtension
KAFKA_OPTS: -Djavax.net.ssl.trustStore=/etc/kafka/secrets/kafka.connect.truststore.jks
-Djavax.net.ssl.trustStorePassword=confluent
-Djavax.net.ssl.keyStore=/etc/kafka/secrets/kafka.connect.keystore.jks
-Djavax.net.ssl.keyStorePassword=confluent
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.0
container_name: elasticsearch
cpus: 0.50
#restart: always
depends_on:
- connect
ports:
- "9200:9200"
- "9300:9300"
environment:
xpack.security.enabled: "false"
discovery.type: "single-node"
ES_JAVA_OPTS: "-Xms1g -Xmx1g"
kibana:
image: docker.elastic.co/kibana/kibana:5.5.2
container_name: kibana
cpus: 0.50
restart: always
depends_on:
- elasticsearch
ports:
- "5601:5601"
environment:
xpack.security.enabled: "false"
control-center:
image: confluentinc/cp-enterprise-control-center:5.4.0
hostname: control-center
container_name: control-center
depends_on:
zookeeper:
condition: service_healthy
kafka1:
condition: service_healthy
ksql-server:
condition: service_healthy
ports:
- "9021:9021"
volumes:
- ./conf:/tmp/conf
- ./scripts/security:/etc/kafka/secrets
healthcheck:
test: nc -z localhost 9021
interval: 3s
retries: 15
start_period: 30s
environment:
# CUB CLASSPATH
CUB_CLASSPATH: '/etc/confluent/docker/docker-utils.jar:/usr/share/java/confluent-control-center/*:/usr/share/java/rest-utils/*:/usr/share/java/confluent-common/*'
# CUB_CLASSPATH: '/etc/confluent/docker/docker-utils.jar:/usr/share/java/confluent-control-center/*'
# general settings
CONTROL_CENTER_BOOTSTRAP_SERVERS: 'kafka1:10091'
CONTROL_CENTER_ZOOKEEPER_CONNECT: 'zookeeper:2181'
CONTROL_CENTER_REPLICATION_FACTOR: 1
CONTROL_CENTER_INTERNAL_TOPICS_PARTITIONS: 1
CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_PARTITIONS: 1
CONFLUENT_METRICS_TOPIC_REPLICATION: 1
PORT: 9021
# ========================= other services ==============================
# connect
CONTROL_CENTER_CONNECT_CONNECT1_CLUSTER: http://connect:8083
# ksql
CONTROL_CENTER_KSQL_KSQL1_URL: http://ksql-server:8088
CONTROL_CENTER_KSQL_KSQL1_ADVERTISED_URL: http://localhost:8088 # access KSQL from the browser
# schema-registry
CONTROL_CENTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
# ========================= RBAC =================================
CONTROL_CENTER_REST_AUTHENTICATION_METHOD: BEARER
PUBLIC_KEY_PATH: /tmp/conf/public.pem
CONFLUENT_METADATA_BASIC_AUTH_USER_INFO: hermes:hermes
CONFLUENT_METADATA_BOOTSTRAP_SERVER_URLS: http://kafka1:8090
CONTROL_CENTER_STREAMS_SECURITY_PROTOCOL: SASL_SSL
# The following configs are not required by C3 itself, but are required by cub to be able to connect to kafka to check if its ready
# Seems like C3 would generate these configs when started, but cub runs before C3 starts, so it doesn't have access to these configs
CONTROL_CENTER_STREAMS_SASL_MECHANISM: OAUTHBEARER
CONTROL_CENTER_STREAMS_SASL_LOGIN_CALLBACK_HANDLER_CLASS: io.confluent.kafka.clients.plugins.auth.token.TokenUserLoginCallbackHandler
CONTROL_CENTER_STREAMS_SASL_JAAS_CONFIG: |
\
org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required \
username="hermes" \
password="hermes" \
metadataServerUrls="http://kafka1:8090";
#CONTROL_CENTER_STREAMS_SASL_MECHANISM: PLAIN
CONTROL_CENTER_STREAMS_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.control-center.truststore.jks
CONTROL_CENTER_STREAMS_SSL_TRUSTSTORE_PASSWORD: confluent
CONTROL_CENTER_STREAMS_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.control-center.keystore.jks
CONTROL_CENTER_STREAMS_SSL_KEYSTORE_PASSWORD: confluent
CONTROL_CENTER_STREAMS_SSL_KEY_PASSWORD: confluent
CONTROL_CENTER_STREAMS_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: "HTTPS"
schemaregistry:
image: confluentinc/cp-schema-registry:5.4.0
container_name: schemaregistry
cpus: 0.4
restart: always
depends_on:
- zookeeper
- kafka1
# - kafka2
ports:
- "8085:8085"
volumes:
- ./scripts/security:/etc/kafka/secrets
- ./conf:/tmp/conf
environment:
CUB_CLASSPATH: '/etc/confluent/docker/docker-utils.jar:/usr/share/java/confluent-security/schema-registry/*:/usr/share/java/schema-registry/*'
# SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: "kafka1:9091,kafka2:9092"
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: "kafka1:10091"
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: "zookeeper:2181"
SCHEMA_REGISTRY_HOST_NAME: schemaregistry
SCHEMA_REGISTRY_LISTENERS: "http://0.0.0.0:8085"
SCHEMA_REGISTRY_KAFKASTORE_SECURITY_PROTOCOL: SASL_SSL
SCHEMA_REGISTRY_KAFKASTORE_SASL_JAAS_CONFIG: |
\
org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required \
username="leela" \
password="leela" \
metadataServerUrls="http://kafka1:8090";
SCHEMA_REGISTRY_KAFKASTORE_SASL_MECHANISM: OAUTHBEARER
SCHEMA_REGISTRY_KAFKASTORE_SASL_LOGIN_CALLBACK_HANDLER_CLASS: io.confluent.kafka.clients.plugins.auth.token.TokenUserLoginCallbackHandler
SCHEMA_REGISTRY_KAFKASTORE_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.schemaregistry.truststore.jks
SCHEMA_REGISTRY_KAFKASTORE_SSL_TRUSTSTORE_PASSWORD: confluent
SCHEMA_REGISTRY_KAFKASTORE_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.schemaregistry.keystore.jks
SCHEMA_REGISTRY_KAFKASTORE_SSL_KEYSTORE_PASSWORD: confluent
SCHEMA_REGISTRY_KAFKASTORE_SSL_KEY_PASSWORD: confluent
SCHEMA_REGISTRY_KAFKASTORE_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: "HTTPS"
SCHEMA_REGISTRY_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.schemaregistry.truststore.jks
SCHEMA_REGISTRY_SSL_TRUSTSTORE_PASSWORD: confluent
SCHEMA_REGISTRY_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.schemaregistry.keystore.jks
SCHEMA_REGISTRY_SSL_KEYSTORE_PASSWORD: confluent
SCHEMA_REGISTRY_SSL_KEY_PASSWORD: confluent
SCHEMA_REGISTRY_SSL_CLIENT_AUTH: "true"
SCHEMA_REGISTRY_SCHEMA_REGISTRY_INTER_INSTANCE_PROTOCOL: "http"
# SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL: DEBUG
SCHEMA_REGISTRY_KAFKASTORE_TOPIC: _schemas
SCHEMA_REGISTRY_DEBUG: 'true'
# ======================= RBAC =================================
SCHEMA_REGISTRY_SCHEMA_REGISTRY_RESOURCE_EXTENSION_CLASS: io.confluent.kafka.schemaregistry.security.SchemaRegistrySecurityResourceExtension
SCHEMA_REGISTRY_CONFLUENT_SCHEMA_REGISTRY_AUTHORIZER_CLASS: io.confluent.kafka.schemaregistry.security.authorizer.rbac.RbacAuthorizer
SCHEMA_REGISTRY_REST_SERVLET_INITIALIZOR_CLASSES: io.confluent.common.security.jetty.initializer.InstallBearerOrBasicSecurityHandler
# how to connect to MDS
SCHEMA_REGISTRY_CONFLUENT_METADATA_BOOTSTRAP_SERVER_URLS: http://kafka1:8090
SCHEMA_REGISTRY_CONFLUENT_METADATA_HTTP_AUTH_CREDENTIALS_PROVIDER: BASIC
SCHEMA_REGISTRY_CONFLUENT_METADATA_BASIC_AUTH_USER_INFO: leela:leela
# public key to verify tokens during authentication
SCHEMA_REGISTRY_PUBLIC_KEY_PATH: /tmp/conf/public.pem
ports:
- 8085:8085
kafka-client:
image: confluentinc/cp-server:5.4.0
hostname: kafka-client
container_name: kafka-client
cpus: 0.4
depends_on:
- kafka1
# - kafka2
volumes:
- ./scripts/security:/etc/kafka/secrets
# We defined a dependency on "kafka", but `depends_on` will NOT wait for the
# dependencies to be "ready" before starting the "kafka-client"
# container; it waits only until the dependencies have started. Hence we
# must control startup order more explicitly.
# See https://docs.docker.com/compose/startup-order/
command: "bash -c -a 'echo Waiting for Kafka to be ready... && \
/etc/confluent/docker/configure && \
cub kafka-ready -b kafka1:10091 1 60 --config /etc/kafka/kafka.properties && \
sleep 5 && \
kafka-topics --zookeeper zookeeper:2181 --topic users --create --replication-factor 1 --partitions 2 --config confluent.value.schema.validation=true && \
kafka-topics --zookeeper zookeeper:2181 --topic wikipedia.parsed --create --replication-factor 1 --partitions 2 --config confluent.value.schema.validation=true && \
kafka-topics --zookeeper zookeeper:2181 --topic wikipedia.parsed.count-by-channel --create --replication-factor 1 --partitions 2 && \
kafka-topics --zookeeper zookeeper:2181 --topic wikipedia.failed --create --replication-factor 1 --partitions 2 && \
kafka-topics --zookeeper zookeeper:2181 --topic WIKIPEDIABOT --create --replication-factor 1 --partitions 2 && \
kafka-topics --zookeeper zookeeper:2181 --topic WIKIPEDIANOBOT --create --replication-factor 1 --partitions 2 && \
kafka-topics --zookeeper zookeeper:2181 --topic EN_WIKIPEDIA_GT_1 --create --replication-factor 1 --partitions 2 && \
kafka-topics --zookeeper zookeeper:2181 --topic EN_WIKIPEDIA_GT_1_COUNTS --create --replication-factor 1 --partitions 2'"
# cub kafka-ready -b kafka2:9092 1 60 --config /etc/kafka/kafka.properties && \
environment:
# The following settings are listed here only to satisfy the image's requirements.
# We override the image's `command` anyways, hence this container will not start a broker.
KAFKA_BROKER_ID: ignored
KAFKA_ZOOKEEPER_CONNECT: ignored
KAFKA_ADVERTISED_LISTENERS: ignored
KAFKA_SECURITY_PROTOCOL: SASL_SSL
KAFKA_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"client\" \
password=\"client-secret\";"
KAFKA_SASL_MECHANISM: PLAIN
KAFKA_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.client.truststore.jks
KAFKA_SSL_TRUSTSTORE_PASSWORD: confluent
KAFKA_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.client.keystore.jks
KAFKA_SSL_KEYSTORE_PASSWORD: confluent
KAFKA_SSL_KEY_PASSWORD: confluent
KAFKA_ZOOKEEPER_SET_ACL: "true"
KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/broker_jaas.conf
ports:
- "7073:7073"
ksql-server:
image: confluentinc/cp-ksql-server:5.4.0
hostname: ksql-server
container_name: ksql-server
cpus: 0.5
restart: always
depends_on:
- kafka1
# - kafka2
- connect
ports:
- "8088:8088"
volumes:
- ./conf:/tmp/conf
- ./scripts/security:/etc/kafka/secrets
healthcheck:
test: nc -z localhost 8088
interval: 3s
retries: 15
start_period: 30s
environment:
CUB_CLASSPATH: '/usr/share/java/ksql-server/*:/usr/share/java/cp-base-new/*'
KSQL_LOG4J_ROOT_LOGLEVEL: TRACE
#KSQL_LOG4J_OPTS: "-Dlog4j.configuration=file:/etc/kafka/secrets/log4j-secure.properties"
KSQL_KSQL_SERVICE_ID: "ksql-cluster"
KSQL_KSQL_LOGGING_PROCESSING_TOPIC_AUTO_CREATE: "true"
KSQL_KSQL_LOGGING_PROCESSING_STREAM_AUTO_CREATE: "true"
# KSQL_BOOTSTRAP_SERVERS: "kafka1:9091,kafka2:9092"
KSQL_BOOTSTRAP_SERVERS: "kafka1:10091"
KSQL_HOST_NAME: ksql-server
KSQL_LISTENERS: "http://0.0.0.0:8088"
KSQL_CACHE_MAX_BYTES_BUFFERING: 0
KSQL_KSQL_SECURITY_EXTENSION_CLASS: io.confluent.ksql.security.KsqlConfluentSecurityExtension
# Enable KSQL OAuth authentication
KSQL_REST_SERVLET_INITIALIZOR_CLASSES: io.confluent.common.security.jetty.initializer.InstallBearerOrBasicSecurityHandler
KSQL_WEBSOCKET_SERVLET_INITIALIZOR_CLASSES: io.confluent.common.security.jetty.initializer.InstallBearerOrBasicSecurityHandler
KSQL_OAUTH_JWT_PUBLIC_KEY_PATH: /tmp/conf/public.pem
KSQL_CONFLUENT_METADATA_PUBLIC_KEY_PATH: /tmp/conf/public.pem
KSQL_PUBLIC_KEY_PATH: /tmp/conf/public.pem
# How to connect to MDS
KSQL_CONFLUENT_METADATA_BOOTSTRAP_SERVER_URLS: http://kafka1:8090
KSQL_CONFLUENT_METADATA_HTTP_AUTH_CREDENTIALS_PROVIDER: BASIC
KSQL_CONFLUENT_METADATA_BASIC_AUTH_CREDENTIALS_PROVIDER: USER_INFO
KSQL_CONFLUENT_METADATA_BASIC_AUTH_USER_INFO: zoidberg:zoidberg
# Credentials for kafka access
KSQL_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.client.truststore.jks
KSQL_SSL_TRUSTSTORE_PASSWORD: confluent
KSQL_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.client.keystore.jks
KSQL_SSL_KEYSTORE_PASSWORD: confluent
KSQL_SSL_KEY_PASSWORD: confluent
KSQL_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: "HTTPS"
KSQL_SECURITY_PROTOCOL: SASL_SSL
KSQL_SASL_MECHANISM: OAUTHBEARER
KSQL_SASL_JAAS_CONFIG: |
\
org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required \
username="zoidberg" \
password="zoidberg" \
metadataServerUrls="http://kafka1:8090";
KSQL_SASL_LOGIN_CALLBACK_HANDLER_CLASS: io.confluent.kafka.clients.plugins.auth.token.TokenUserLoginCallbackHandler
#KSQL_KSQL_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
KSQL_KSQL_SCHEMA_REGISTRY_BASIC_AUTH_CREDENTIALS_SOURCE: USER_INFO
KSQL_KSQL_SCHEMA_REGISTRY_BASIC_AUTH_USER_INFO: zoidberg:zoidberg
# Schema Registry using HTTPS
KSQL_KSQL_SCHEMA_REGISTRY_URL: "http://schemaregistry:8085"
KSQL_KSQL_SCHEMA_REGISTRY_SSL_TRUSTSTORE_LOCATION: "/etc/kafka/secrets/kafka.client.truststore.jks"
KSQL_KSQL_SCHEMA_REGISTRY_SSL_TRUSTSTORE_PASSWORD: "confluent"
KSQL_KSQL_SCHEMA_REGISTRY_SSL_KEYSTORE_LOCATION: "/etc/kafka/secrets/kafka.client.keystore.jks"
KSQL_KSQL_SCHEMA_REGISTRY_SSL_KEYSTORE_PASSWORD: "confluent"
# Confluent Monitoring Interceptors for Control Center streams monitoring
KSQL_PRODUCER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor"
KSQL_CONSUMER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor"
KSQL_CONFLUENT_MONITORING_INTERCEPTOR_SASL_MECHANISM: OAUTHBEARER
KSQL_CONFLUENT_MONITORING_INTERCEPTOR_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.client.truststore.jks
KSQL_CONFLUENT_MONITORING_INTERCEPTOR_SSL_TRUSTSTORE_PASSWORD: confluent
KSQL_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.client.keystore.jks
KSQL_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEYSTORE_PASSWORD: confluent
KSQL_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEY_PASSWORD: confluent
KSQL_CONFLUENT_MONITORING_INTERCEPTOR_SECURITY_PROTOCOL: SASL_SSL
KSQL_CONFLUENT_MONITORING_INTERCEPTOR_SASL_JAAS_CONFIG: |
\
org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required \
username="zoidberg" \
password="zoidberg" \
metadataServerUrls="https://kafka1:8090";
ksql-cli:
image: confluentinc/cp-ksql-cli:5.4.0
container_name: ksql-cli
cpus: 0.4
depends_on:
- kafka1
- connect
- ksql-server
volumes:
- ./scripts/ksql/ksqlcommands:/tmp/ksqlcommands
- ./scripts/ksql/run_ksql_commands.sh:/tmp/run_ksql_commands.sh
entrypoint: /bin/sh
tty: true
restproxy:
image: confluentinc/cp-kafka-rest:5.4.0
restart: always
cpus: 0.4
depends_on:
- zookeeper
- kafka1
# - kafka2
- schemaregistry
hostname: restproxy
container_name: restproxy
volumes:
- ./scripts/security:/etc/kafka/secrets
- ./scripts/app:/etc/kafka/app
- ./conf:/tmp/conf
environment:
KAFKA_REST_HOST_NAME: restproxy
### When changed from SASL to just SSL, this component works
KAFKA_REST_BOOTSTRAP_SERVERS: "SASL_SSL://kafka1:10091"
#
KAFKA_REST_LISTENERS: "https://0.0.0.0:8086"
KAFKA_REST_SCHEMA_REGISTRY_URL: "http://schemaregistry:8085"
#KAFKA_REST_SCHEMA_REGISTRY_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.client.truststore.jks
#KAFKA_REST_SCHEMA_REGISTRY_SSL_TRUSTSTORE_PASSWORD: confluent
#KAFKA_REST_SCHEMA_REGISTRY_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.client.keystore.jks
#KAFKA_REST_SCHEMA_REGISTRY_SSL_KEYSTORE_PASSWORD: confluent
KAFKA_REST_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.restproxy.truststore.jks
KAFKA_REST_SSL_TRUSTSTORE_PASSWORD: confluent
KAFKA_REST_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.restproxy.keystore.jks
KAFKA_REST_SSL_KEYSTORE_PASSWORD: confluent
KAFKA_REST_SSL_KEY_PASSWORD: confluent
KAFKA_REST_SSL_CLIENT_AUTH: "false"
#KAFKA_REST_CLIENT_SECURITY_PROTOCOL: SASL_SSL
KAFKA_REST_CLIENT_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.restproxy.truststore.jks
KAFKA_REST_CLIENT_SSL_TRUSTSTORE_PASSWORD: confluent
KAFKA_REST_CLIENT_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.restproxy.keystore.jks
KAFKA_REST_CLIENT_SSL_KEYSTORE_PASSWORD: confluent
KAFKA_REST_CLIENT_SSL_KEY_PASSWORD: confluent
# zookeeper connnect is for validating trial license
KAFKA_REST_ZOOKEEPER_CONNECT: zookeeper:2181
# =================== Credentials and classpath for cub kafka-ready ====================
CUB_CLASSPATH: '/etc/confluent/docker/docker-utils.jar:/usr/share/java/confluent-security/kafka-rest/*:/usr/share/java/kafka-rest/*'
#Commented out below to verify that SSL worked
KAFKA_REST_CLIENT_SECURITY_PROTOCOL: SASL_SSL
KAFKA_REST_CLIENT_SASL_MECHANISM: OAUTHBEARER
KAFKA_REST_CLIENT_SASL_LOGIN_CALLBACK_HANDLER_CLASS: io.confluent.kafka.clients.plugins.auth.token.TokenUserLoginCallbackHandler
KAFKA_REST_CLIENT_SASL_JAAS_CONFIG: |
\
org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required \
username="fry" \
password="fry" \
metadataServerUrls="http://kafka1:8090";
# =================== RBAC ==============================
KAFKA_REST_KAFKA_REST_RESOURCE_EXTENSION_CLASS: io.confluent.kafkarest.security.KafkaRestSecurityResourceExtension
KAFKA_REST_REST_SERVLET_INITIALIZOR_CLASSES: io.confluent.common.security.jetty.initializer.InstallBearerOrBasicSecurityHandler
KAFKA_REST_PUBLIC_KEY_PATH: /tmp/conf/public.pem
KAFKA_REST_CONFLUENT_METADATA_SERVER_URLS_MAX_AGE_MS: 60000
KAFKA_REST_CLIENT_CONFLUENT_METADATA_SERVER_URLS_MAX_AGE_MS: 60000
# how to connect to MDS
KAFKA_REST_CONFLUENT_METADATA_BOOTSTRAP_SERVER_URLS: http://kafka1:8090
KAFKA_REST_CONFLUENT_METADATA_HTTP_AUTH_CREDENTIALS_PROVIDER: BASIC
KAFKA_REST_CONFLUENT_METADATA_BASIC_AUTH_USER_INFO: 'fry:fry'
ports:
- 8086:8086
# This container is just to transfer Replicator jars to the Connect worker
# It is not used as a Connect worker
replicator-for-jar-transfer:
image: confluentinc/cp-enterprise-replicator:5.4.0
hostname: replicator-for-jar-transfer
container_name: replicator-for-jar-transfer
volumes:
- mi3:/usr/share/java/kafka-connect-replicator/
command: "sleep infinity"
streams-demo:
image: cnfldemos/cp-demo-kstreams:0.0.2
restart: always
cpus: 0.4
depends_on:
- zookeeper
- kafka1
# - kafka2
- schemaregistry
hostname: streams-demo
container_name: streams-demo
volumes:
- ./scripts/security:/etc/kafka/secrets
environment:
# KAFKA_BOOTSTRAP_SERVERS: "kafka1:9091,kafka2:9092"
KAFKA_BOOTSTRAP_SERVERS: "kafka1:10091"
KAFKA_SCHEMA_REGISTRY_URL: "http://schemaregistry:8085"
KAFKA_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.client.truststore.jks
KAFKA_SSL_TRUSTSTORE_PASSWORD: confluent
KAFKA_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.client.keystore.jks
KAFKA_SSL_KEYSTORE_PASSWORD: confluent
KAFKA_SSL_KEY_PASSWORD: confluent
KAFKA_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: "HTTPS"
KAFKA_SECURITY_PROTOCOL: "SASL_SSL"
KAFKA_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"client\" \
password=\"client-secret\";"
KAFKA_SASL_MECHANISM: PLAIN
KAFKA_PRODUCER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor"
KAFKA_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SECURITY_PROTOCOL: SASL_SSL
KAFKA_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"client\" \
password=\"client-secret\";"
KAFKA_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SASL_MECHANISM: PLAIN
KAFKA_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.truststore.jks
KAFKA_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_TRUSTSTORE_PASSWORD: confluent
KAFKA_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.keystore.jks
KAFKA_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEYSTORE_PASSWORD: confluent
KAFKA_PRODUCER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEY_PASSWORD: confluent
KAFKA_CONSUMER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor"
KAFKA_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SECURITY_PROTOCOL: SASL_SSL
KAFKA_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"client\" \
password=\"client-secret\";"
KAFKA_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SASL_MECHANISM: PLAIN
KAFKA_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_TRUSTSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.truststore.jks
KAFKA_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_TRUSTSTORE_PASSWORD: confluent
KAFKA_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEYSTORE_LOCATION: /etc/kafka/secrets/kafka.connect.keystore.jks
KAFKA_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEYSTORE_PASSWORD: confluent
KAFKA_CONSUMER_CONFLUENT_MONITORING_INTERCEPTOR_SSL_KEY_PASSWORD: confluent
# the following assists https for schema registry
JAVA_OPTS: -Djavax.net.ssl.trustStore=/etc/kafka/secrets/kafka.control-center.truststore.jks
-Djavax.net.ssl.trustStorePassword=confluent
-Djavax.net.ssl.keyStore=/etc/kafka/secrets/kafka.control-center.keystore.jks
-Djavax.net.ssl.keyStorePassword=confluent
volumes:
mi3: {}