Deploying and configuring the Strimzi Entity Operator
Learn how to deploy and configure the Strimzi Entity Operator in your cluster by configuring your Kafka resource. Deploying the Entity Operator is required if you want to use custom resources to manage Kafka topics and users in your cluster.
The Entity Operator is responsible for managing Kafka users (clients) and Kafka topics in your Kafka cluster. The Entity Operator comprises the following two operators.
- Strimzi Topic Operator – An operator application that creates and manages Kafka topics in your Kafka cluster with KafkaTopic resources.
- Strimzi User Operator – An operator application that creates and manages Kafka users in your Kafka cluster with KafkaUser resources.
To deploy and configure the Entity Operator you configure your Kafka
resource to include the entityOperator property. The
entityOperator property can include topicOperator and
userOperator properties.
These properties specify which of the two operators are deployed with the Entity Operator. You can choose to deploy either the Topic or User Operator, or deploy both at once.
The following example deploys both the Topic and User Operator with default configurations.
#...
kind: Kafka
spec:
entityOperator:
topicOperator: {}
userOperator: {}
You can further configure all three operators by including additional supported properties in
the configuration. The entityOperator property can include the
template property that specifies configuration related to pod and
deployment templates. The topicOperator and userOperator
support various sub-properties that allow you to configure watched namespaces, reconciliation
intervals, and others.
The Entity, Topic, and User Operator are deployed by the Strimzi Cluster Operator. On successful deployment, the Cluster Operator creates an Entity Operator deployment and pod. The Topic and User Operator run within the pod in their own containers.
Deploying the Topic or User Operator as standalone components is not supported in Cloudera Streams Messaging Operator for Kubernetes.
Deploying and configuring the Strimzi Topic Operator
You deploy and configure the Strimzi Topic Operator by configuring the entityOperator property in your Kafka resource to include topicOperator properties. Deploying the Topic Operator is required if you want to manage Kafka topics with KafkaTopic resources instead of the KafkaAdmin API.
The Topic Operator enables you to manage Kafka topics using KafkaTopic resources. In Cloudera Streams Messaging Operator for Kubernetes, you deploy the Topic Operator through the Strimzi Entity Operator. The Entity and Topic Operator are both deployed by the Strimzi Cluster Operator.
To deploy the Topic Operator, you configure the entityOperator
property in your Kafka resource to include topicOperator
properties. You configure the Topic Operator by specifying additional sub-properties
in the topicOperator property.
By default, the Topic Operator watches KafkaTopic resources in the namespace of the Kafka cluster deployed by the Cluster Operator.
A single Topic Operator can watch a single namespace. One namespace should be watched by only one Topic Operator. If you are deploying multiple Kafka clusters into the same namespace, enable the Topic Operator for only one Kafka cluster.
To configure the Topic Operator to watch a namespace different from the Kafka cluster namespace, see Configuring Entity Operator to watch a different namespace.
- Strimzi must be installed in your cluster. The Strimzi Cluster Operator must be running. See Installation.
- For a full list of supported properties, see the EntityTopicOperatorSpec schema reference in the Strimzi API Reference.
Deploying and configuring the Strimzi User Operator
You deploy and configure the Strimzi User Operator by configuring the entityOperator property in your Kafka resource to include userOperator properties. Deploying the User Operator is required if you want to manage Kafka users with KafkaUser resources instead of the KafkaAdmin API.
The User Operator enables you to manage Kafka users (clients) with KafkaUser resources. In Cloudera Streams Messaging Operator for Kubernetes you deploy the User Operator through the Strimzi Entity Operator. The Entity and User Operator are both deployed by the Strimzi Cluster Operator.
To deploy the User Operator, you configure the entityOperator
property in your Kafka resource to include
userOperator properties. You configure the User Operator by
specifying additional sub-properties in the userOperator
property.
By default, the User Operator watches KafkaUser resources in the namespace of the Kafka cluster deployed by the Cluster Operator. A single User Operator can watch a single namespace. One namespace should be watched by only one User Operator.
To configure the User Operator to watch a namespace different from the Kafka cluster namespace, see Configuring Entity Operator to watch a different namespace.
- Strimzi must be installed in your cluster. The Strimzi Cluster Operator must be running. See Installation.
- For a full list of supported properties, see the EntityUserOperatorSpec schema reference in the Strimzi API Reference.
Configuring Entity Operator to watch a different namespace
Configure the Topic Operator or User Operator to watch Kafka resources in a namespace
different from the Kafka cluster namespace using the watchedNamespace
property.
By default, the Topic Operator watches KafkaTopic resources and the User Operator watches KafkaUser resources in the same namespace where the Kafka cluster is deployed. You can configure them to watch a different namespace, which is useful when you want to manage Kafka resources separately from the Kafka cluster deployment.
Each Topic Operator or User Operator instance can watch only one namespace. When configuring cross-namespace watching, the Entity Operator deployment and all related resources (ConfigMap, Secret, Role, RoleBinding) are created in the Kafka cluster namespace, but the operators watch the specified different namespace.
If you configure watchedNamespace to a different namespace without
setting STRIMZI_ENTITY_OPERATOR_WATCHED_NAMESPACE_ENABLED=true in
the Cluster Operator deployment, the Entity Operator deployment will be deleted
during reconciliation, and your topics and users will no longer be managed.
- The Cluster Operator is deployed and running.
- A Kafka cluster is deployed.
- The Entity Operator (Topic Operator and/or User Operator) is deployed in the Kafka cluster.
