// Module included in the following assemblies:
//
// assembly-downgrade.adoc

[id='proc-downgrade-cluster-operator-{context}']
= Downgrading the Cluster Operator to a previous version

If you are encountering issues with Strimzi,
you can revert your installation.

This procedure describes how to downgrade a Cluster Operator deployment to a previous version.

.Prerequisites

* An existing Cluster Operator deployment is available.
* You have xref:downloads-{context}[downloaded the installation files for the previous version].

.Before you begin

Check the downgrade requirements of the xref:ref-operator-cluster-feature-gates-{context}[Strimzi feature gates].
If a feature gate is permanently enabled, you may need to downgrade to a version that allows you to disable it before downgrading to your target version. 

.Procedure

. 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 previous version of the Cluster Operator.
+
. Revert your custom resources to reflect the supported configuration options available for the version of Strimzi you are downgrading to.

. Update the Cluster Operator.

.. Modify the installation files for the previous version according to the namespace the Cluster Operator is running in.
+
include::../../shared/snip-cluster-operator-namespace-sed.adoc[]
+
.. 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.

. When you have an updated configuration, deploy it along with the rest of the installation resources:
+
[source,shell,subs="+quotes,attributes"]
----
kubectl replace -f install/cluster-operator
----
+
Wait for the rolling updates to complete.

. Get the image for the Kafka pod to ensure the downgrade was successful:
+
[source,shell,subs="+quotes,attributes"]
----
kubectl get pod my-cluster-kafka-0 -o jsonpath='{.spec.containers[0].image}'
----
+
The image tag shows the new Strimzi version followed by the Kafka version. 
For example, `<strimzi_version>-kafka-<kafka_version>`.
+
You can also xref:con-upgrade-status-{context}[check the downgrade has completed successfully from the status of the `Kafka` resource].
