Chapter 81. KafkaConnectSpec schema reference
Used in: KafkaConnect
Full list of KafkaConnectSpec schema properties
Configures a Kafka Connect cluster.
The config properties are one part of the overall configuration for the resource. Use the config properties to configure Kafka Connect options as keys.
Example Kafka Connect configuration
The values can be one of the following JSON types:
- String
- Number
- Boolean
Certain options have default values:
-
group.idwith default valueconnect-cluster -
offset.storage.topicwith default valueconnect-cluster-offsets -
config.storage.topicwith default valueconnect-cluster-configs -
status.storage.topicwith default valueconnect-cluster-status -
key.converterwith default valueorg.apache.kafka.connect.json.JsonConverter -
value.converterwith default valueorg.apache.kafka.connect.json.JsonConverter
These options are automatically configured in case they are not present in the KafkaConnect.spec.config properties.
Exceptions
You can specify and configure the options listed in the Apache Kafka documentation.
However, Streams for Apache Kafka takes care of configuring and managing options related to the following, which cannot be changed:
- Kafka cluster bootstrap address
- Security (encryption, authentication, and authorization)
- Listener and REST interface configuration
- Plugin path configuration
Properties with the following prefixes cannot be set:
-
bootstrap.servers -
consumer.interceptor.classes -
listeners. -
plugin.path -
producer.interceptor.classes -
rest. -
sasl. -
security. -
ssl.
If the config property contains an option that cannot be changed, it is disregarded, and a warning message is logged to the Cluster Operator log file. All other supported options are forwarded to Kafka Connect, including the following exceptions to the options configured by Streams for Apache Kafka:
-
Any
sslconfiguration for supported TLS versions and cipher suites
The Cluster Operator does not validate keys or values in the config object provided. If an invalid configuration is provided, the Kafka Connect cluster might not start or might become unstable. In this case, fix the configuration so that the Cluster Operator can roll out the new configuration to all Kafka Connect nodes.
81.1. Logging Copy linkLink copied to clipboard!
Kafka 3.9 and earlier versions use log4j1 for logging. For log4j1-based configuration examples, refer to the Streams for Apache Kafka 2.9 documentation.
Kafka Connect has its own preconfigured loggers:
| Logger | Description | Default Level |
|---|---|---|
|
| Default logger for all classes | INFO |
|
| Logs classpath scanning and metadata discovery used to find plugins | ERROR |
Further loggers are added depending on the Kafka Connect plugins running.
Use a curl request to get a complete list of Kafka Connect loggers running from any Kafka broker pod:
curl -s http://<connect-cluster-name>-connect-api:8083/admin/loggers/
curl -s http://<connect-cluster-name>-connect-api:8083/admin/loggers/
Kafka Connect uses the Apache log4j2 logger implementation. Use the logging property to configure loggers and logger levels.
You can set log levels using either the inline or external logging configuration types.
Specify loggers and levels directly in the custom resource for inline configuration:
Example inline logging configuration
You can define additional loggers by specifying the full class or package name using logger.<name>.name. For example, to configure logging for Kafka Connect runtime classes inline:
Example custom inline loggers
# ... logger.sourcetask.name: org.apache.kafka.connect.runtime.WorkerSourceTask logger.sourcetask.level: TRACE logger.sinktask.name: org.apache.kafka.connect.runtime.WorkerSinkTask logger.sinktask.level: DEBUG
# ...
logger.sourcetask.name: org.apache.kafka.connect.runtime.WorkerSourceTask
logger.sourcetask.level: TRACE
logger.sinktask.name: org.apache.kafka.connect.runtime.WorkerSinkTask
logger.sinktask.level: DEBUG
Alternatively, you can reference an external ConfigMap containing a complete log4j2.properties file that defines your own log4j2 configuration, including loggers, appenders, and layout configuration:
Example external logging configuration
Garbage collector (GC)
Garbage collector logging can also be enabled (or disabled) using the jvmOptions property.
81.2. KafkaConnectSpec schema properties Copy linkLink copied to clipboard!
| Property | Property type | Description |
|---|---|---|
| version | string | The Kafka Connect version. Defaults to the latest version. Consult the user documentation to understand the process required to upgrade or downgrade the version. |
| replicas | integer |
The number of pods in the Kafka Connect group. Defaults to |
| image | string |
The container image used for Kafka Connect pods. If no image name is explicitly specified, it is determined based on the |
| bootstrapServers | string | Bootstrap servers to connect to. This should be given as a comma separated list of <hostname>:_<port>_ pairs. |
| tls | TLS configuration. | |
| authentication |
| Authentication configuration for Kafka Connect. |
| config | map | The Kafka Connect configuration. Properties with the following prefixes cannot be set: ssl., sasl., security., listeners, plugin.path, rest., bootstrap.servers, consumer.interceptor.classes, producer.interceptor.classes (with the exception of: ssl.endpoint.identification.algorithm, ssl.cipher.suites, ssl.protocol, ssl.enabled.protocols). |
| resources | The maximum limits for CPU and memory resources and the requested initial resources. | |
| livenessProbe | Pod liveness checking. | |
| readinessProbe | Pod readiness checking. | |
| jvmOptions | JVM Options for pods. | |
| jmxOptions | JMX Options. | |
| logging | Logging configuration for Kafka Connect. | |
| clientRackInitImage | string |
The image of the init container used for initializing the |
| rack |
Configuration of the node label which will be used as the | |
| metricsConfig | Metrics configuration. | |
| tracing | The configuration of tracing in Kafka Connect. | |
| template |
Template for Kafka Connect and Kafka MirrorMaker 2 resources. The template allows users to specify how the | |
| externalConfiguration |
The | |
| build | Configures how the Connect container image should be built. Optional. |