25.5. Upgrading the Cluster Operator


Use the same method to upgrade the Cluster Operator as the initial method of deployment.

This procedure describes how to upgrade a Cluster Operator deployment to use Streams for Apache Kafka 2.7.

Follow this procedure if you deployed the Cluster Operator using the installation YAML files.

The availability of Kafka clusters managed by the Cluster Operator is not affected by the upgrade operation.

注意

Refer to the documentation supporting a specific version of Streams for Apache Kafka for information on how to upgrade to that version.

Prerequisites

Procedure

  1. Take note of any configuration changes made to the existing Cluster Operator resources (in the /install/cluster-operator directory). Any changes will be overwritten by the new version of the Cluster Operator.
  2. Update your custom resources to reflect the supported configuration options available for Streams for Apache Kafka version 2.7.
  3. Update the Cluster Operator.

    1. Modify the installation files for the new Cluster Operator version according to the namespace the Cluster Operator is running in.

      On Linux, use:

      sed -i 's/namespace: .*/namespace: my-cluster-operator-namespace/' install/cluster-operator/*RoleBinding*.yaml

      On MacOS, use:

      sed -i '' 's/namespace: .*/namespace: my-cluster-operator-namespace/' install/cluster-operator/*RoleBinding*.yaml
    2. If you modified one or more environment variables in your existing Cluster Operator Deployment, edit the install/cluster-operator/060-Deployment-strimzi-cluster-operator.yaml file to use those environment variables.
  4. When you have an updated configuration, deploy it along with the rest of the installation resources:

    oc replace -f install/cluster-operator

    Wait for the rolling updates to complete.

  5. If the new Operator version no longer supports the Kafka version you are upgrading from, the Cluster Operator returns an error message to say the version is not supported. Otherwise, no error message is returned.

    • If the error message is returned, upgrade to a Kafka version that is supported by the new Cluster Operator version:

      1. Edit the Kafka custom resource.
      2. Change the spec.kafka.version property to a supported Kafka version.
    • If the error message is not returned, go to the next step. You will upgrade the Kafka version later.
  6. Get the image for the Kafka pod to ensure the upgrade was successful:

    oc get pods my-cluster-kafka-0 -o jsonpath='{.spec.containers[0].image}'

    The image tag shows the new Streams for Apache Kafka version followed by the Kafka version:

    registry.redhat.io/amq-streams/strimzi-kafka-37-rhel9:2.7.0

    You can also check the upgrade has completed successfully from the status of the Kafka resource.

The Cluster Operator is upgraded to version 2.7, but the version of Kafka running in the cluster it manages is unchanged.

If you deployed Streams for Apache Kafka from OperatorHub, use the Operator Lifecycle Manager (OLM) to change the update channel for the Streams for Apache Kafka operators to a new Streams for Apache Kafka version.

Updating the channel starts one of the following types of upgrade, depending on your chosen upgrade strategy:

  • An automatic upgrade is initiated
  • A manual upgrade that requires approval before installation begins
注意

If you subscribe to the stable channel, you can get automatic updates without changing channels. However, enabling automatic updates is not recommended because of the potential for missing any pre-installation upgrade steps. Use automatic upgrades only on version-specific channels.

For more information on using OperatorHub to upgrade Operators, see the Upgrading installed Operators (OpenShift documentation).

25.5.3. Migrating to unidirectional topic management

When deploying the Topic Operator to manage topics, the Cluster Operator enables unidirectional topic management by default. If you are switching from a version of Streams for Apache Kafka that used bidirectional topic management, there are some cleanup tasks to perform after upgrading the Cluster Operator. For more information, see 第 10.9 节 “Switching between Topic Operator modes”.

If you upgrade the Cluster Operator to a version that does not support the current version of Kafka you are using, you get an unsupported Kafka version error. This error applies to all installation methods and means that you must upgrade Kafka to a supported Kafka version. Change the spec.kafka.version in the Kafka resource to the supported version.

You can use oc to check for error messages like this in the status of the Kafka resource.

Checking the Kafka status for errors

oc get kafka <kafka_cluster_name> -n <namespace> -o jsonpath='{.status.conditions}'

Replace <kafka_cluster_name> with the name of your Kafka cluster and <namespace> with the OpenShift namespace where the pod is running.

Action required if upgrading from Streams for Apache Kafka 1.7 or earlier using the OperatorHub

Before you upgrade the Streams for Apache Kafka Operator to version 2.7, you need to make the following changes:

  • Convert custom resources and CRDs to v1beta2
  • Upgrade to a version of Streams for Apache Kafka where the ControlPlaneListener feature gate is disabled

These requirements are described in 第 25.2.2 节 “Upgrading from a Streams for Apache Kafka version earlier than 1.7”.

If you are upgrading from Streams for Apache Kafka 1.7 or earlier, do the following:

  1. Upgrade to Streams for Apache Kafka 1.7.
  2. Download the Red Hat Streams for Apache Kafka API Conversion Tool provided with Streams for Apache Kafka 1.8 from the Streams for Apache Kafka software downloads page.
  3. Convert custom resources and CRDs to v1beta2.

    For more information, see the Streams for Apache Kafka 1.7 upgrade documentation.

  4. In the OperatorHub, delete version 1.7 of the Streams for Apache Kafka Operator.
  5. If it also exists, delete version 2.7 of the Streams for Apache Kafka Operator.

    If it does not exist, go to the next step.

    If the Approval Strategy for the Streams for Apache Kafka Operator was set to Automatic, version 2.7 of the operator might already exist in your cluster. If you did not convert custom resources and CRDs to the v1beta2 API version before release, the operator-managed custom resources and CRDs will be using the old API version. As a result, the 2.7 Operator is stuck in Pending status. In this situation, you need to delete version 2.7 of the Streams for Apache Kafka Operator as well as version 1.7.

    If you delete both operators, reconciliations are paused until the new operator version is installed. Follow the next steps immediately so that any changes to custom resources are not delayed.

  6. In the OperatorHub, do one of the following:

    • Upgrade to version 1.8 of the Streams for Apache Kafka Operator (where the ControlPlaneListener feature gate is disabled by default).
    • Upgrade to version 2.0 or 2.2 of the Streams for Apache Kafka Operator (where the ControlPlaneListener feature gate is enabled by default) with the ControlPlaneListener feature gate disabled.
  7. Upgrade to version 2.7 of the Streams for Apache Kafka Operator immediately.

    The installed 2.7 operator begins to watch the cluster and performs rolling updates. You might notice a temporary decrease in cluster performance during this process.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部