Repository navigation
Description
As a platform engineer managing multiple MCP servers with the same identity provider,
I want to define OIDC configuration once in an MCPOIDCConfig resource and reference it from multiple workloads,
so that I can update issuer settings in one place instead of duplicating config across every MCPServer.
Size: L
Dependencies: None
Labels: operator, api, oidc
Context
OIDC configurations are defined inline in multiple CRDs (MCPServer, MCPRemoteProxy, VirtualMCPServer). Platform teams managing 10+ MCPServer resources with the same OIDC provider must duplicate the full config in each resource. A single issuer URL change requires updating every resource.
This story extracts shared OIDC configuration into a dedicated reusable CRD following the pattern established by MCPExternalAuthConfig.
Acceptance Criteria
-
MCPOIDCConfigCRD is defined withinline,configMapRef, andkubernetesServiceAccountvariants - CEL validation enforces exactly one variant is set (no
typediscriminator field) - Status tracks
observedGeneration,configHash,referencingServers, and standardconditions - Controller adds finalizer on first reconciliation
- Controller tracks referencing workloads in
status.referencingServers - Controller blocks deletion while references exist (finalizer pattern)
- Controller cascades config changes to referencing workloads via annotation (
toolhive.stacklok.dev/oidcconfig-hash) - Controller sets
Readycondition based on config validation - Controller emits Warning event when duplicate audiences are detected across referencing workloads
- CRD manifest is generated and included in
operator-crdsHelm chart - Unit tests cover type validation, controller reconciliation, finalizer logic, cascade, and audience uniqueness
- Integration tests in
cmd/thv-operator/test-integration/cover cross-CRD reference lifecycle, cascade reconciliation, and deletion protection
Activity
Add MCPOIDCConfig CRD, controller, and tests
Add MCPOIDCConfig CRD types and MCPServer reference field
Add MCPOIDCConfig CRD types and generated manifests
Add MCPOIDCConfig controller for lifecycle management
Add MCPOIDCConfig CRD types and MCPServer reference field (#4461)
Add MCPOIDCConfig unit and integration tests
Add MCPOIDCConfig controller for lifecycle management (#4462)
Wire MCPOIDCConfig into MCPServer controller
Wire MCPOIDCConfig into MCPServer controller (stacklok#4481)
Wire MCPOIDCConfig into VirtualMCPServer controller
Wire MCPOIDCConfig into VirtualMCPServer controller
Wire MCPOIDCConfig into VirtualMCPServer controller
Wire MCPOIDCConfig into VirtualMCPServer controller
Wire MCPOIDCConfig into VirtualMCPServer controller (stacklok#4493)
ChrisJBurns commentedon Apr 3, 2026
Closing — all core acceptance criteria are implemented. The configMapRef variant was intentionally omitted (not needed). Audience uniqueness warning (#4260) will be tracked separately as a future enhancement. Remaining annotation-based cascade was implemented via status hash instead, which is functionally equivalent.