test: add PrivateLink cloudtest with Toxiproxy simulation#36162
Draft
jubrad wants to merge 2 commits intoMaterializeInc:mainfrom
Draft
test: add PrivateLink cloudtest with Toxiproxy simulation#36162jubrad wants to merge 2 commits intoMaterializeInc:mainfrom
jubrad wants to merge 2 commits intoMaterializeInc:mainfrom
Conversation
aba16f6 to
c34f80c
Compare
6 tasks
Introduces two new SQL constructs for Kafka PrivateLink connections:
- `BOOTSTRAP BROKER 'addr' USING AWS PRIVATELINK conn (...)` — provides
the initial bootstrap address with an explicit PrivateLink tunnel. The
bootstrap address is used as `bootstrap.servers` and the real hostname
is preserved for correct TLS SNI.
- `MATCHING 'pattern' USING AWS PRIVATELINK conn (...)` inside `BROKERS`
— pattern-based routing rules for dynamically discovered brokers.
After the initial metadata fetch, Kafka returns broker addresses that
may differ from the bootstrap address (e.g., AZ-specific hostnames).
MATCHING rules route these through the correct PrivateLink endpoint.
This replaces the `AWS PRIVATELINKS` syntax which used exact-match
patterns for dual-purpose bootstrap/routing and a separate `TO` keyword
inconsistent with the existing `USING AWS PRIVATELINK` syntax.
Example:
```sql
CREATE CONNECTION kafka TO KAFKA (
BOOTSTRAP BROKER 'lkc-825730.endpoint.cloud:9092'
USING AWS PRIVATELINK pl_conn (AVAILABILITY ZONE 'use1-az1'),
BROKERS (
MATCHING '*use1-az1*' USING AWS PRIVATELINK pl_conn (AVAILABILITY ZONE 'use1-az1'),
MATCHING '*use1-az4*' USING AWS PRIVATELINK pl_conn (AVAILABILITY ZONE 'use1-az4')
),
SASL MECHANISMS 'PLAIN',
SASL USERNAME 'key',
SASL PASSWORD SECRET secret,
SECURITY PROTOCOL 'SASL_SSL'
);
```
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds cloudtest infrastructure for testing Kafka PrivateLink connections using Toxiproxy as a network proxy to simulate VPC endpoint routing. Includes two tests: - `test_privatelink_e2e_connectivity`: validates basic connectivity through a simulated PrivateLink path, tests failure detection when the proxy is disabled, and recovery when re-enabled. - `test_privatelink_pattern_matching`: patches Redpanda to advertise an AZ-specific broker address, then verifies that MATCHING rules route post-metadata traffic through the AZ-specific proxy. The default proxy is disabled after bootstrap to prove pattern matching works. Also adds `doc/developer/testing-confluent-privatelink.md` with a step-by-step guide for manual testing against Confluent Cloud PrivateLink using a scratch VM with dnsmasq DNS overrides. Fixes the cloudtest `reset` script to clean up configmaps and vpcendpoints. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c34f80c to
9abc2ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Depends on #36161. Merge that first.
test_privatelink_e2e_connectivity: validates connectivity through simulated PrivateLink, failure detection when proxy is disabled, and recoverytest_privatelink_pattern_matching: patches Redpanda with AZ-specific advertised address, then proves MATCHING rules route post-metadata traffic through the correct AZ-specific proxy by disabling the default proxy after bootstrapdoc/developer/testing-confluent-privatelink.md: step-by-step guide for manual testing against Confluent Cloud PrivateLink using a scratch VM with dnsmasq DNS overridesTest plan
./pytest --dev -k test_privatelink_e2e_connectivity./pytest --dev -k test_privatelink_pattern_matching🤖 Generated with Claude Code