- 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.
- Configure one main cluster which will be used by Gateway to store its internal state.
- Set up any number of upstream physical Kafka clusters that you want to expose through Gateway.
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.- Use a configuration file
- Use environment variables
Specify your main and upstream cluster configurations, along with a Then, mount the cluster config file in the Gateway container using the configuration
gateway.roles entry to mark the upstream clusters.cluster-config.yaml
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.- CLI
- API
Create this YAML file:Then, apply it:
mypartner.yaml
2. Alias your topics
Finally, create aliases for existing topics in the partner virtual cluster.- CLI
- API
Create this YAML file:Then, apply it:
alias-topics.yaml
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.- CLI
- API
service-accounts.yaml
mypartner-super-user.properties:
mypartner-super-user.properties
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: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.mypartner-partner-user.properties file and the correct bootstrap server details with your partner.