Skip to content

Commit 136db29

Browse files
markturanskyuserclaudemergify[bot]
authored
fix(control-plane,manifests): resolve MCP sidecar TLS and api-server proxy failures (#1546)
## Summary - **MCP sidecar TLS fix**: The `ambient-mcp` sidecar container in runner pods was missing the OpenShift `service-ca` volume mount and `SSL_CERT_FILE` env var, causing `x509: certificate signed by unknown authority` errors when calling `ambient-api-server` over HTTPS (service-serving certs). Added both, matching the existing runner container configuration. - **Backend proxy fix**: The `ambient-api-server` reverse proxy plugin defaults `BACKEND_URL` to `http://localhost:8080` when unset. Since the backend runs in a separate pod (`backend-service:8080`), all proxied requests (credentials, session listing) returned 502. Added `BACKEND_URL` to the production env patch. ## Root Cause These issues were exposed by the `ambient-control-plane` deployment fix (env[15] `value`/`valueFrom` conflict on `CP_RUNTIME_NAMESPACE`). Once the control-plane was redeployed with the correct manifest, the MCP sidecar started being injected into runner pods, surfacing the missing TLS config. The `BACKEND_URL` gap has existed since the api-server proxy plugin was introduced but was previously masked. ## Test plan - [ ] Deploy updated `ambient-control-plane` image to cluster - [ ] Create a new session and verify MCP tools (`list_sessions`, `list_projects`) work without TLS errors - [ ] Verify credential fetching (github, gitlab, etc.) returns proper responses instead of 502 - [ ] Verify `acp_list_sessions` works without 502 🤖 Generated with [Claude Code](https://claude.ai/code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enhanced MCP sidecar container configuration to support TLS certificate validation and CA bundle access for secure internal communication. * Configured the API server with backend service endpoint URL settings for production deployments, enabling proper service-to-service connectivity in the ambient control plane. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: user <u@example.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent a455af3 commit 136db29

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

components/ambient-control-plane/internal/reconciler/kube_reconciler.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,7 @@ func (r *SimpleKubeReconciler) buildMCPSidecar(sessionID string) interface{} {
840840
envVar("AMBIENT_CP_TOKEN_URL", r.cfg.CPTokenURL),
841841
envVar("AMBIENT_CP_TOKEN_PUBLIC_KEY", r.cfg.CPTokenPublicKey),
842842
envVar("SESSION_ID", sessionID),
843+
envVar("SSL_CERT_FILE", "/etc/pki/ca-trust/extracted/pem/service-ca.crt"),
843844
}
844845
if r.cfg.HTTPProxy != "" {
845846
env = append(env, envVar("HTTP_PROXY", r.cfg.HTTPProxy))
@@ -862,6 +863,14 @@ func (r *SimpleKubeReconciler) buildMCPSidecar(sessionID string) interface{} {
862863
},
863864
},
864865
"env": env,
866+
"volumeMounts": []interface{}{
867+
map[string]interface{}{
868+
"name": "service-ca",
869+
"mountPath": "/etc/pki/ca-trust/extracted/pem/service-ca.crt",
870+
"subPath": "service-ca.crt",
871+
"readOnly": true,
872+
},
873+
},
865874
"resources": map[string]interface{}{
866875
"requests": map[string]interface{}{
867876
"cpu": "100m",

components/manifests/overlays/production/ambient-api-server-env-patch.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ spec:
1010
env:
1111
- name: AMBIENT_ENV
1212
value: production
13+
- name: BACKEND_URL
14+
value: "http://backend-service.ambient-code.svc:8080"

0 commit comments

Comments
 (0)