Skip to content

fix(k8s): stabilise mcp deployment name on server rename#4334

Open
Rahulcse79 wants to merge 1 commit intoarchestra-ai:mainfrom
Rahulcse79:fix/mcp-catalog-rename-orphaned-pod
Open

fix(k8s): stabilise mcp deployment name on server rename#4334
Rahulcse79 wants to merge 1 commit intoarchestra-ai:mainfrom
Rahulcse79:fix/mcp-catalog-rename-orphaned-pod

Conversation

@Rahulcse79
Copy link
Copy Markdown
Contributor

Single-tenant MCP server deployments previously took their Kubernetes name from a slug of the server's mutable display name, so renaming a catalog entry produced a fresh pod under a new identifier and orphaned the old one with no cleanup path. The deployment name is now mcp-<first 8 hex of server.id>, matching the existing multitenant mcp-mt-<catalogId.slice(0,8)>-... convention, so a rename leaves all K8s resources untouched and the next reinstall reconciles the same Deployment, Service, and Secret in place.

A startup sweep in McpServerRuntimeManager.start lists every app=mcp-server deployment and deletes any whose name doesn't match the id-derived name expected for its owning server, cleaning up legacy pods left over from before this fix. Pod-lookup selectors used by log streaming and status polling were already keyed on the stable mcp-server-id label and required no change.

Fixes #4328

Single-tenant MCP server deployments previously took their Kubernetes
name from a slug of the server's mutable display name, so renaming a
catalog entry produced a fresh pod under a new identifier and orphaned
the old one with no cleanup path. The deployment name is now
mcp-<first 8 hex of server.id>, matching the existing multitenant
mcp-mt-<catalogId.slice(0,8)>-... convention, so a rename leaves all
K8s resources untouched and the next reinstall reconciles the same
Deployment, Service, and Secret in place.

A startup sweep in McpServerRuntimeManager.start lists every
app=mcp-server deployment and deletes any whose name doesn't match the
id-derived name expected for its owning server, cleaning up legacy
pods left over from before this fix. Pod-lookup selectors used by log
streaming and status polling were already keyed on the stable
mcp-server-id label and required no change.

Fixes archestra-ai#4328
@github-actions github-actions Bot requested a review from joeyorlando May 5, 2026 15:39
@joeyorlando
Copy link
Copy Markdown
Contributor

hi there 👋

is now mcp-<first 8 hex of server.id>, matching the existing multitenant mcp-mt-<catalogId.slice(0,8)>

which "multitenant mcp-mt- are you referring to exactly?

}
const slugified = ensureStringIsRfc1123Compliant(mcpServer.name);
return `mcp-${slugified}`.substring(0, 253);
return `mcp-${ensureStringIsRfc1123Compliant(mcpServer.id).slice(0, 8)}`;
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.

also, I don't think we should use id here - this makes it very difficult as a k8s admin to understand what Deployment / Pod maps actually maps to what MCP server

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.

Bug during renaming mcp server internal catalog item

2 participants