parent
5dd3944faa
commit
50bf0f1780
3 changed files with 68 additions and 0 deletions
3
docker/jaas/client.properties
Normal file
3
docker/jaas/client.properties
Normal file
|
@ -0,0 +1,3 @@
|
|||
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="admin-secret";
|
||||
security.protocol=SASL_PLAINTEXT
|
||||
sasl.mechanism=PLAIN
|
14
docker/jaas/kafka_server.conf
Normal file
14
docker/jaas/kafka_server.conf
Normal file
|
@ -0,0 +1,14 @@
|
|||
KafkaServer {
|
||||
org.apache.kafka.common.security.plain.PlainLoginModule required
|
||||
username="admin"
|
||||
password="admin-secret"
|
||||
user_admin="admin-secret"
|
||||
user_enzo="cisternino";
|
||||
};
|
||||
|
||||
KafkaClient {
|
||||
org.apache.kafka.common.security.plain.PlainLoginModule required
|
||||
user_admin="admin-secret";
|
||||
};
|
||||
|
||||
Client {};
|
51
docker/kafka-ui-sasl.yaml
Normal file
51
docker/kafka-ui-sasl.yaml
Normal file
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
version: '2'
|
||||
services:
|
||||
|
||||
kafka-ui:
|
||||
container_name: kafka-ui
|
||||
image: provectuslabs/kafka-ui:latest
|
||||
ports:
|
||||
- 8080:8080
|
||||
depends_on:
|
||||
- zookeeper
|
||||
- kafka
|
||||
environment:
|
||||
KAFKA_CLUSTERS_0_NAME: local
|
||||
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
|
||||
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
|
||||
KAFKA_CLUSTERS_0_PROPERTIES_SECURITY_PROTOCOL: SASL_PLAINTEXT
|
||||
KAFKA_CLUSTERS_0_PROPERTIES_SASL_MECHANISM: PLAIN
|
||||
KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG: 'org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="admin-secret";'
|
||||
zookeeper:
|
||||
image: confluentinc/cp-zookeeper:5.2.4
|
||||
environment:
|
||||
ZOOKEEPER_CLIENT_PORT: 2181
|
||||
ZOOKEEPER_TICK_TIME: 2000
|
||||
ports:
|
||||
- 2181:2181
|
||||
|
||||
kafka:
|
||||
image: wurstmeister/kafka:latest
|
||||
hostname: kafka
|
||||
container_name: kafka
|
||||
depends_on:
|
||||
- zookeeper
|
||||
ports:
|
||||
- '9092:9092'
|
||||
environment:
|
||||
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
|
||||
KAFKA_LISTENERS: SASL_PLAINTEXT://kafka:9092
|
||||
KAFKA_ADVERTISED_LISTENERS: SASL_PLAINTEXT://kafka:9092
|
||||
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
|
||||
ALLOW_PLAINTEXT_LISTENER: 'yes'
|
||||
KAFKA_OPTS: "-Djava.security.auth.login.config=/etc/kafka/jaas/kafka_server.conf"
|
||||
KAFKA_AUTHORIZER_CLASS_NAME: kafka.security.auth.SimpleAclAuthorizer
|
||||
KAFKA_INTER_BROKER_LISTENER_NAME: SASL_PLAINTEXT
|
||||
KAFKA_SASL_ENABLED_MECHANISMS: PLAIN
|
||||
KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN
|
||||
KAFKA_SECURITY_PROTOCOL: SASL_PLAINTEXT
|
||||
KAFKA_SUPER_USERS: User:admin,User:enzo
|
||||
KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: 'true'
|
||||
volumes:
|
||||
- ./jaas:/etc/kafka/jaas
|
Loading…
Add table
Reference in a new issue