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

[id='con-kafka-connector-config-{context}']
= Configuring Kafka Connect connectors

[role="_abstract"]
The `KafkaConnector` resource provides a Kubernetes-native approach to management of connectors by the Cluster Operator.
To create, delete, or reconfigure connectors with `KafkaConnector` resources, you must set the `use-connector-resources` annotation to `true`  in your `KafkaConnect` custom resource.

.Annotation to enable KafkaConnectors
[source,yaml,subs="attributes+"]
----
apiVersion: {KafkaConnectApiVersion}
kind: KafkaConnect
metadata:
  name: my-connect-cluster
  annotations:
    strimzi.io/use-connector-resources: "true"
  # ...
----

When the `use-connector-resources` annotation is enabled in your `KafkaConnect` configuration, you must define and manage connectors using `KafkaConnector` resources. 

NOTE: Alternatively, you can manage connectors using the Kafka Connect REST API instead of `KafkaConnector` resources.
To use the API, you must remove the `strimzi.io/use-connector-resources` annotation to use `KafkaConnector` resources in the `KafkaConnect` the resource.

`KafkaConnector` resources provide the configuration needed to create connectors within a Kafka Connect cluster, which interacts with a Kafka cluster as specified in the `KafkaConnect` configuration. 
The Kafka cluster does not need to be managed by Strimzi or deployed to a Kubernetes cluster.

.Kafka components contained in the same Kubernetes cluster
image:overview/kafka-concepts-kafka-connector.png[Kafka and Kafka Connect clusters]

The configuration also specifies how the connector instances interact with external data systems, including any required authentication methods. Additionally, you must define the data to watch. 
For example, in a source connector that reads data from a database, the configuration might include the database name. 
You can also define where this data should be placed in Kafka by specifying the target topic name.

Use the `tasksMax` property to specify the maximum number of tasks.
For instance, a source connector with `tasksMax: 2` might split the import of source data into two tasks.

include::../../shared/snip-example-source-connector-config.adoc[]

To include external connector configurations, such as user access credentials stored in a secret, use the `template` property of the `KafkaConnect` resource.
You can also load values using xref:assembly-loading-config-with-providers-str[configuration providers]. 