fix(agent-zero): route chat mcp in-cluster
This commit is contained in:
@@ -267,8 +267,11 @@ spec:
|
|||||||
# Phase 0 Chat MCP pilot: Agent Zero does not interpolate env vars
|
# Phase 0 Chat MCP pilot: Agent Zero does not interpolate env vars
|
||||||
# inside A0_SET_mcp_servers JSON, so build the final JSON here from
|
# inside A0_SET_mcp_servers JSON, so build the final JSON here from
|
||||||
# the secret-backed CHAT_MCP_API_KEY env var before initialize.sh.
|
# the secret-backed CHAT_MCP_API_KEY env var before initialize.sh.
|
||||||
|
# Use the in-cluster Chat service URL rather than the public
|
||||||
|
# Traefik hostname so the pod stays off the private VIP lane that
|
||||||
|
# the default egress rule blocks.
|
||||||
if [ -n "${CHAT_MCP_API_KEY:-}" ]; then
|
if [ -n "${CHAT_MCP_API_KEY:-}" ]; then
|
||||||
export A0_SET_mcp_servers="{\"mcpServers\":{\"fc-chat\":{\"type\":\"http\",\"url\":\"https://chat.iamworkin.lan/mcp\",\"headers\":{\"X-Api-Key\":\"${CHAT_MCP_API_KEY}\"}}}}"
|
export A0_SET_mcp_servers="{\"mcpServers\":{\"fc-chat\":{\"type\":\"http\",\"url\":\"http://chat-web.fc-chat.svc/mcp\",\"headers\":{\"X-Api-Key\":\"${CHAT_MCP_API_KEY}\"}}}}"
|
||||||
fi
|
fi
|
||||||
# Run the original entrypoint
|
# Run the original entrypoint
|
||||||
exec /exe/initialize.sh $BRANCH
|
exec /exe/initialize.sh $BRANCH
|
||||||
@@ -563,6 +566,16 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- port: 8080
|
- port: 8080
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
# FlowerCore.Chat MCP (Phase 0 pilot) — use the in-cluster chat-web
|
||||||
|
# service instead of the public Traefik VIP so MCP traffic stays inside
|
||||||
|
# the cluster and survives the private-range egress denylist.
|
||||||
|
- to:
|
||||||
|
- namespaceSelector:
|
||||||
|
matchLabels:
|
||||||
|
kubernetes.io/metadata.name: fc-chat
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
protocol: TCP
|
||||||
# Allow internet (for kubectl image pull, etc)
|
# Allow internet (for kubectl image pull, etc)
|
||||||
- to:
|
- to:
|
||||||
- ipBlock:
|
- ipBlock:
|
||||||
|
|||||||
Reference in New Issue
Block a user