此内容没有您所选择的语言版本。
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
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
| Property | Property type | Description |
|---|---|---|
| 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' |
| advertisedPort | integer |
The port number used in the brokers' |
| 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 |
| nodePort | integer |
Node port for the per-broker service. This field can be used only with |
| 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 |
| annotations | map |
Annotations that will be added to the |
| labels | map |
Labels that will be added to the |
| 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 |