// This assembly is included in the following assemblies:
//
// assembly-upgrade.adoc

[id='assembly-upgrading-kafka-versions-{context}']

= Upgrading Kafka

[role="_abstract"]
After you have upgraded your Cluster Operator to {ProductVersion}, the next step is to upgrade all Kafka brokers to the latest supported version of Kafka.

Kafka upgrades are performed by the Cluster Operator through rolling updates of the Kafka brokers.

The Cluster Operator initiates rolling updates based on the Kafka cluster configuration.

[cols="2*",options="header",stripes="none",separator=¦]
|===

¦If `Kafka.spec.kafka.config` contains...
¦The Cluster Operator initiates...

¦Both the `inter.broker.protocol.version` and the `log.message.format.version`.
¦A single rolling update. After the update, the `inter.broker.protocol.version` must be updated manually, followed by `log.message.format.version`.
Changing each will trigger a further rolling update.

¦Either the `inter.broker.protocol.version` or the `log.message.format.version`.
¦Two rolling updates.

¦No configuration for the `inter.broker.protocol.version` or the `log.message.format.version`.
¦Two rolling updates.

|===

IMPORTANT: From Kafka 3.0.0, when the `inter.broker.protocol.version` is set to `3.0` or higher, the `log.message.format.version` option is ignored and doesn't need to be set.
The `log.message.format.version` property for brokers and the `message.format.version` property for topics are deprecated and will be removed in a future release of Kafka.

As part of the Kafka upgrade, the Cluster Operator initiates rolling updates for ZooKeeper.

* A single rolling update occurs even if the ZooKeeper version is unchanged.
* Additional rolling updates occur if the new version of Kafka requires a new ZooKeeper version.

include::../../modules/upgrading/ref-upgrade-kafka-versions.adoc[leveloffset=+1]

//strategies for upgrading clients - concept
include::../../modules/upgrading/con-upgrade-strategies-for-upgrading-clients.adoc[leveloffset=+1]

include::../../modules/upgrading/con-upgrade-versions-and-images.adoc[leveloffset=+1]

include::../../modules/upgrading/proc-upgrade-brokers-newer-kafka.adoc[leveloffset=+1]
