Repository navigation
Closed
Labels
Description
Problem
MCPRemoteProxy currently does not have default resource limits, which creates the same security and operational risks that were addressed for MCPServer and VirtualMCPServer in #2873.
Current Behavior
cmd/thv-operator/controllers/mcpremoteproxy_deployment.go:31
resources := ctrlutil.BuildResourceRequirements(proxy.Spec.Resources)This only uses user-provided resources with no defaults. If spec.resources is not specified, the container gets unlimited resources.
Expected Behavior
MCPRemoteProxy should:
- Use proxy runner defaults (50m/200m CPU, 64Mi/256Mi memory) when
spec.resourcesis not specified - Merge user-provided values with defaults (user values take precedence)
- Update
deploymentNeedsUpdateto check resources properly
Implementation
Apply the same pattern used for VirtualMCPServer in #2873:
func resourceRequirementsForRemoteProxy(proxy *mcpv1alpha1.MCPRemoteProxy) corev1.ResourceRequirements {
defaultResources := ctrlutil.BuildDefaultProxyRunnerResourceRequirements()
userResources := ctrlutil.BuildResourceRequirements(proxy.Spec.Resources)
return ctrlutil.MergeResourceRequirements(defaultResources, userResources)
}Then use it in:
deploymentForMCPRemoteProxy(line 31)deploymentNeedsUpdate(line 691 in mcpremoteproxy_controller.go)
Files to Update
cmd/thv-operator/controllers/mcpremoteproxy_deployment.gocmd/thv-operator/controllers/mcpremoteproxy_controller.go- Add tests similar to
virtualmcpserver_deployment_test.go
Related
- Issue Add default resource limits to VirtualMCPServer vmcp container #2873 - Add default resource limits to VirtualMCPServer vmcp container
- PR addressing MCPServer and VirtualMCPServer defaults
Security/Operational Impact
Without defaults:
- Remote proxy containers can monopolize cluster resources
- No protection against runaway processes
- Inconsistent behavior across MCPServer, VirtualMCPServer, and MCPRemoteProxy
Labels
enhancementoperatorsecuritygood first issue(pattern is well-established)
Activity
enesyesil commentedon Mar 10, 2026
Hey, is this still open? I’d like to take it. Thanks
reyortiz3 commentedon Apr 24, 2026
Hey @enesyesil 👋 ! Sorry, it took a while to reply. The issue is still open, if you're still interested I can assign it to you
Baltsat commentedon Jul 25, 2026
I’d like to work on this. On current main,
MCPRemoteProxystill builds and drift-checks container resources directly fromspec.resources, so empty or partial specs omit the intended defaults. I plan to add configurable operator/Helm defaults with per-CR fields taking precedence, plus deployment-generation and drift/idempotency regressions for empty and partial overrides. Please assign me and confirm that configuration direction before I open a PR; repository-native Go and Helm verification is still pending.ChrisJBurns commentedon Jul 30, 2026
@Baltsat thanks for the clear plan, and apologies to both you and @enesyesil for how slowly this issue has moved. Assigning it to you.
On the configuration direction you asked about, we would rather you scope it down. Please implement in-code defaults for the
MCPRemoteProxyproxy container, with any values set inspec.resourcestaking precedence, and leave configurable operator or Helm-level defaults out. Introducing a cluster-wide defaulting surface is a larger design question that would apply to every controller, not just this one, and we do not want this fix waiting on it. The drift and idempotency regressions you described for empty and partial overrides are exactly right, please keep those.One warning that will save you time. The implementation sketch in the description references
BuildDefaultProxyRunnerResourceRequirementsandMergeResourceRequirementsas though they already exist from #2873. As far as we can tell they do not exist in the tree today, andcmd/thv-operator/pkg/controllerutil/resources.gohas onlyBuildResourceRequirements, which applies user values with no defaults. So you are adding the defaulting and merge logic, not reusing it. AlongsideBuildResourceRequirementsin that file is the natural home. Please confirm what you find, since the codebase has changed a lot in the seven months since this was filed.We are also removing
good-first-issue. It was applied on the assumption that this was copying an established pattern, which is no longer accurate, and we would rather label the work honestly.@enesyesil, if you had already started on this, say so and we will sort it out between you.
aponcedeleonch commentedon Oct 23, 2026
Hi @Baltsat, checking in on this one. Are you still planning to work on it? Heads up that #5998 from @clxstart already follows the direction agreed above (in-code defaults with
spec.resourcestaking precedence, plus drift checks) and has had a first review. If you've moved on to other things, let us know and we'll unassign you so the two efforts don't overlap.Add default resource limits for MCPRemoteProxy (stacklok#7137)