Skip to content

Commit 22924ac

Browse files
fix(local): restore metallb e2e path (#65)
* fix(local): restore metallb e2e path Signed-off-by: Frank Spitulski <fspitulski@nvidia.com> * fix(local): keep cli broker defaults local Signed-off-by: Frank Spitulski <fspitulski@nvidia.com> * fix(local): narrow localhost defaults Signed-off-by: Frank Spitulski <fspitulski@nvidia.com> --------- Signed-off-by: Frank Spitulski <fspitulski@nvidia.com>
1 parent ed87d51 commit 22924ac

13 files changed

Lines changed: 135 additions & 211 deletions

File tree

docs/integrator-quickstart.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,21 @@ Set the broker endpoint, authentication material, and topic configuration you
4747
received from the operator in your application configuration.
4848

4949
If you are using the local evaluation environment and it is already deployed,
50-
start the broker port forwards in one terminal and leave that terminal open
51-
while you test. The script starts `kubectl port-forward` processes, then opens a
52-
shell. The port forwards stop when you exit that shell. To create the local
53-
broker first, use the [Deployment](getting-started.md) evaluation install.
50+
connect to the CSC Envoy Gateway at its MetalLB address. To create the local
51+
broker first, use the [Deployment](getting-started.md) evaluation install. On
52+
macOS, install and start `docker-mac-net-connect` from the local quick start so
53+
the host can reach the MetalLB IPs.
5454

5555
```bash
5656
cd local
57-
./infra/scripts/with-gateway-port-forwards.sh sh
57+
make setup-infra deploy-nats
5858
```
5959

60-
In the shell opened by that script, or in another terminal while that shell stays
61-
open, use the local CSC broker endpoint:
60+
Use the local CSC broker endpoint:
6261

6362
```bash
64-
export DSX_MQTT_HOST=127.0.0.1
65-
export DSX_MQTT_PORT=11883
63+
export DSX_MQTT_HOST=172.18.200.1
64+
export DSX_MQTT_PORT=1883
6665
export DSX_MQTT_TOPIC=test/hello
6766
```
6867

docs/testing.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ The local environment includes MQTT benchmark tooling for smoke runs and
1919
operator-driven benchmark runs. These tests report the observed behavior of the
2020
current deployment; they do not define product targets.
2121

22-
**Prerequisite:** Performance and benchmark targets require MetalLB or an equivalent LoadBalancer (installed by `make setup-infra`). Without it, `kubectl port-forward` cannot sustain benchmark throughput and tests fail silently.
22+
**Prerequisite:** Performance and benchmark targets require MetalLB or an
23+
equivalent LoadBalancer installed by `make setup-infra`. On macOS, start
24+
`docker-mac-net-connect` so the host can reach the MetalLB IPs. Linux hosts
25+
normally reach the Docker bridge IPs directly.
26+
27+
Full benchmark targets are sensitive to local host capacity. When they report
28+
EOFs, readloop stalls, or success-rate misses, capture host CPU and Kubernetes
29+
pod metrics with the run; the smoke targets are the portable local validation
30+
path.
2331

2432
The MQTT performance suite exercises combinations of QoS level, retention, and
2533
deployment topology:

llms-full.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,10 @@ kubectl delete ns dsx --ignore-not-found
550550

551551
## Local Benchmark Tooling
552552

553-
**Prerequisite:** Performance and benchmark targets require MetalLB or an equivalent LoadBalancer (installed by `make setup-infra`). Without it, `kubectl port-forward` cannot sustain benchmark throughput and tests fail silently.
553+
**Prerequisite:** Performance and benchmark targets require MetalLB or an
554+
equivalent LoadBalancer installed by `make setup-infra`. On macOS, start
555+
`docker-mac-net-connect` so the host can reach the MetalLB IPs. Linux hosts
556+
normally reach the Docker bridge IPs directly.
554557

555558
The MQTT performance suite exercises combinations of QoS level, retention, and deployment topology (local and federated, both directions).
556559

@@ -581,9 +584,11 @@ Most software integrations should use OAuth2. BMS, OT, and device integrations c
581584

582585
## Connection Settings
583586

587+
Use the local CSC broker endpoint:
588+
584589
```bash
585-
export DSX_MQTT_HOST=127.0.0.1
586-
export DSX_MQTT_PORT=11883
590+
export DSX_MQTT_HOST=172.18.200.1
591+
export DSX_MQTT_PORT=1883
587592
export DSX_MQTT_TOPIC=test/hello
588593
```
589594

local/Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
PERFORMANCE_E2E_ENV ?= PERF_TEST_PAIRS=1 PERF_TEST_DURATION=2s PERF_TEST_WARMUP=1s PERF_PUBLISH_DELAY=5ms PERF_MIN_SUCCESS_RATE=99
77
BENCHMARK_BASIC_FLAGS ?= --duration 5s --connection-clients 50 --connection-rate 25 --fanout-subscribers 20 --p2p-clients 20 --fanin-publishers 20 --fanin-subscribers 3 --fanin-topics 20
8+
CSC_BROKER_URL ?= tcp://172.18.200.1:1883
89
GO_PATH ?= $(shell go env GOPATH 2>/dev/null)
910
GO_BIN ?= $(shell go env GOBIN 2>/dev/null)
1011
E2E_PREREQS_BIN ?= $(if $(GO_BIN),$(GO_BIN),$(if $(GO_PATH),$(GO_PATH)/bin,$(HOME)/.local/bin))
@@ -110,13 +111,13 @@ check-e2e-env: ## Check local Kind/NATS prerequisites for e2e tests
110111
done
111112

112113
test-functional: check-e2e-env ## Run functional tests (MQTT + federation)
113-
./infra/scripts/with-gateway-port-forwards.sh sh -c 'cd mqtt-client && go test -count=1 -v ./tests/functional/ -timeout 60s'
114+
cd mqtt-client && go test -count=1 -v ./tests/functional/ -timeout 60s
114115

115116
test-performance: check-e2e-env ## Run performance e2e smoke tests
116-
./infra/scripts/with-gateway-port-forwards.sh sh -c 'cd mqtt-client && $(PERFORMANCE_E2E_ENV) go test -count=1 -v ./tests/performance/ -timeout 10m'
117+
cd mqtt-client && $(PERFORMANCE_E2E_ENV) go test -count=1 -v ./tests/performance/ -timeout 10m
117118

118119
dummy-bms: check-e2e-env ## Publish looping dummy BMS data to the CSC MQTT broker
119-
./infra/scripts/with-gateway-port-forwards.sh sh -c 'cd mqtt-client && go run ./cmd/dummy-bms --broker "$$CSC_BROKER_URL" --csv examples/dsx_exemplar.csv --schema ../../schemas/asyncapi/bms/bms.yaml'
120+
cd mqtt-client && go run ./cmd/dummy-bms --broker "$(CSC_BROKER_URL)" --csv examples/dsx_exemplar.csv --schema ../../schemas/asyncapi/bms/bms.yaml
120121

121122
validate-nats: ## Validate NATS deployment on all clusters
122123
@echo "Validating CSC..."
@@ -156,10 +157,10 @@ lint: ## Run linters
156157
# ============================================================================
157158

158159
benchmark-basic: check-e2e-env ## Run MQTT benchmark basic suite
159-
./infra/scripts/with-gateway-port-forwards.sh sh -c 'cd mqttbs && go run ./cmd/mqttbs run basic-suite --broker "$$CSC_BROKER_URL" $(BENCHMARK_BASIC_FLAGS)'
160+
cd mqttbs && go run ./cmd/mqttbs run basic-suite --broker "$(CSC_BROKER_URL)" $(BENCHMARK_BASIC_FLAGS)
160161

161162
benchmark-basic-full: check-e2e-env ## Run full MQTT benchmark basic suite
162-
./infra/scripts/with-gateway-port-forwards.sh sh -c 'cd mqttbs && go run ./cmd/mqttbs run basic-suite --broker "$$CSC_BROKER_URL"'
163+
cd mqttbs && go run ./cmd/mqttbs run basic-suite --broker "$(CSC_BROKER_URL)"
163164

164165
benchmark-performance: check-e2e-env ## Run full performance benchmarks
165-
./infra/scripts/with-gateway-port-forwards.sh sh -c 'cd mqtt-client && go test -count=1 -v ./tests/performance/ -timeout 10m'
166+
cd mqtt-client && go test -count=1 -v ./tests/performance/ -timeout 10m

local/README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,23 @@ make deploy-nats
5757

5858
### Run Tests
5959

60-
Performance and benchmark targets require MetalLB (installed by `make setup-infra`). Without it, `kubectl port-forward` is used as a fallback but cannot sustain benchmark throughput — tests fail silently with connectivity errors that do not indicate the root cause.
60+
Performance and benchmark targets require MetalLB, installed by
61+
`make setup-infra`, so local clients connect through the Envoy Gateway
62+
LoadBalancer IPs. On macOS, keep `docker-mac-net-connect` running so the host can
63+
reach those IPs. Linux hosts normally reach the Docker bridge IPs directly.
64+
65+
The default CSC broker endpoint is `tcp://172.18.200.1:1883`. Override
66+
`CSC_BROKER_URL` only when testing a different reachable broker.
67+
68+
Full benchmark targets can saturate local hosts because they drive thousands of
69+
MQTT clients through Kind, Envoy Gateway, NATS, and auth-callout. If a full run
70+
fails with EOFs or success-rate misses, check host CPU and pod metrics before
71+
treating it as a networking failure.
6172

6273
```bash
74+
# Verify host access to the CSC Envoy Gateway after NATS is deployed
75+
nc -vz 172.18.200.1 1883
76+
6377
# Run functional tests against all candidates
6478
make test-functional
6579

@@ -169,6 +183,6 @@ Run against the local Kind environment:
169183
make dummy-bms
170184
```
171185

172-
The dummy BMS target uses the same local e2e environment and gateway
173-
port-forward setup as the functional and performance tests. It publishes to the
174-
CSC broker URL exported by that wrapper.
186+
The dummy BMS target uses the same local e2e environment and Envoy Gateway
187+
LoadBalancer path as the functional and performance tests. It publishes to the
188+
CSC broker at `tcp://172.18.200.1:1883` unless `CSC_BROKER_URL` is overridden.

local/infra/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ The infrastructure consists of:
1515

1616
## Quick Start
1717

18+
On macOS, install and start `docker-mac-net-connect` before running local tests
19+
from the host. Linux hosts normally reach the Docker bridge IPs directly. See
20+
[local/README.md](../README.md#macos-tweaks).
21+
1822
```bash
1923
# Setup complete infrastructure (clusters, MetalLB, Envoy Gateway, cert-manager, metrics-server, Keycloak)
2024
# All operations are parallelized across clusters for maximum speed:
@@ -29,6 +33,9 @@ make setup-infra
2933
# Verify everything is running
3034
make verify-infra
3135

36+
# Verify the host can reach the CSC Keycloak HTTPRoute through Envoy Gateway
37+
curl http://172.18.200.1/realms/event-bus/.well-known/openid-configuration
38+
3239
# Optional: Deploy full observability stack (Prometheus + Grafana)
3340
make setup-observability
3441
```
@@ -171,12 +178,12 @@ Kubernetes Metrics Server provides resource metrics (CPU/memory) for nodes and p
171178
kubectl top nodes --context kind-csc
172179

173180
# View pod metrics
174-
kubectl top pods -n event-bus-nats --context kind-csc
181+
kubectl top pods -n event-bus --context kind-csc
175182
```
176183

177184
## Keycloak (OAuth2 Authentication)
178185

179-
Keycloak provides OAuth2/OpenID Connect authentication for testing the event bus auth callout service. A single Keycloak instance runs in the CSC cluster, and all clusters (CSC, CPC-1, CPC-2) access it via the external MetalLB LoadBalancer IP (172.18.200.1). Host-side tests use localhost port-forwarding because Docker-network LoadBalancer IPs are not reachable from every workstation environment.
186+
Keycloak provides OAuth2/OpenID Connect authentication for testing the event bus auth callout service. A single Keycloak instance runs in the CSC cluster, and all clusters (CSC, CPC-1, CPC-2) access it via the external MetalLB LoadBalancer IP (172.18.200.1). Host-side local tests use the same Envoy Gateway path.
180187

181188
**Deployment:**
182189

@@ -199,18 +206,11 @@ make setup-keycloak
199206

200207
**Access:**
201208

202-
Keycloak is exposed via Envoy Gateway HTTPRoute on port 80 at the CSC cluster's MetalLB LoadBalancer IP: `172.18.200.1`. All clusters access Keycloak at this address. From the host, prefer `make test-functional` or `make test-performance`; those targets port-forward Keycloak to `http://127.0.0.1:18080` automatically.
209+
Keycloak is exposed via Envoy Gateway HTTPRoute on port 80 at the CSC cluster's MetalLB LoadBalancer IP: `172.18.200.1`. On macOS, keep `docker-mac-net-connect` running so the host can reach this address. Linux hosts normally reach the Docker bridge IPs directly.
203210

204211
```bash
205-
# Verify Keycloak from inside the Docker network
206-
curl http://172.18.200.1/realms/event-bus/.well-known/openid-configuration
207-
208212
# Verify Keycloak from the host
209-
kubectl port-forward -n envoy-gateway-system svc/$(kubectl get svc \
210-
--context kind-csc -n envoy-gateway-system \
211-
-l gateway.envoyproxy.io/owning-gateway-name=shared-gateway \
212-
-o jsonpath='{.items[0].metadata.name}') 18080:80 --context kind-csc
213-
curl http://127.0.0.1:18080/realms/event-bus/.well-known/openid-configuration
213+
curl http://172.18.200.1/realms/event-bus/.well-known/openid-configuration
214214
```
215215

216216
**Token Endpoint (all clusters):**
@@ -512,7 +512,7 @@ kubectl get servicemonitor -A --context kind-csc
512512
# Access Prometheus UI and check Status -> Targets
513513

514514
# Verify service labels match ServiceMonitor selector
515-
kubectl get svc -n event-bus-nats -o yaml --context kind-csc
515+
kubectl get svc -n event-bus -o yaml --context kind-csc
516516
```
517517

518518
## Cleanup

local/infra/scripts/with-gateway-port-forwards.sh

Lines changed: 0 additions & 130 deletions
This file was deleted.

0 commit comments

Comments
 (0)