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

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

.Prerequisites

* A Cluster Operator supporting the `{ApiVersion}` API version is up and running.
* `Kafka.spec.entityOperator` is configured, as described in xref:proc-upgrade-topic-operator-api-version-{context}[].

.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_
----

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

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

. If `type: external` logging is configured in `.spec.entityOperator.userOperator.logging` or `.spec.entityOperator.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
----

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