Skip to content

fix(helm): gate loopback MCP sidecars and preserve namespaces - #1711

Open
Wassim Chegham (manekinekko) wants to merge 2 commits into
duffney-helm-chart-app-deploymentfrom
manekinekko-helm-review-fixes
Open

Wassim Chegham (manekinekko) wants to merge 2 commits into
duffney-helm-chart-app-deploymentfrom
manekinekko-helm-review-fixes

Conversation

@manekinekko

Copy link
Copy Markdown
Member

Summary

Separate fix layer stacked on #1481, targeting duffney-helm-chart-app-deployment at d85ed7a687a953c594c6a6cbb70b1f862dce4b3a. The original PR branch is unchanged. Native stack registration is left to the coordinator.

This covers only the three new re-review findings:

  • Bind both MCPJungle registries to 127.0.0.1:8080, using the verified 0.4.7-stdio multi-architecture image pinned to digest sha256:4eae32ecba23e2970413a320ae1f0457f9f7dac1ee39c2b3f34f48753e918e33. Keep stdio and remote MCP functionality; use the image's verified curl for in-container loopback probes.
  • Add native-sidecar startupProbe gating before either queue consumer starts. Readiness alone does not provide that gate. Use a direct MCPJungle process rather than a shell/grep pipeline.
  • Generate global.namespace from the backend federated-identity namespace, require complete worker identity outputs when present, and reject backend/worker namespace mismatches before writing values. Keep Helm, kubectl, and worker-bootstrap instructions consistent for custom namespaces.

Worker-scoped identity and the absence of worker CSI mounts are preserved. Pre-existing findings, the migration-image follow-up, and trusted queue-processor versus untrusted executor isolation remain out of scope.

Demos

N/A: deployment configuration and tooling only; no Portal/CLI UI changes.

Before

N/A.

After

N/A.

Testing

Node 22.22.0, Helm 3.17.3 (checksum-verified temporary binary on PATH), jq 1.7.1. No Azure credentials or resources were accessed.

  • Passed: 47 tests, none skipped, including all 16 new chart/generator cases. New listener/startup and namespace regressions were also observed failing before the fixes.

    node node_modules/vitest/vitest.mjs run scripts/helm-scope.test.ts scripts/generate-values-from-bicep.test.ts scripts/register-agent.test.ts packages/shared/src/mcp/mcp-gateway-client.test.ts --reporter=default
  • Passed: strict type check of both new suites.

    node packages/shared/node_modules/typescript/bin/tsc --noEmit --target ES2022 --module NodeNext --moduleResolution NodeNext --strict --skipLibCheck --types node --typeRoots packages/shared/node_modules/@types scripts/helm-scope.test.ts scripts/generate-values-from-bicep.test.ts
  • Passed: strict Helm lint, with both workers and a custom namespace; one chart linted, zero failures. Rendering tests inspect the actual generated startup/readiness exec-probe shapes, pinned images, loopback worker URLs, worker identity/volumes, and disabled-gateway behavior.

    helm lint deploy/helm/scope --strict --namespace scope-benchmarks --set global.namespace=scope-benchmarks --set azure.workloadIdentityClientId=test-backend --set azure.workerWorkloadIdentityClientId=test-worker --set azure.keyVaultName=test-vault --set azure.keyVaultUri=https://test-vault.vault.azure.net/ --set azure.tenantId=test-tenant --set azure.redisHostName=redis.example.test --set workers.coderAcpCopilot.enabled=true --set workers.coderAcpClaudeCode.enabled=true
  • Passed: shell syntax and whitespace checks.

    bash -n scripts/generate-values-from-bicep.sh scripts/bootstrap-workers.sh
    git diff --check
  • Passed: actual pinned amd64 image CLI and tool checks.

    docker run --rm --platform linux/amd64 --network none --entrypoint /mcpjungle ghcr.io/mcpjungle/mcpjungle@sha256:4eae32ecba23e2970413a320ae1f0457f9f7dac1ee39c2b3f34f48753e918e33 start --help
    docker run --rm --platform linux/amd64 --network none --entrypoint /bin/sh ghcr.io/mcpjungle/mcpjungle@sha256:4eae32ecba23e2970413a320ae1f0457f9f7dac1ee39c2b3f34f48753e918e33 -ec 'command -v curl; command -v node; command -v npx; command -v uvx'
  • Passed: local container functional smoke on arm64 and amd64. Started the pinned image with the exact chart flags and idle-timeout environment, confirmed loopback health/registry access and rejection of the container IP, then exercised the production McpGatewayClient: purge, register a local stdio MCP server and a stateless HTTP MCP fixture, list both, invoke both echo tools through /mcp, and purge again. No ports were published, no credentials were mounted, and all containers exited afterward. Verified release source at mcpjungle/MCPJungle@974e2fabe4694d3b613d281e6e4e8d2fa3f6da74 and namespace outputs at the companion Bicep revision eaf8f75800d99f5f634ad7458caea91b475408c1.

