此内容没有您所选择的语言版本。

Chapter 16. GenericKafkaListenerConfigurationBroker schema reference


Used in: GenericKafkaListenerConfiguration

Full list of GenericKafkaListenerConfigurationBroker schema properties

Configures broker settings for listeners.

Example configuration for the host, nodePort, loadBalancerIP, and annotations properties is shown in the GenericKafkaListenerConfiguration schema section.

16.1. Overriding advertised addresses for brokers

By default, Streams for Apache Kafka tries to automatically determine the hostnames and ports that your Kafka cluster advertises to its clients. This is not sufficient in all situations, because the infrastructure on which Streams for Apache Kafka is running might not provide the right hostname or port through which Kafka can be accessed.

You can specify a broker ID and customize the advertised hostname and port in the configuration property of the listener. Streams for Apache Kafka will then automatically configure the advertised address in the Kafka brokers and add it to the broker certificates so it can be used for TLS hostname verification. Overriding the advertised host and ports is available for all types of listeners.

Example of an external route listener configured with overrides for advertised addresses

listeners:
  #...
  - name: external1
    port: 9094
    type: route
    tls: true
    configuration:
      brokers:
      - broker: 0
        advertisedHost: example.hostname.0
        advertisedPort: 12340
      - broker: 1
        advertisedHost: example.hostname.1
        advertisedPort: 12341
      - broker: 2
        advertisedHost: example.hostname.2
        advertisedPort: 12342
# ...
Copy to Clipboard Toggle word wrap

Instead of specifying the advertisedHost field for every broker, you can also use an advertisedHostTemplate to generate them automatically. The advertisedHostTemplate supports the following variables:

  • The {nodeId} variable is replaced with the ID of the Kafka node to which the template is applied.
  • The {nodePodName} variable is replaced with the OpenShift pod name for the Kafka node where the template is applied.

Example route listener with advertisedHostTemplate configuration

listeners:
  #...
  - name: external1
    port: 9094
    type: route
    tls: true
    configuration:
      advertisedHostTemplate: example.hostname.{nodeId}
# ...
Copy to Clipboard Toggle word wrap

Expand
PropertyProperty typeDescription

broker

integer

ID of the kafka broker (broker identifier). Broker IDs start from 0 and correspond to the number of broker replicas.

advertisedHost

string

The host name used in the brokers' advertised.listeners.

advertisedPort

integer

The port number used in the brokers' advertised.listeners.

host

string

The broker host. This field will be used in the Ingress resource or in the Route resource to specify the desired hostname. This field can be used only with route (optional) or ingress (required) type listeners.

nodePort

integer

Node port for the per-broker service. This field can be used only with nodeport type listener.

loadBalancerIP

string

The loadbalancer is requested with the IP address specified in this field. This feature depends on whether the underlying cloud provider supports specifying the loadBalancerIP when a load balancer is created. This field is ignored if the cloud provider does not support the feature.This field can be used only with loadbalancer type listener.

annotations

map

Annotations that will be added to the Ingress or Service resource. You can use this field to configure DNS providers such as External DNS. This field can be used only with loadbalancer, nodeport, or ingress type listeners.

labels

map

Labels that will be added to the Ingress, Route, or Service resource. This field can be used only with loadbalancer, nodeport, route, or ingress type listeners.

externalIPs

string array

External IPs associated to the nodeport service. These IPs are used by clients external to the OpenShift cluster to access the Kafka brokers. This field is helpful when nodeport without externalIP is not sufficient. For example on bare-metal OpenShift clusters that do not support Loadbalancer service types. This field can only be used with nodeport type listener.

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat