-
Notifications
You must be signed in to change notification settings - Fork 150
Add proposal for MCPRegistry ConfigMap label selector support #2755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This proposal adds support for selecting ConfigMaps via label selectors in MCPRegistry, providing a more Kubernetes-native approach to discovering registry data sources dynamically. Key design decisions: - New configMapSelector field (mutually exclusive with other sources) - Conflict resolution: both conflicting servers get prefixed - Same namespace only for security - Post-merge filtering - Partial failure with status update and Event emission 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2755 +/- ##
==========================================
+ Coverage 56.07% 56.28% +0.21%
==========================================
Files 319 319
Lines 30697 30753 +56
==========================================
+ Hits 17214 17310 +96
+ Misses 12002 11955 -47
- Partials 1481 1488 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dmartinol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BH, I'm not fully convinced by the proposal: we worked until now for a lighter controller and now it's back to fetch and merge registries.
Take into account that some previous decisions may affect the proposal:
- Sync flow was moved to the server
- Server configuration updates do not trigger new syncs
- On-demand syncs are not managed on the controller
| - Fetch and parse registry data from each ConfigMap | ||
| - Implement conflict detection and prefixing logic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This registry handling was moved to the registry server: do we really want to bring it back to the controller to generate the ConfigMap with the merged registry? 🤔
| 3. **Controller Updates** | ||
| - Add ConfigMap watch with label predicates | ||
| - Trigger reconciliation on matching ConfigMap changes | ||
| - Integrate selector handler with existing sync flow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above: sync flow is in the registry server now
|
|
||
| ### Conflict Resolution | ||
|
|
||
| **Question:** What happens when multiple ConfigMaps define a server with the same name? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we instead map each ConfigMap to its own "registry" and create a file-backed configuration in the registry server?
BTW: I assume the server already handles the server name duplication, because it can already happen today
ChrisJBurns
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't have thought that this change would have warranted a proposal tbh. The change itself is probably small enough to just do it - however, that being said, two things from me:
- The wider proposal sounds like it's trying to do more than just the configmap change i.e. prefix logic and sync flow
- I don't actually think we'll need the ConfigMapRef stuff anymore when we offer
podTemplateSpecoverrides. Because the user themselves will be able to specify the configMaps they want to mount to the registry server container (they can use selectors for this if they wanted), and then just configure them as a file based registry. This removes the need for us to have configMapRef logic anywhere in the code.
Address PR feedback by making the separation of concerns explicit: - Add Architecture section with diagram showing operator/server boundary - Clarify operator handles K8s primitives only (no sync logic) - Registry server remains Kubernetes-agnostic (reads files) - Document that syncPolicy.interval applies to server, not operator - Add "Alternative Considered" section for multiple file sources - Add directory source support as future registry server enhancement 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Do you want to add |
|
I think the controller reconciling multiple configmaps into volume mounts is less heavyweight than it modifying the pod template spec. |
@rdimitrov we need some clarity on the directions. |
|
@dmartinol the template spec is meant for the user to add complex enhancements to the deployment. Letting the user configure a label selector on a dedicated path is a lot less disruptive and easier to reconcile. |
Summary
This proposal adds support for selecting ConfigMaps via label selectors in MCPRegistry, providing a more Kubernetes-native approach to discovering registry data sources dynamically.
configMapSelectorfield for label-based ConfigMap discoveryKey Design Decisions
configMapSelectorwithmatchLabels(nomatchExpressionsinitially)configmap-a/github-mcp,configmap-b/github-mcp)Test plan
🤖 Generated with Claude Code