Skip to main content
Gateway can be configured to communicate with multiple Kafka clusters and expose their topics to your partners. You can:
  • direct partners to a single endpoint,
  • provide them with access to topics in multiple Kafka clusters and
  • expose topics using aliases that can be different from actual topic names.
To set up Gateway to support multi-clusters, you should:
  1. Configure one main cluster which will be used by Gateway to store its internal state.
  2. Set up any number of upstream physical Kafka clusters that you want to expose through Gateway.
If you’re using partner virtual clusters to share data with external third parties, be aware that cluster IDs (e.g., clusterA, clusterB) may appear in the bootstrap server address or client logs.To prevent unintended exposure, avoid using sensitive names/information in cluster IDs.

Choose a routing strategy

For production deployments with multiple clusters, use SNI routing on your listeners. With port routing, Gateway assigns a fixed port to every broker across all clusters, so adding or removing a cluster shifts those port assignments and can break existing client connections. SNI routing instead distinguishes brokers by hostname, so adding or removing a cluster leaves other clients unaffected. Port routing remains a simpler choice for development and test environments — or anywhere you can update client bootstrap servers and restart clients when the set of clusters changes. Configure listeners.

Configure the clusters

Define your main and upstream clusters using either a configuration file or environment variables.
Specify your main and upstream cluster configurations, along with a gateway.roles entry to mark the upstream clusters.
cluster-config.yaml
Then, mount the cluster config file in the Gateway container using the configuration GATEWAY_BACKEND_KAFKA_SELECTOR:

Partner virtual clusters

These steps are for setting up a partner virtual cluster manually. Alternatively, to simplify the process, we recommend creating a Partner Zone which supports multi-clusters. You can also Check out the tutorial on creating Partner Zones with multi-cluster Gateway.

1. Create a partner virtual cluster

First, create a new partner virtual cluster.
For partner virtual clusters, aclEnabled has to be true and superUsers must not be empty.
Create this YAML file:
mypartner.yaml
Then, apply it:

2. Alias your topics

Finally, create aliases for existing topics in the partner virtual cluster.
Alias topics within a partner virtual cluster can only point to topics from the same physical cluster.
Create this YAML file:
alias-topics.yaml
Then, apply it:

3. Create service accounts

Once the virtual cluster is created and contains the topics to expose to your partners, you’ll need to create service accounts and configure ACLs (Access Control Lists). Create two service accounts for the partner virtual cluster: one super user and one partner user. The super user will manage ACLs and grant permissions to the partner user, who will use their account to access the exposed topics.
service-accounts.yaml
Then, apply it:
In order to connect to Gateway using these service accounts, you need to get their associated password.
Put the admin credentials in a file called mypartner-super-user.properties:
mypartner-super-user.properties
And the partner credentials in a file called mypartner-partner-user.properties:
mypartner-partner-user.properties

4. Create ACLs for the service accounts

Before creating ACLs, you need to know how to reach this partner virtual cluster. For that, make the following request:
This will return something like this, with the bootstrap address and client properties:
From there, you have everything you need to create ACLs for the partner service accounts:

5. Test partner virtual cluster access

Now that the partner user has the correct ACLs, you can use their credentials to interact with the alias topics and verify that the permissions are correctly set.
Once confirmed, simply share the mypartner-partner-user.properties file and the correct bootstrap server details with your partner.