Skip to content

Commit 5333c2c

Browse files
authored
docs: Update Kubernetes integration docs to reflect spec.groupRef support (#133)
- Update MCPServer CRD mapping table to show spec.groupRef is preferred - Clarify that spec.groupRef takes precedence over label - Add examples showing both spec.groupRef and label methods - Document default group behavior when neither is specified This aligns the documentation with commit c6a44f2 which updated the code to prefer spec.groupRef over metadata.labels.
1 parent 6648432 commit 5333c2c

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

docs/kubernetes-integration.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ MCP Optimizer converts MCPServer CRDs to internal Workload models with the follo
558558
| `metadata.namespace` | N/A | Used for scoping |
559559
| `metadata.creationTimestamp` | `created_at` | Creation timestamp |
560560
| `metadata.labels` | `labels` | All labels |
561-
| `metadata.labels["toolhive.stacklok.dev/group"]` | `group` | Server group |
561+
| `spec.groupRef` (preferred) or `metadata.labels["toolhive.stacklok.dev/group"]` | `group` | Server group (prefers `spec.groupRef`, falls back to label, defaults to "default") |
562562
| `spec.image` | `package` | Container image |
563563
| `spec.transport` | `transport_type` | Transport type (stdio, sse, streamable-http) |
564564
| `spec.port` | `port` | Server port |
@@ -686,15 +686,28 @@ Mismatches between these fields will cause connection failures.
686686

687687
### Group Filtering
688688

689-
MCP Optimizer supports filtering MCPServers by group labels. This is useful for isolating servers by environment or team:
689+
MCP Optimizer supports filtering MCPServers by group. This is useful for isolating servers by environment or team:
690690

691691
```yaml
692692
# In MCP Optimizer deployment, set environment variable:
693693
- name: ALLOWED_GROUPS
694694
value: "development,production"
695695
```
696696

697-
Servers must have the `toolhive.stacklok.dev/group` label:
697+
Servers can specify their group using either `spec.groupRef` (preferred) or the `toolhive.stacklok.dev/group` label. The `spec.groupRef` field takes precedence if both are present:
698+
699+
```yaml
700+
apiVersion: toolhive.stacklok.dev/v1alpha1
701+
kind: MCPServer
702+
metadata:
703+
name: my-server
704+
spec:
705+
# Preferred method: use spec.groupRef
706+
groupRef: development
707+
# ... other spec fields
708+
```
709+
710+
Or using labels (legacy method, still supported):
698711

699712
```yaml
700713
apiVersion: toolhive.stacklok.dev/v1alpha1
@@ -703,8 +716,12 @@ metadata:
703716
name: my-server
704717
labels:
705718
toolhive.stacklok.dev/group: development
719+
spec:
720+
# ... spec fields
706721
```
707722

723+
If neither `spec.groupRef` nor the label is specified, the server will be assigned to the "default" group.
724+
708725
See [Group Filtering documentation](group-filtering.md) for more details.
709726

710727
### In-Cluster Authentication

0 commit comments

Comments
 (0)