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

[id='assembly-upgrade-cluster-operator-{context}']
= Upgrading the Cluster Operator

[role="_abstract"]
Use the same method to upgrade the Cluster Operator as the initial method of deployment.

include::../../modules/upgrading/proc-upgrade-cluster-operator.adoc[leveloffset=+1]

== Upgrading the Cluster Operator using the OperatorHub

If you deployed Strimzi from {OperatorHub}, use the Operator Lifecycle Manager (OLM) to change the update channel for the Strimzi operators to a new Strimzi 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

NOTE: 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 {OLMOperatorDocs}.

== Upgrading the Cluster Operator using a Helm chart

If you deployed the Cluster Operator using a Helm chart, use `helm upgrade`.

The `helm upgrade` command does not upgrade the {HelmCustomResourceDefinitions}.
Install the new CRDs manually after upgrading the Cluster Operator.
You can access the CRDs from the {ReleaseDownload} or find them in the `crd` subdirectory inside the Helm Chart.

== 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 Strimzi that used bidirectional topic management, there are some cleanup tasks to perform after upgrading the Cluster Operator.
For more information, see xref:proc-changing-topic-operator-mode-{context}[].

[id='con-upgrade-cluster-operator-unsupported-kafka-{context}']
== Upgrading the Cluster Operator returns Kafka version error

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 `kubectl` to check for error messages like this in the `status` of the `Kafka` resource.

.Checking the Kafka status for errors
[source,shell, subs=+quotes]
----
kubectl 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 Kubernetes namespace where the pod is running.


