fix(k8s): stabilise mcp deployment name on server rename#4334
Open
Rahulcse79 wants to merge 1 commit intoarchestra-ai:mainfrom
Open
fix(k8s): stabilise mcp deployment name on server rename#4334Rahulcse79 wants to merge 1 commit intoarchestra-ai:mainfrom
Rahulcse79 wants to merge 1 commit intoarchestra-ai:mainfrom
Conversation
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
Contributor
|
hi there 👋
which "multitenant |
joeyorlando
reviewed
May 5, 2026
| } | ||
| const slugified = ensureStringIsRfc1123Compliant(mcpServer.name); | ||
| return `mcp-${slugified}`.substring(0, 253); | ||
| return `mcp-${ensureStringIsRfc1123Compliant(mcpServer.id).slice(0, 8)}`; |
Contributor
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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