:_mod-docs-content-type: PROCEDURE

// Module included in the following assemblies:
//
// deploying/assembly_deploy-kafka-cluster.adoc

[id='deploying-the-topic-operator-using-the-cluster-operator-{context}']
= Deploying the Topic Operator using the Cluster Operator

[role="_abstract"]
This procedure describes how to deploy the Topic Operator using the Cluster Operator.

You configure the `entityOperator` property of the `Kafka` resource to include the `topicOperator`.
By default, the Topic Operator watches for `KafkaTopic` resources in the namespace of the Kafka cluster deployed by the Cluster Operator.
You can also specify a namespace using `watchedNamespace` in the Topic Operator `spec`.
A single Topic Operator can watch a single namespace.
One namespace should be watched by only one Topic Operator.

WARNING: Do not deploy more than one Kafka cluster into the same namespace. 
This causes the Topic Operator connected to each cluster to compete for the same topic resources using the same names, leading to name collisions and unpredictable behavior.

If you want to use the Topic Operator with a Kafka cluster that is not managed by Strimzi,
you must xref:deploying-the-topic-operator-standalone-{context}[deploy the Topic Operator as a standalone component].

For more information about configuring the `entityOperator` and `topicOperator` properties,
see xref:ref-kafka-entity-operator-str[Configuring the Entity Operator].

.Prerequisites

* xref:deploying-cluster-operator-str[The Cluster Operator must be deployed.]

.Procedure

. Edit the `entityOperator` properties of the `Kafka` resource to include `topicOperator`:
+
[source,yaml,subs="+attributes"]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
metadata:
  name: my-cluster
spec:
  #...
  entityOperator:
    topicOperator: {}
    userOperator: {}
----

. Configure the Topic Operator `spec` using the properties described in the link:{BookURLConfiguring}#type-EntityTopicOperatorSpec-reference[`EntityTopicOperatorSpec` schema reference^].
+
Use an empty object (`{}`) if you want all properties to use their default values.

. Create or update the resource:
+
[source,shell,subs=+quotes]
kubectl apply -f _<kafka_configuration_file>_

. Check the status of the deployment:
+
[source,shell,subs="+quotes"]
----
kubectl get pods -n _<my_cluster_operator_namespace>_
----
+
.Output shows the pod name and readiness
[source,shell,subs="+quotes"]
----
NAME                        READY   STATUS    RESTARTS
my-cluster-entity-operator  3/3     Running   0
# ...
----
+
`my-cluster` is the name of the Kafka cluster.
+
`READY` shows the number of replicas that are ready/expected.
The deployment is successful when the `STATUS` displays as `Running`.
