Upgrade Confluent Platform Using Confluent for Kubernetes

When you upgrade Confluent Platform from one version to another, we recommend that you perform the upgrade process separate from making other changes to your clusters, such as scaling up, changing configuration, or rotating credentials.

Note that there are certain configurations that cannot be updated on deployed clusters. See Upgrades and updates for this list.

Upgrade Confluent Platform components in the following order:

  1. Zookeeper
  2. Kafka
  3. Other Confluent components, excluding Control Center, in any order
  4. Control Center

Upgrade Kafka

You have two options to upgrade Kafka:

Automatic upgrade of Kafka

Starting in the 2.8 release, CFK automates the Kafka upgrade process by setting the following properties in Kafka during upgrades:

  • inter.broker.protocol.version
  • log.message.format.version

This upgrade option is enabled by default for Kafka and is supported for:

  • Kafka image from the standard Confluent Platform Docker registry

    The automatic upgrade feature is not supported for custom image registries.

  • ZooKeeper-based Kafka clusters

    The automatic upgrade feature is not supported for KRaft-based clusters.

To upgrade Kafka:

  1. CFK sets the Kafka inter-broker version to 2.6.

    If you want to overwrite the default inter-broker version:

    1. Add the platform.confluent.io/bootstrap-ibp-version to the Kafka cluster:

      kubectl annotate kafka kafka platform.confluent.io/bootstrap-ibp-version="<inter-broker-version>"
      
    2. Verify that the inter-broker field is successfully updated:

      kubectl get kafka kafka -oyaml | grep previousClusterVersion
      
    3. Remove the annotation from the Kafka CR:

      kubectl annotate kafka kafka platform.confluent.io/bootstrap-ibp-version-
      
  2. In the Kafka CR, verify that the CFK init container image tag has been updated during the CFK upgrade process. The image tag should be the current version of CFK, 2.8.2.

    spec:
      image:
        init: confluentinc/confluent-init-container:2.8.2
    
  3. In the Kafka CR, update the component image tag. The tag is the Confluent Platform release you want to upgrade to.

    spec:
      image:
        application: confluentinc/cp-server:<tag>
    

    For example, to upgrade Kafka to 7.6.1:

    spec:
      image:
        application: confluentinc/cp-server:7.6.1
    
  4. Apply the Kafka CR.

    The automatic upgrade process is triggered when the image tag is higher than the current version of Kafka (status.currentClusterVersion).

  5. Check the final cluster versions:

    kubectl get kafka kafka -oyaml | grep previousClusterVersion
    
    kubectl get kafka kafka -oyaml | grep currentClusterVersion
    

    For example, if you upgrade Confluent Platform 7.3 to 7.6, you will have:

    status.previousClusterVersion: 7.3
    status.currentClusterVersion: 7.6
    

Note

The automatic upgrade process always sets inter.broker.protocol.version to the previous Kafka version. In the above example, CFK sets the inter.broker.protocol.version to 7.3 which is the previous Kafka cluster version. On next upgrade of Confluent Platform 7.6 to 7.7, inter.broker.protocol.version will be set to 7.6.

Manual upgrade of Kafka

In CFK 2.7 and older versions, the upgrade process requires you to manually set the Kafka inter.broker.protocol.version and upgrade Kafka in two phases. This process is still supported.

To upgrade Kafka manually:

  1. In the Kafka CR, update the component image tag. The tag is the Confluent Platform release you want to upgrade to.

    spec:
      image:
        application: confluentinc/cp-server:<tag>
    

    For example, to upgrade Kafka to 7.6.1:

    spec:
      image:
        application: confluentinc/cp-server:7.6.1
    
  2. In the same Kafka CR, verify that the CFK init container image tag has been updated during the CFK upgrade process. The image tag should be the current version of CFK, 2.8.2.

    spec:
      image:
        init: confluentinc/confluent-init-container:2.8.2
    
  3. Add the annotation to the Kafka CR to disable the automatic upgrade feature:

    metadata:
      annotations:
        platform.confluent.io/automatic-ibp-upgrade: "disable"
    
  4. Set the following properties in the Kafka CR to the broker protocol version of the currently installed Confluent Platform version. To get the broker protocol version, refer to the table in Kafka upgrade documentation.

    If you are upgrading from Confluent Platform version 6.2.x or earlier, set log.message.format.version to the version you are upgrading from as shown below.

    If you are upgrading from Confluent Platform version 7.0 or later, you do not need to set log.message.format.version.

    spec:
      configOverrides:
        server:
          - inter.broker.protocol.version=<current Kafka broker protocol version>
          - log.message.format.version=<current Kafka broker protocol version>
    
  5. Upgrade Kafka:

    kubectl apply -f <Kafka CR> --name <namespace>
    
  6. After the Kafka brokers have been upgraded, set the properties in the Kafka CR to the target Kafka broker protocol version, 3.6:

    spec:
      configOverrides:
        server:
          - inter.broker.protocol.version=3.6
    
  7. Upgrade Kafka.

    kubectl apply -f <Kafka CR> --name <namespace>
    

Upgrade non-Kafka Confluent Platform components

Upgrade Confluent Platform component as below:

  1. In the component CR, update the component image tag. The tag is the Confluent Platform release you want to upgrade to.

    spec:
      image:
        application: <component image>:<tag>
    

    For example, to upgrade Kafka to 7.6.1:

    spec:
      image:
        application: confluentinc/cp-server:7.6.1
    
  2. In the same component CR, verify that the CFK init container image tag has been updated during the CFK upgrade process. The image tag should be the current version of CFK, 2.8.2.

    spec:
      image:
        init: confluentinc/confluent-init-container:2.8.2
    
  3. When upgrading Control Center:

    If you migrated from Operator 1.x to CFK 2.3.0 or lower, and then you are upgrading to CFK 2.4.0 or higher with Confluent Platform version 7.1 or lower, set the following property in the Control Center CR:

    configOverrides:
      server:
        - confluent.controlcenter.internal.topics.partitions=4
    
  4. Upgrade the component.

    kubectl apply -f <component CR> --name <namespace>