Skip to content

Fix isolation probe retries and PR intercept serving - #109

Merged
jmjava merged 30 commits into
mainfrom
fix/post-deploy-checks
Sep 28, 2026
Merged

jmjava merged 30 commits into
mainfrom
fix/post-deploy-checks

Conversation

@jmjava

@jmjava jmjava commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Isolation probes restart a port-forward that dies on the first refused connection, until the existing deadline. The nightly inventory-api intercept cell was failing because kubectl exits when the router has not bound 8080 yet.
  • Telepresence and mirrord PR pods run the built image instead of a sleep loop, so header-matched traffic hits a process that can answer.
  • The Vue sample (and jmjava/tekton-dag-vue-fe main, 7043747) serves GET /propagation as a hop report that keeps the original override. Both intercept jobs were failing because that response was the SPA HTML and did not contain pr-73.

Test plan

  • python3 -m unittest test_cluster.py in scripts/isolation_eval
  • Local smoke of the propagation proxy: x-dev-session: pr-73 returns {"app":"demo-fe","session":"pr-73","hops":[]}
  • intercept product E2E on this PR (tasks/ path filter)
  • Nightly cluster regression after merge (isolation-eval is skipped on pull requests)

Made with Cursor

jmjava and others added 30 commits September 27, 2026 14:24
Restart a refused isolation port-forward until the probe deadline, and run the built PR image so intercept traffic can see the original override.

Co-authored-by: Cursor <cursoragent@cursor.com>
The propagation check was curling the baseline while Telepresence was still starting, and a shallow checkout of main did not move onto the fetched tip.

Co-authored-by: Cursor <cursoragent@cursor.com>
The sidecar image was the traffic agent, so intercept never started, and a nested 404 inside a hop report was treated as a missing /propagation route.

Co-authored-by: Cursor <cursoragent@cursor.com>
The pipeline account cannot create ServiceAccounts, so the intercept pod never started, and a mirrord proxy that fails to become Ready now prints its logs.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Telepresence sidecar and mirrord proxy were CrashLoopBackOff, so the header never reached the PR pod.

Co-authored-by: Cursor <cursoragent@cursor.com>
The in-pod sidecar never kept an intercept alive; forward matching traffic to the PR pod IP the same way mirrord does.

Co-authored-by: Cursor <cursoragent@cursor.com>
OSS 2.20 connected, then rejected that flag; a TCP intercept is enough for the headered product-path probe.

Co-authored-by: Cursor <cursoragent@cursor.com>
OSS 2.20 could only steal the whole port. 2.25 --http-header keeps unmatched traffic on the baseline service.

Co-authored-by: Cursor <cursoragent@cursor.com>
Connect already pins the namespace; the intercept command rejected that flag.

Co-authored-by: Cursor <cursoragent@cursor.com>
The separate client forwarded to the PR pod IP through the Telepresence tun and the headered curl got HTTP 000.

Co-authored-by: Cursor <cursoragent@cursor.com>
Headered curls were hanging on port 80; 18080:http plus socat keeps the VPN off the app listener.

Co-authored-by: Cursor <cursoragent@cursor.com>
Header filters were matching, then the http2 probe left nginx hangs as curl HTTP 000.

Co-authored-by: Cursor <cursoragent@cursor.com>
The 2.25 chart rejects agent.appProtocolStrategy, so the traffic manager never installed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
kubectl logs with a label selector defaults to --tail=10 per container,
so every intercept artifact only carried the last 10 lines of each step
and hid the deploy step's smoke-probe diagnostics.

Co-authored-by: Cursor <cursoragent@cursor.com>
The in-cluster Telepresence path never worked: on main the PR pod ran a
sleep loop instead of the app, the tel2 sidecar image has no telepresence
CLI, and validate-propagation was warn-only, so its green runs were
vacuous. Drop it from the intercept-e2e matrix, keep the task as
experimental, and make mirrord the default everywhere.

validate-stack-propagation now takes deployed-pods and proves routing
fail-closed from the PR pod's access log: a header-matched request tagged
with a unique query string must appear there and an unmatched one must
not. The /propagation echo alone could not distinguish baseline from PR
pod.

