Repository navigation
Make MCPServer controller hands-off on replicas - #3955
Merged
Merged
Conversation
The MCPServer controller previously hardcoded replicas=1 and actively reverted any external scaling, preventing kubectl scale, HPAs, KEDA, and other autoscalers from working. The controller is now hands-off for replica management, with one exception: stdio transport is capped at 1 replica because it requires 1:1 proxy-to-backend connections. Non-stdio transports (SSE, streamable-http) allow free scaling by external tools. Key changes: - Replace blanket replica enforcement with stdio-only cap - Use template-only deployment updates to preserve Spec.Replicas - Add Stopped phase and ReadyReplicas to MCPServer status - Add Ready print column for kubectl get mcpservers - Handle scale-to-zero by reporting Stopped phase Closes #3329 Co-Authored-By: Claude Opus 4.6 <[email protected]>
JAORMX
requested review from
ChrisJBurns,
amirejaz,
jerm-dro,
jhrozek and
yrobla
as code owners
February 25, 2026 11:18
rdimitrov
approved these changes
Feb 26, 2026
amirejaz
approved these changes
Feb 26, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3955 +/- ##
==========================================
+ Coverage 67.64% 67.83% +0.19%
==========================================
Files 438 438
Lines 44108 44123 +15
==========================================
+ Hits 29835 29930 +95
+ Misses 11938 11851 -87
- Partials 2335 2342 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
replicas=1on every reconcile, allowingkubectl scale, HPAs, KEDA, and other autoscalers to manage replicas freelySpec.Template,Spec.Selector, labels, and annotations — preservingSpec.Replicasset by external toolsReadyReplicasreports actual running pod count;Stoppedphase reports scale-to-zero state;Readyprint column shows replica count inkubectl get mcpserversCloses #3329
Test plan
StoppedphaseReadyReplicasmatches running pod counttask operator-testpassestask lintpasses (also fixes pre-existing goconst issue)kubectl scale --replicas=3(SSE), verify controller doesn't revertkubectl scale --replicas=0, verify status showsStoppedkubectl scale --replicas=3, verify controller caps to 1🤖 Generated with Claude Code