feat: in-cluster backend-reachability helm test (WS3 / cli#90)#270
Merged
Conversation
Adds `egress-reachability-check`, a `helm test` Job that verifies a normal (non-training) pod in the namespace can reach the tracebloc backend API — the egress dependency that gates everything (the cluster authenticates to the backend to obtain its Service Bus credentials, so no backend egress => silent Pending). The required-egress complement to egress-enforcement-check (which verifies the opposite: that training pods are locked out). The probe is deliberately NOT training-labelled (so the lockdown netpol never selects it — it keeps the jobs-manager/requests-proxy egress class) and honours tracebloc.proxyEnv, so it tests the real path. The verdict keys on curl's exit code (TCP reachability), not HTTP status. Run via `helm test <release>`; gated by egressReachabilityCheck.enabled (default true; disable on truly air-gapped clusters). As a test hook it never runs during install/upgrade. Service Bus is intentionally not probed here: its host is fetched post-auth from the backend (static nowhere in the chart) and its egress is brokered by the requests-proxy, whose readiness `tracebloc cluster doctor` already checks. helm-unittest: 6 tests (render / disable / test-hook annotation / not-training- labelled / CLIENT_ENV-driven host / proxy-inherited). Full chart suite green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 tasks
aptracebloc
approved these changes
Jun 22, 2026
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.
What
Adds
egress-reachability-check— ahelm testJob that verifies a normal (non-training) pod in the namespace can reach the tracebloc backend API from inside the cluster.This is the in-cluster egress probe tracked as the last item of tracebloc/cli#90 (WS3, epic client-runtime#116). Run it with
helm test <release>.Why it lives here (and not in
tracebloc cluster doctor)Scoping cli#90 surfaced two things:
helm testJob (egress-enforcement-check). So this is its required-egress sibling — andtracebloc cluster doctorstays read-only.doctor's host-sideBackend egresscheck probes from the CLI machine; this probes from inside the cluster, on the real egress path.Design
helm testhook Job (curl image, PSA-restricted,ttlSecondsAfterFinished), mirroringegress-enforcement-check— but the inverse verdict: reachable = PASS.tracebloc.io/workload: training-labelled, so the lockdown NetworkPolicy never selects it — it keeps the jobs-manager / requests-proxy egress class (the pods that actually reach the backend).tracebloc.proxyEnv, so it tests the real path (through the corporate proxy when configured).6DNS /7refused /28timeout → FAIL with specific guidance; anything else → reachable.CLIENT_ENV(dev/stg/prod). Gated byegressReachabilityCheck.enabled(defaulttrue, nil-safe viadigfor--reuse-values; setfalseon truly air-gapped clusters). As a test hook it never runs during install/upgrade.Out of scope
Service Bus isn't probed directly — its host is fetched post-auth (not static) and its egress is brokered by the requests-proxy, whose readiness
tracebloc cluster doctoralready checks. Backend reachability is the prerequisite for both (the cluster authenticates to the backend to get the SB creds).Testing
helm unittest ./client— 6 new tests (renders / disabled / test-hook annotation / not-training-labelled /CLIENT_ENV-driven host / proxy-inherited) and the full chart suite green (25 suites, 264 tests).🤖 Generated with Claude Code
Note
Low Risk
Diagnostic-only
helm testhook with no change to install/upgrade or workload runtime unless operators run the test.Overview
Adds
egress-reachability-check, ahelm testJob that curls the tracebloc backend from a non-training pod (same egress path as jobs-manager / requests-proxy, including corporate proxy viatracebloc.proxyEnv). Pass means TCP/TLS to the API host succeeds; failure messages map curl exit codes (DNS, refused, timeout, proxy resolution).egressReachabilityCheck.enableddefaults totrueinvalues.yaml(disable for air-gapped installs). The hook runs only onhelm test, not on install/upgrade. Six helm unittest cases cover rendering, the flag, test-hook annotation, absence of the training workload label,CLIENT_ENVhost selection, and proxy env inheritance.Reviewed by Cursor Bugbot for commit 26ed27a. Bugbot is set up for automated code reviews on this repo. Configure here.