// Module included in the following assemblies:
//
// assembly-kafka-broker-external-listeners-routes.adoc

[id='con-kafka-broker-external-listeners-routes-{context}']

= Exposing Kafka using OpenShift `Routes`

When exposing Kafka using OpenShift `Routes`  and the HAProxy router, a dedicated `Route` is created for every Kafka broker pod.
An additional `Route` is created to serve as a Kafka bootstrap address.
Kafka clients can use these `Routes` to connect to Kafka on port 443.

TLS encryption is always used with `Routes`.

By default, the route hosts are automatically assigned by OpenShift.
However, you can override the assigned route hosts by specifying the requested hosts in the `overrides` property.
{ProductName} will not perform any validation that the requested hosts are available; you must ensure that they are free and can be used.

.Example of an external listener of type `routes` configured with overrides for OpenShift route hosts
[source,yaml,subs="attributes+"]
----
# ...
listeners:
  external:
    type: route
    authentication:
      type: tls
    overrides:
      bootstrap:
        host: bootstrap.myrouter.com
      brokers:
      - broker: 0
        host: broker-0.myrouter.com
      - broker: 1
        host: broker-1.myrouter.com
      - broker: 2
        host: broker-2.myrouter.com
# ...
----

For more information on using `Routes` to access Kafka, see xref:proc-accessing-kafka-using-routes-{context}[].
