Migrating to Kraft
Create Kraft Controller KafkaNodePool
Add a new KafkaNodePool
to the axual-kafka
configuration. The new controller nodepool will use the same Zookeeper configuration, and will be as follows:
axual-kafka:
kafkaNodePools:
controller:
nextNodeIds: "[`<Choose a Range for Controller IDs>`]" ## example: `nextNodeIds: "[100-199]"`
replicas: <axual-kafka.zookeeper.replicas>
resources:
limits:
memory: <axual-kafka.zookeeper.resources.limits.memory>
requests:
cpu: <axual-kafka.zookeeper.resources.requests.cpu>
memory: <axual-kafka.zookeeper.resources.requests.memory>
templ: <axual-kafka.zookeeper.templ>
roles:
- controller
storage:
type: <axual-streaming.kafka.kafka.storageType>
volumes:
- deleteClaim: false
id: 0
<axual-streaming.zookeeper.storage>
After adding this nodepool, the cluster will show a |
If you are using affinity rules for your controller scheduling, use the following labels for controller:
|
Migrate from Zookeeper to Kraft
First Step: Both Zookeeper and Kraft Enabled
Update axual-kafka.kafka.kraft
from disabled
to migration
.
-
Push the changes. The only change is that the
strimzi.io/kraft:
annotation will be updated tomigration
. -
Watch Kafka resources. At first, the Kafka cluster resource
METADATA STATE
will beKRaftMigration
. -
Brokers will restart; wait until this is complete.
-
The Kafka cluster resource
METADATA STATE
will change toKRaftDualWriting
. -
Another broker restart will occur; wait until this is complete.
-
The Kafka cluster resource
METADATA STATE
will change toKRaftPostMigration
.
First Step Verification
-
Brokers are healthy.
-
You can produce/consume messages.
-
If the verification failed, initiate a rollback.
Second Step: Full Migration to Kraft
-
Update
axual-kafka.kafka.kraft
frommigration
toenabled
.
Once you enable Kraft, there is no way to roll back. Therefore, the "Rollback Migration" steps below are not applicable in this case. |
-
Kraft controllers will restart; wait until this is complete.
-
Brokers will restart; wait until this is complete.
-
The Kafka cluster resource
METADATA STATE
will change toPreKRaft
. -
The Kafka cluster resource
METADATA STATE
will change toKRaft
. -
Now, you can disable Zookeeper by setting
axual-kafka.zookeeper.enabled
tofalse
.
Disabling Zookeeper will be done with no broker restart. |
Rollback Migration
If you decided to roll back the migration and axual-kafka.kafka.kraft
is still not changed from migration
to enabled
, do the following steps:
-
Ensure the Kafka resource
METADATA STATE
isKRaftPostMigration
. -
Change
axual-kafka.kafka.kraft
frommigration
torollback
. -
Kafka brokers will restart.
-
The Kafka resource
METADATA STATE
will change toKRaftDualWriting
. -
Change
axual-kafka.kafka.kraft
fromrollback
todisabled
. -
Remove the controller
kafkaNodePool
fromaxual-kafka.kafkaNodePools
. -
Brokers will restart. When this is complete, the Kafka resource
METADATA STATE
will revert toZooKeeper
.