You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clamp VirtualMCPServer resource defaults against podTemplateSpec #7154
VirtualMCPServer sets default resources on the vmcp container in virtualmcpserver_deployment.go: requests of 100m CPU / 128Mi memory and limits of 500m CPU / 512Mi memory. It then applies the user's podTemplateSpec on top as a strategic merge patch.
A strategic merge patch merges requests and limits key by key. So a podTemplateSpec that sets only one side keeps the other side's defaults, and the request can end up above the limit:
This yields requests.memory: 1Gi with the default limits.memory: 512Mi. The apiserver rejects that Deployment, and reconcile keeps retrying. The reverse also fails: a limits.cpu below the default 100m request is rejected too.
We found this while reviewing #7137, which hit the same problem for MCPRemoteProxy. The vMCP case follows the same code path but hasn't been reproduced yet.
Proposed fix
#7137 adds controllerutil.BuildContainerResourceRequirements(defaults, specResources, podTemplateSpec, containerName). It layers the defaults, the CRD resources field and the podTemplateSpec container resources, clamps any defaulted value that would conflict with a user value, and honours null deletions. vMCP can switch to it:
Pass the vMCP defaults, an empty mcpv1beta1.ResourceRequirements{} (vMCP has no spec.resources field) and container name vmcp.
Keep the existing podTemplateSpec patch step as it is.
Add a test that runs a podTemplateSpec resource override through the vMCP deployment builder.
Related cleanup (optional, same or separate PR)
MCPServer (in deploymentForMCPServer and resourceRequirementsForMCPServer) and EmbeddingServer (in applyResourceRequirements) each repeat the conversion that controllerutil.BuildResourceRequirements already does. Neither applies defaults, so switching them over should change no behaviour. One thing to check: EmbeddingServer sets an empty map for the side that isn't set, so confirm its drift detection still treats that as equal.
I'd like to take this one. The plan is the fix proposed above: build the vMCP container resources with controllerutil.BuildContainerResourceRequirements (added in #7137) in virtualmcpserver_deployment.go, so user-provided requests/limits are merged with the defaults without ending up with requests > limits, plus a test for the memory-request-only and low-CPU-limit cases. Could you assign it to me?
Activity
pcbeingused333 commentedon Nov 18, 2026
I'd like to take this one. The plan is the fix proposed above: build the vMCP container resources with
controllerutil.BuildContainerResourceRequirements(added in #7137) invirtualmcpserver_deployment.go, so user-provided requests/limits are merged with the defaults without ending up with requests > limits, plus a test for the memory-request-only and low-CPU-limit cases. Could you assign it to me?This comment was drafted with AI assistance.