Skip to content

Commit

Permalink
scripts: fix create-admin-scram-users to use .env
Browse files Browse the repository at this point in the history
  • Loading branch information
fhussonnois committed Apr 9, 2022
1 parent 61b6e16 commit 1820089
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions bin/create-admin-scram-users
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@

set -e;

CONFIG_DIR=$(readlink -f $0 | xargs dirname)/etc
DIR=$(readlink -f $0 | xargs dirname)
CONFIG_DIR=$DIR/etc

source $DIR/.env

echo "Creating new user for SASL/SCRAM-SHA-[256|512]: (username:kafka, password:kafka) - This may take a few seconds..."
docker run -it \
--env KAFKA_OPTS="-Djava.security.auth.login.config=/etc/kafka/secrets/kafka_server_jaas.conf -Dzookeeper.sasl.clientconfig=ZkClient" \
--network="host" \
--mount type=bind,source=${CONFIG_DIR}/secrets/,target=/etc/kafka/secrets/ \
confluentinc/cp-kafka:latest \
/usr/bin/kafka-configs --zookeeper localhost:2181 --alter --add-config 'SCRAM-SHA-256=[iterations=8192,password=kafka],SCRAM-SHA-512=[password=kafka]' --entity-type users --entity-name kafka
confluentinc/cp-kafka:${CONFLUENT_VERSION} \
/usr/bin/kafka-configs --zookeeper localhost:2181 \
--alter \
--add-config 'SCRAM-SHA-256=[iterations=8192,password=kafka],SCRAM-SHA-512=[password=kafka]' \
--entity-type users \
--entity-name kafka

0 comments on commit 1820089

Please sign in to comment.