Attention: This version of Event Streams has reached End of Support. For more information about supported versions, see the support matrix.

Kafka cluster is not accessible by using OpenShift routes

Symptoms

If Event Streams is installed on Red Hat OpenShift Container Platform, Kafka clients receive timeout errors when trying to connect to the instance by using the address provided in the Event Streams UI and CLI. The following is an example error message:

org.apache.kafka.common.errors.TimeoutException: Topic <topicName> not present in metadata after 60000 ms

Causes

Event Streams deploys OpenShift Container Platform routes. When the hostname of the OpenShift Container Platform cluster is too long, the generated route addresses are truncated. This causes incorrect routing of the connection within Event Streams.

The following table provides an example. The output of the oc get routes command shows that the NAME of the route is not the same as the prefix for the HOST/PORT address.

NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
<releaseName>-ibm-es-proxy-route-bootstrap -ibm-es-proxy-route-bootstrap-eventstream-persistence.   <releaseName>-ibm-es-proxy-svc bootstrap passthrough/None None
<releaseName>-ibm-es-proxy-route-broker-0 -ibm-es-proxy-route-broker-0-eventstream-persistence.   <releaseName>-ibm-es-proxy-svc brk0-external passthrough/None None
<releaseName>-ibm-es-proxy-route-broker-1 -ibm-es-proxy-route-broker-1-eventstream-persistence.   <releaseName>-ibm-es-proxy-svc brk1-external passthrough/None None
<releaseName>-ibm-es-proxy-route-broker-2 -ibm-es-proxy-route-broker-2-eventstream-persistence.   <releaseName>-ibm-es-proxy-svc brk2-external passthrough/None None

Resolving the problem

The issue is resolved in Event Streams 10.0 and later versions.

The workaround for 2019.4 versions is as follows:

  1. Edit the ConfigMap <releaseName>-ibm-es-proxy-cm, for example:

    oc edit cm <releaseName>-ibm-es-proxy-cm -n <namespace>

  2. Change bootstrapRoutePrefix from <releaseName>-ibm-es-proxy-route-bootstrap to <truncatedAddress>-ibm-es-proxy-route-bootstrap
  3. Change brokerRoutePrefix from <releaseName>-ibm-es-proxy-route-broker- to <truncatedAddress>-ibm-es-proxy-route-broker-

    Important: The trailing hyphen at the end is required.

  4. Remove the externalListeners entry from the map.
  5. Increase the revision value by 1.
  6. Save the changes to the ConfigMap.