Overview
This guide explains how to expose an Amazon MSK cluster to ClickPipes with AWS PrivateLink VPC endpoint services. Use this approach when MSK multi-VPC connectivity is not available or not sufficient, for example:- Cross-region connectivity from ClickPipes to MSK.
- MSK Express clusters.
- Kafka setups that must preserve broker hostnames over private connectivity.
How the setup works
Kafka clients first connect to bootstrap brokers, fetch cluster metadata, and then connect directly to the broker hostnames advertised in that metadata. For that reason, a single load balancer in front of all brokers is not sufficient for a reliable MSK PrivateLink setup. Instead, create one PrivateLink path per broker:- Internal Network Load Balancer (NLB).
- IP target group that targets the broker private IP.
- VPC endpoint service backed by that NLB.
- ClickPipes reverse private endpoint (RPE).
- Custom private DNS name matching that broker hostname.
Requirements
- An MSK cluster in private subnets.
- Broker hostnames and private IP addresses for the MSK cluster.
- Permission to create NLBs, target groups, listeners, and VPC endpoint services in the MSK VPC.
- The ClickPipes AWS account principal allowed on each VPC endpoint service:
arn:aws:iam::072088201116:root. - The custom private DNS feature enabled for your ClickHouse Cloud service. Contact ClickHouse support if the
Custom private DNS namefield is not available when creating a reverse private endpoint.
Get broker hostnames and private IPs
Use the AWS CLI to list MSK broker nodes:9098.
The ClickPipe will use these broker hostnames as its Kafka brokers. Do not use the MSK bootstrap broker string for this UI-based setup.
Create one endpoint service per broker
Repeat these steps for each MSK broker.Create an internal NLB
Create an internal Network Load Balancer in the MSK VPC. The NLB should use private subnets and must not be internet-facing. If a security group is attached to the NLB, disableEnforce Security Group Inbound Rules on Private Link Traffic. This is required to allow traffic from the ClickPipes VPC endpoint to reach the NLB.
Create an IP target group
Create a target group with:- Target type:
IP. - Protocol:
TCP. - Port: the broker Kafka port, for example
9098for MSK IAM. - Target: the private IP address of exactly one broker.
Create a TCP listener
Create an NLB listener on the broker Kafka port and forward traffic to the broker-specific target group.Create the VPC endpoint service
Create a VPC endpoint service backed by the broker-specific NLB. Add the ClickPipes AWS principal to the allowed principals:Create ClickPipes reverse private endpoints
In the ClickHouse Cloud console, create one reverse private endpoint for each broker endpoint service:- Go to your ClickHouse Cloud service.
- Start creating a ClickPipe.
- Choose
Reverse private endpoint. - Choose
VPC endpoint serviceas the VPC endpoint type. - Enter the broker-specific VPC endpoint service name.
- In
Custom private DNS name, enter the original MSK broker hostname for that broker. - Create the endpoint.
- If the endpoint is pending acceptance, accept the endpoint connection request in the AWS VPC endpoint service console.
type set to VPC_ENDPOINT_SERVICE, the broker-specific VPC endpoint service name, and one custom private DNS mapping for the broker hostname:
clickhouse_clickpipes_reverse_private_endpoint to create the endpoint and clickhouse_clickpipes_reverse_private_endpoint_custom_private_dns to configure the broker hostname mapping.
Create the Kafka ClickPipe
Follow the ClickPipes AWS PrivateLink guide to create the ClickPipe with reverse private endpoints. When creating the Kafka ClickPipe:- Use the original MSK broker hostnames as the broker list, including the port used by your MSK listener and authentication method.
- Do not use the MSK bootstrap broker string.
- Select or attach all broker-specific reverse private endpoints.
- Configure the authentication method required by your MSK cluster, such as IAM role authentication.
9098, SASL/SCRAM commonly uses 9096, and TLS commonly uses 9094. Confirm the correct port from your MSK cluster configuration or bootstrap broker output.
Example broker list:
Custom private DNS name configured on one of the RPEs.