6.7. Deploying Kafka Bridge


Kafka Bridge provides an API for integrating HTTP-based clients with a Kafka cluster.

6.7.1. Deploying Kafka Bridge to your OpenShift cluster

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

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

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

  • examples/bridge/kafka-bridge.yaml

Procedure

  1. Deploy Kafka Bridge to your OpenShift cluster:

    oc apply -f examples/bridge/kafka-bridge.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-bridge-bridge-<pod_id>  1/1    Running  0

    my-bridge is the name of the Kafka Bridge cluster.

    A pod ID identifies each pod created.

    With the default deployment, you install a single Kafka Bridge pod.

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

Use port forwarding to expose the Streams for Apache Kafka Bridge service to your local machine on http://localhost:8080.

注意

Port forwarding is only suitable for development and testing purposes.

Procedure

  1. List the names of the pods in your OpenShift cluster:

    oc get pods -o name
    
    pod/kafka-consumer
    # ...
    pod/my-bridge-bridge-<pod_id>
  2. Connect to the Kafka Bridge pod on port 8080:

    oc port-forward pod/my-bridge-bridge-<pod_id> 8080:8080 &
    注意

    If port 8080 on your local machine is already in use, use an alternative HTTP port, such as 8008.

API requests are now forwarded from port 8080 on your local machine to port 8080 in the Kafka Bridge pod.

6.7.3. Accessing the Kafka Bridge outside of OpenShift

After deployment, the Streams for Apache Kafka Bridge can only be accessed by applications running in the same OpenShift cluster. These applications use the <kafka_bridge_name>-bridge-service service to access the API.

If you want to make the Kafka Bridge accessible to applications running outside of the OpenShift cluster, you can expose it manually by creating one of the following features:

  • LoadBalancer or NodePort type services
  • Ingress resources (Kubernetes only)
  • OpenShift routes (OpenShift only)

If you decide to create Services, use the labels from the selector of the <kafka_bridge_name>-bridge-service service to configure the pods to which the service will route the traffic:

  # ...
  selector:
    strimzi.io/cluster: kafka-bridge-name 
1

    strimzi.io/kind: KafkaBridge
  #...
1
Name of the Kafka Bridge custom resource in your OpenShift cluster.

6.7.4. List of Kafka Bridge cluster resources

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

<bridge_cluster_name>-bridge
Deployment which is in charge to create the Kafka Bridge worker node pods.
<bridge_cluster_name>-bridge-service
Service which exposes the REST interface of the Kafka Bridge cluster.
<bridge_cluster_name>-bridge-config
ConfigMap which contains the Kafka Bridge ancillary configuration and is mounted as a volume by the Kafka broker pods.
<bridge_cluster_name>-bridge
Pod Disruption Budget configured for the Kafka Bridge worker nodes.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

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

让开源更具包容性

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

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部