docs/intercept-backends.md records the evidence, the attempts, and how to
reopen the Telepresence path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…teal

The proxy pod ran as staging:default and mirrord exec died on
'deployments.apps demo-fe is forbidden' within a second on every run.
The deploy step only waited for pod Ready, which a probe-less container
reports the instant it runs, so the check usually passed on a flicker
and validate-propagation then passed on the /propagation echo. Neither
backend had ever routed a header request to a PR pod in CI.

- scripts/install-mirrord-intercept-rbac.sh: ServiceAccount + Role
  (read pods/deployments/replicasets, create the agent Job); called by
  run-product-intercept-e2e.sh and run-e2e-with-intercepts.sh
- deploy-intercept-mirrord: serviceAccountName param, restartPolicy
  Never, gate on first mirrord error / any restart / proxy serving
- docs: intercept-backends.md section 4 corrected; setup steps updated

Co-authored-by: Cursor <cursoragent@cursor.com>
Deletes tasks/deploy-intercept.yaml, build-images/Dockerfile.telepresence,
scripts/install-telepresence-traffic-manager.sh and
PR-TELEPRESENCE-INTERCEPT-CONFIRMATION.md; drops the
deploy-intercepts-telepresence branch from both PR pipelines so
deploy-intercepts-mirrord runs unconditionally; removes the Telepresence
ServiceAccount block from the E2E runner and the telepresence tool image
from build-and-push. intercept-backend/INTERCEPT_BACKEND stay for API
compatibility with mirrord as the only accepted value.

Static acceptance tests now assert the mirrord-only matrix, the proxy's
own ServiceAccount + fail-closed gate, and the PR-pod routing proof.
Docs and setup scripts updated; docs/intercept-backends.md records the
removal and the evidence.

Co-authored-by: Cursor <cursoragent@cursor.com>
The fail-closed deploy gate matched 'ERROR mirrord' and tripped on
mirrord's benign 'failed to obtain machine ID' telemetry line 2s after
the proxy started, before the agent Job had even left ContainerCreating.

- MIRRORD_TELEMETRY=false / MIRRORD_PROGRESS_MODE=off on the proxy pod
- fatal-log pattern narrowed to agent creation/connection failures,
  Forbidden, and 'Error:'; a real crash still surfaces via phase=Failed
- success message reports the actual probe code instead of claiming 200

Co-authored-by: Cursor <cursoragent@cursor.com>
…d cluster first

CI (intercept-e2e.yml) is ~20 min per cycle and only returns log zips.
Four fixes tonight were debugged that way; each was a 2-minute kubectl
question locally. Codify: bring up tekton-stack once, iterate against
it, keep it up between runs, push to CI for confirmation.

Co-authored-by: Cursor <cursoragent@cursor.com>
…tive deploy gate

Proven on a local kind cluster (tekton-stack), then in the pipeline:
'PASS: intercept routing proven from PR pod access logs' with the
unmatched negative control served by baseline.

Two real bugs, both invisible from CI log zips:

- RBAC: mirrord OSS reaches its agent through the Kubernetes
  port-forward API as a WebSocket upgrade. The mirrord-intercept Role
  lacked pods/portforward, so the agent started and the proxy died ~17s
  later with 'failed to switch protocol: 403 Forbidden'. Grant get+create.
- header_filter: mirrord matches the regex against '<name>: <value>'
  (colon + space). The param is 'name:value' and was passed verbatim, so
  it never matched and every request stayed on baseline. Build an
  anchored, case-insensitive filter from the pair; log it.

Deploy gate now needs a positive marker: RUST_LOG=mirrord=info, parse
'Created agent pod ... pod_name' from the proxy log, require that agent
pod and the proxy Running with 0 restarts and no fatal line 40s later.
No direct probe of the proxy IP (socat's listener is virtual under the
layer). Agent log is dumped on failure.

Docs, static tests, and the last Telepresence wording in
validate-original-traffic updated.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…d Telepresence task

check-markdown-links failed the --local-only regression job on
../tasks/deploy-intercept.yaml, deleted with the Telepresence removal.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jmjava
jmjava merged commit 3c4c8d0 into main Sep 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant