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

[id='proc-upgrade-topic-operator-api-version-{context}']
= Upgrading the Topic Operator to support {ApiVersion}

.Prerequisites

* A Cluster Operator supporting the `{ApiVersion}` API version is up and running.

.Procedure
Perform the following steps for each `Kafka` custom resource in your deployment.

. Update the `Kafka` custom resource in an editor.
+
[source,shell,subs="+quotes,attributes"]
----
kubectl edit kafka _KAFKA-CLUSTER_
----

. If `Kafka.spec.topicOperator` is used:

.. Move `affinity` from `.spec.topicOperator.affinity` to `.spec.entityOperator.template.pod.affinity`.

.. Move `tolerations` from `.spec.topicOperator.tolerations` to `.spec.entityOperator.template.pod.tolerations`.

.. Move `.spec.topicOperator.tlsSidecar` to `.spec.entityOperator.tlsSidecar`.

.. After moving `affinity`, `tolerations`, and `tlsSidecar`, move the remaining configuration in `.spec.topicOperator` to `.spec.entityOperator.topicOperator`.

. If `type: external` logging is configured in `.spec.topicOperator.logging`:
+
Replace the `name` of the ConfigMap containing the logging configuration:
+
[source,yaml,subs="attributes+"]
----
logging:
  type: external
  name: my-config-map
----
+
With the `valueFrom.configMapKeyRef` field, and specify both the ConfigMap `name` and the `key` under which the logging is stored:
+
[source,yaml,subs="attributes+"]
----
logging:
  type: external
  valueFrom:
    configMapKeyRef:
      name: my-config-map
      key: log4j2.properties
----
+
NOTE: You can also complete this step as part of the xref:proc-upgrade-entity-operator-api-version-{context}[Entity Operator upgrade].

. Save the file, exit the editor and wait for the updated custom resource to be reconciled.