ZooKeeper to KRaft Migration Phases and Sub-phases
This topic describes the phases and sub-phases of the ZooKeeper to KRaft migration process. Use this reference to monitor migration progress and troubleshoot issues by identifying the current phase in the CFK logs.
Overview
The ZooKeeper to KRaft migration process includes the following phases:
SETUP
MIGRATE
DUAL-WRITE
MoveToKRaft or RollbackToZk
COMPLETE

ZooKeeper to KRaft migration phase flow diagram
Migration phase: SETUP
When the migration job is in the SETUP phase, the log has the status, Migration current status SETUP/<sub-phase>.
CFK performs the following tasks at each sub-phase during the SETUP phase:
SubPhaseSetupDeriveIBPVersion: Derives the inter-broker protocol (IBP) version for migration. CFK automatically determines the IBP from the image tag for standard Confluent images. For custom images, CFK reads theplatform.confluent.io/kraft-migration-ibp-versionannotation from the Kafka CR. The migration job stores the derived IBP version in its status for use in subsequent phases.SubPhaseSetupAddMigrationAnnotation: Adds theplatform.confluent.io/kraft-migration-cr-lockannotation to the ZooKeeper, Kafka, and KRaft controller CRs.SubPhaseSetupCheckHealthyKafka: Ensures Kafka is running healthy.SubPhaseSetupCheckKafkaVersion: Ensures Kafka version is 7.6.0 or later.SubPhaseSetupEnsureKRaftControllerExists: Ensure KRaftController is present in the hold state. Theplatform.confluent.io/kraft-migration-hold-krc-creationannotation prevents KRaftController from starting until CFK removes the annotation later, atSubPhaseSetupMutateKRaftController.SubPhaseSetupTriggerIBPUpgrade: Upgradesinter.broker.protocol.versionusing the annotation-specified value for custom images or the operator-determined value for standard Confluent Platform images.SubPhaseSetupEnsureIBPUpgradeComplete: Waits for Kafka roll to complete after CFK upgradesinter.broker.protocol.versionin the previous sub-phase.SubPhaseSetupFetchKafkaClusterId: Fetches the Kafka Cluster ID from Jolokia endpoint in Kafka cluster.SubPhaseSetupFetchKafkaZookeeperEndpoint: Fetches the ZooKeeper endpoint from the Kafka CR Status.SubPhaseSetupMutateKRaftController:Removes the hold annotation,
platform.confluent.io/kraft-migration-hold-krc-creation.Supplies the Kafka Cluster ID from previous step, so that the bootstrapped cluster has the same cluster ID.
Adds migration configuration.
SubPhaseSetupKRaftControllerHealthy: Waits for KRaftController to become healthy.SubPhaseSetupCheckKraftControllerVersion: Validates if KRaftController version is 7.6 or later.SubPhaseSetupComplete: Marks the completion of theSETUPphase.
Migration phase: MIGRATE
When the migration job is in the MIGRATE phase, the log has the status, Migration current status MIGRATE/<sub-phase>.
CFK performs the following tasks at each sub-phase during the MIGRATE phase:
SubPhaseMigrateTriggerKafkaMigration: Adds the following configurations at this phase:Migration configurations
KRaft reference
SubPhaseMigrateEnsureKafkaRollComplete: Waits for the Kafka roll to complete.SubPhaseMigrateMonitorMigrationProgress: Monitors the migration progress, and checks if it reaches DUAL-WRITE mode.SubPhaseMigrateDualWrite: Marks the completion of Migration phase.
Migration phase: DUAL-WRITE
The DUAL-WRITE phase does not have any sub-phases.
At this point, Confluent Platform is in DUAL-WRITE state (metadata copies to both ZooKeeper and KRaft controller), the migration job waits for your input to move to the KRaft only mode or to roll back to ZooKeeper.
When you apply the desired annotation, platform.confluent.io/kraft-migration-trigger-finalize-to-kraft or platform.confluent.io/kraft-migration-trigger-rollback-to-zk, the migration job moves to the MoveToKRaftControllerOnly or RollbackToZk phase.
Migration phase: MoveToKRaftControllerOnly
When the migration job is in the MoveToKRaftControllerOnly phase, the log has the status, Migration current status MoveToKRaftControllerOnly/<sub-phase>.
The migration job performs the following tasks at each sub-phase during the MoveToKRaftControllerOnly phase:
SubPhaseMoveToKRaftControllerTriggerZkRemoval: Removes ZooKeeper dependency from Kafka.SubPhaseMoveToKRaftControllerEnsureKafkaRollIsComplete: Waits for Kafka roll to finish.SubPhaseMoveToKRaftControllerTriggerKRaftControllerMigrationModeRemoval: Triggers migration config removal from KRaftControllers.SubPhaseMoveToKRaftControllerEnsureKRaftControllerMigrationModeRemovalComplete: Waits for KRaftController roll to complete.SubPhaseMoveToKRaftControllerComplete: Marks completion of the migration.
Migration phase: RollbackToZk
To roll back to ZooKeeper, the migration job performs the following tasks at each sub-phase during the RollbackToZK phase:
SubPhaseRollbackToZkMakeProcessRoleEmpty: Removesprocess.rolesproperties from Kafka.SubPhaseRollbackToZkEnsureKafkaRollIsComplete: Ensures Kafka roll is complete.SubPhaseRollbackToZkWaitForManualNodeRemovalFromZk: Waits for a manual removal for ZooKeeper controller node.When you remove the
controllerandmigrationnodes and trigger the node removal process as described in the second and third steps in Rollback to ZooKeeper, the migration moves to the next sub-phase.SubPhaseRollbackToZkRemoveKRaftControllerDepsInKafka: Removes KRaft dependency from Kafka.SubPhaseRollbackToZkEnsureKafkaRollIsComplete2: Ensures Kafka roll is complete.SubPhaseRollbackToZkAddClusterMetadataCleanUpAnnotationInKafka: Addsplatform.confluent.io/format-cluster-metadata-in-kafkaannotation which directs the init container to remove cluster_metadata directory/mnt/data/data0/logs/__cluster_metadatain Kafka.SubPhaseRollbackToZkEnsureKafkaRollIsComplete3: Ensures Kafka roll is complete.SubPhaseRollbackToZkRemoveClusterMetadataCleanUpAnnotationInKafka: Removesplatform.confluent.io/format-cluster-metadata-in-kafka.SubPhaseRollbackToZkEnsureKafkaRollIsComplete4: Ensures Kafka roll is complete.SubPhaseRollbackToZkComplete: Marks completion of rollback to ZooKeeper.
Migration phase: COMPLETE
The final phase of the ZooKeeper to KRaft migration has one of the following status:
COMPLETEThe final phase. No sub-phases.
FAILUREThe migration enters this phase when it encounters a non-recoverable error.