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

[id='con-cluster-operator-watch-options-{context}']

= Specifying the namespaces the Cluster Operator watches

[role="_abstract"]
The Cluster Operator watches for updates in the namespaces where the Kafka resources are deployed. 
When you deploy the Cluster Operator, you specify which namespaces to watch in the Kubernetes cluster.
You can specify the following namespaces:

* xref:deploying-cluster-operator-{context}[A single selected namespace] (the same namespace containing the Cluster Operator)
* xref:deploying-cluster-operator-to-watch-multiple-namespaces-{context}[Multiple selected namespaces]
* xref:deploying-cluster-operator-to-watch-whole-cluster-{context}[All namespaces in the cluster]

Watching multiple selected namespaces has the most impact on performance due to increased processing overhead. 
To optimize performance for namespace monitoring, it is generally recommended to either watch a single namespace or monitor the entire cluster. 
Watching a single namespace allows for focused monitoring of namespace-specific resources, while monitoring all namespaces provides a comprehensive view of the cluster's resources across all namespaces.

The Cluster Operator watches for changes to the following resources:

* `Kafka` for the Kafka cluster.
* `KafkaConnect` for the Kafka Connect cluster.
* `KafkaConnector` for creating and managing connectors in a Kafka Connect cluster.
* `KafkaMirrorMaker2` for the Kafka MirrorMaker 2 instance.
* `KafkaBridge` for the Kafka Bridge instance.
* `KafkaRebalance` for the Cruise Control optimization requests.

When one of these resources is created in the Kubernetes cluster, the operator gets the cluster description from the resource and starts creating a new cluster for the resource by creating the necessary Kubernetes resources, such as Deployments, Pods, Services and ConfigMaps.

Each time a Kafka resource is updated, the operator performs corresponding updates on the Kubernetes resources that make up the cluster for the resource.

Resources are either patched or deleted, and then recreated in order to make the cluster for the resource reflect the desired state of the cluster.
This operation might cause a rolling update that might lead to service disruption.

When a resource is deleted, the operator undeploys the cluster and deletes all related Kubernetes resources.

NOTE: While the Cluster Operator can watch one, multiple, or all namespaces in a Kubernetes cluster,
the Topic Operator and User Operator watch for `KafkaTopic` and `KafkaUser` resources in a single namespace. 
For more information, see xref:con-operators-namespaces-str[].
