How to deploy Charmed Kafka with KRaft
IMPORTANT This feature is experimental and not production ready. UX can change significantly in the upcoming months.
KRaft mode is a solution to remove ZooKeeper dependency from a Kafka deployment. It was introduced on KIP-500
An environment like the one described on How to deploy is needed. After this, the next steps will show the rest of the proccess.
- Deploy Charmed Kafka in Kraft mode
- (Optionally) Create an external admin user
Deploy Charmed Kafka in KRaft mode
A new role has been introduced to the deployment, named controller
. The application that has this role assigned to it will become a controller for the cluster. This role allows to deploy in single app mode, or splitting controller tasks into it’s own application (the recommended way is split mode):
Single application deployment
The Kafka charm can be deployed as follows:
$ juju deploy kafka --channel 3/edge --config roles="broker,controller"
Once the unit shows as active|idle
in the juju status
output, the deployment
should be ready to be used.
Multi application deployment
The Kafka charm can be deployed as follows:
$ juju deploy kafka --channel 3/edge --config roles="broker" broker
$ juju deploy kafka --channel 3/edge --config roles="controller" controller
After this, it is necessary to connect them:
$ juju integrate broker:peer-cluster-orchestrator controller:peer-cluster
Once all the units show as active|idle
in the juju status
output, the deployment
should be ready to be used.
(Optional) Create an external admin users
NOTE: This step is normally done using
data-integrator
. However, current ACLs implementation has a bug where internal operations will fail on relation with the integrator.
To create external users, ssh into a broker unit and make use of the configs
bin command to create a new user:
$ juju ssh broker/0 -- sudo su
# charmed-kafka.configs --alter --entity-type=users --entity-name=<admin-name> --add-config=SCRAM-SHA-512=[password=<admin-password>] --bootstrap-server <broker-ip>:9092 --command-config /var/snap/charmed-kafka/current/etc/kafka/admin.config