Limitations: no live AKS/kubelet lifecycle or Azure federation deployment was performed; startup gating follows the documented Kubernetes native-sidecar lifecycle and is checked in rendered manifests. External authenticated MCP services, SSE runtime smoke, and the full monorepo suite were not run.

Documentation and compatibility

Updated deploy/helm/scope/README.md, CONFIGURATION.md, WORKERS.md, SAMPLE-SCENARIO.md, and values/template comments.

  • Older Bicep deployments missing namespace outputs must be re-deployed with those outputs before generating values. Worker outputs remain optional only when the entire worker identity set is absent.
  • global.namespace, Helm's release namespace, worker bootstrap's --namespace, and both federated subjects must agree. Pass the original values file to worker bootstrap so current chart defaults, including the pinned MCP image, are re-merged instead of freezing --reuse-values.
  • An optional service image.digest takes precedence over image tags. When changing the MCP release, update its digest as well as its tag and verify binding/probe capabilities.
  • No application API, database schema, or Portal/CLI capability changes. Loopback does not isolate benchmark code inside the same worker Pod from that Pod's credentials or gateway.

Checklist

  • If Portal features changed, keep CLI capabilities in sync. (N/A: deployment-only.)
  • If Portal components changed, update their Storybook stories. (N/A.)
  • If database changes require a migration, include up() / down() and keep it CosmosDB-compatible. (N/A.)
  • If dependencies changed, update the lockfile and regenerate NOTICE / NOTICE-REVIEW.txt with pnpm notice as needed. (N/A: no package dependency changes.)
  • Video showing the behavior before the suggested change (N/A: no Portal/CLI UI change.)
  • Video showing the behavior after the suggested change (N/A: no Portal/CLI UI change.)

Pin the verified MCPJungle stdio release by multi-architecture digest, bind its registry to pod loopback, and gate worker startup with in-container health probes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Generate global.namespace from required Bicep identity outputs, reject incomplete or incompatible worker identity namespaces, and keep install/bootstrap instructions namespace-consistent.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added type: documentation Documentation additions, corrections, and improvements. area: cicd Build, test, release, and deployment pipelines. language: javascript Work involving JavaScript code, tooling, or dependencies. topic: testing Test coverage, test infrastructure, and validation quality. labels Nov 24, 2026
@github-actions

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #625

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3218 3218 0 0 0 0 0 1m30s

🎉 All tests passed!

Github Test Reporter

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the Helm deployment-hardening changes.

No open issues 🎉

What changed in this PR

This follow-up to #1481 hardens Scope’s Helm deployment by restricting worker MCP gateways to loopback, gating initial worker startup on gateway health, and preserving Azure workload-identity namespaces.

Changes:

  • Pins both MCP sidecars by digest and adds loopback startup/readiness probes.
  • Generates global.namespace from Bicep outputs and rejects incomplete worker identities or namespace mismatches before writing values.
  • Adds regression tests and aligns installation, bootstrap, and verification instructions for custom namespaces.
File Description
scripts/​helm-scope.test.ts Tests rendered sidecar probes, images, namespaces, and worker settings.
scripts/​generate-values-from-bicep.test.ts Tests namespace propagation, identity validation, and file preservation.
scripts/​generate-values-from-bicep.sh Emits the federated namespace and validates worker identity outputs.
deploy/​helm/​scope/​WORKERS.md Documents startup gating, loopback limits, and namespace-safe bootstrap.
deploy/​helm/​scope/​values.yaml Pins both MCP images and clarifies namespace and startup behavior.
deploy/​helm/​scope/​templates/​workers/​coder-acp-copilot/​deployment.yaml Adds loopback binding and startup gating for the Copilot gateway.
deploy/​helm/​scope/​templates/​workers/​coder-acp-claude-code/​deployment.yaml Adds equivalent binding and startup gating for the Claude Code gateway.
deploy/​helm/​scope/​templates/​_helpers.tpl Gives image digests precedence over tags.
deploy/​helm/​scope/​SAMPLE-SCENARIO.md Makes sample port-forwarding namespace-aware.
deploy/​helm/​scope/​README.md Updates prerequisites, namespace guidance, and regression-check instructions.
deploy/​helm/​scope/​CONFIGURATION.md Explains digest overrides and federated-identity namespace requirements.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cicd Build, test, release, and deployment pipelines. language: javascript Work involving JavaScript code, tooling, or dependencies. topic: testing Test coverage, test infrastructure, and validation quality. type: documentation Documentation additions, corrections, and improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants