7.4. Deploying Kafka Connect


Kafka Connect is an integration toolkit for streaming data between Kafka brokers and other systems using connector plugins. Kafka Connect provides a framework for integrating Kafka with an external data source or target, such as a database or messaging system, for import or export of data using connectors. Connectors are plugins that provide the connection configuration needed.

In Streams for Apache Kafka, Kafka Connect is deployed in distributed mode. Kafka Connect can also work in standalone mode, but this is not supported by Streams for Apache Kafka.

Using the concept of connectors, Kafka Connect provides a framework for moving large amounts of data into and out of your Kafka cluster while maintaining scalability and reliability.

The Cluster Operator manages Kafka Connect clusters deployed using the KafkaConnect resource and connectors created using the KafkaConnector resource.

In order to use Kafka Connect, you need to do the following.

注意

The term connector is used interchangeably to mean a connector instance running within a Kafka Connect cluster, or a connector class. In this guide, the term connector is used when the meaning is clear from the context.

7.4.1. Deploying Kafka Connect to your OpenShift cluster

This procedure shows how to deploy a Kafka Connect cluster to your OpenShift cluster using the Cluster Operator.

A Kafka Connect cluster deployment is implemented with a configurable number of nodes (also called workers) that distribute the workload of connectors as tasks so that the message flow is highly scalable and reliable.

The deployment uses a YAML file to provide the specification to create a KafkaConnect resource.

Streams for Apache Kafka provides example configuration files. In this procedure, we use the following example file:

  • examples/connect/kafka-connect.yaml
重要

If deploying Kafka Connect clusters to run in parallel, each instance must use unique names for internal Kafka Connect topics. To do this, configure each Kafka Connect instance to replace the defaults.

Procedure

  1. Deploy Kafka Connect to your OpenShift cluster. Use the examples/connect/kafka-connect.yaml file to deploy Kafka Connect.

    oc apply -f examples/connect/kafka-connect.yaml
  2. Check the status of the deployment:

    oc get pods -n <my_cluster_operator_namespace>

    Output shows the deployment name and readiness

    NAME                                 READY  STATUS   RESTARTS
    my-connect-cluster-connect-<pod_id>  1/1    Running  0

    my-connect-cluster is the name of the Kafka Connect cluster.

    A pod ID identifies each pod created.

    With the default deployment, you create a single Kafka Connect pod.

    READY shows the number of replicas that are ready/expected. The deployment is successful when the STATUS displays as Running.

7.4.2. List of Kafka Connect cluster resources

The following resources are created by the Cluster Operator in the OpenShift cluster:

<connect_cluster_name>-connect

Name given to the following Kafka Connect resources:

  • StrimziPodSet that creates the Kafka Connect worker node pods.
  • Headless service that provides stable DNS names to the Kafka Connect pods.
  • Service account used by the Kafka Connect pods.
  • Pod disruption budget configured for the Kafka Connect worker nodes.
  • Network policy managing access to the Kafka Connect REST API.
<connect_cluster_name>-connect-<pod_id>
Pods created by the Kafka Connect StrimziPodSet.
<connect_cluster_name>-connect-api
Service which exposes the REST interface for managing the Kafka Connect cluster.
<connect_cluster_name>-connect-config
ConfigMap which contains the Kafka Connect ancillary configuration and is mounted as a volume by the Kafka Connect pods.
strimzi-<namespace-name>-<connect_cluster_name>-connect-init
Cluster role binding used by the Kafka Connect cluster.
<connect_cluster_name>-connect-build
Pod used to build a new container image with additional connector plugins (only when Kafka Connect Build feature is used).
<connect_cluster_name>-connect-dockerfile
ConfigMap with the Dockerfile generated to build the new container image with additional connector plugins (only when the Kafka Connect build feature is used).
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部