Skip to content

VirtualMCPServer controller should re-reconcile when a referenced authz ConfigMap changes #5270

Closed

Description

@jhrozek

Background

When #5208 lands, a VirtualMCPServer with spec.incomingAuth.authzConfig.type: configMap will have its policies resolved by the operator at reconcile time: the converter reads the referenced ConfigMap, extracts the Cedar policies, and bakes them into the vmcp config.yaml ConfigMap. A content-checksum annotation on the pod template then triggers a rollout when config.yaml changes.

This architecture differs from MCPServer, where the authz ConfigMap is mounted as a live volume — kubelet keeps it current and no pod restart is needed when policies change.

Problem

The VirtualMCPServer controller has no watch on ConfigMaps referenced by spec.incomingAuth.authzConfig.configMap. The controller is purely event-driven with no polling fallback. So when the referenced ConfigMap's content changes after the initial reconcile:

  1. The controller is never notified
  2. The converter is never re-run
  3. The vmcp config.yaml retains the old policies
  4. The running vmcp pod enforces stale Cedar policies indefinitely

This matters especially in the enterprise use case, where an external controller rewrites the authz ConfigMap whenever Cedar policies change.

Expected behaviour

When a ConfigMap referenced by spec.incomingAuth.authzConfig.configMap.name has its .data changed, the owning VirtualMCPServer should be enqueued for reconciliation. The reconcile re-runs the converter, regenerates config.yaml, and — if the content changed — the checksum annotation triggers an automatic pod rollout.

A metadata-only update to the ConfigMap (labels, annotations) should not trigger a reconcile.

Implementation sketch

In SetupWithManager, add a Watches entry for corev1.ConfigMap with:

  • A mapper that lists all VirtualMCPServer objects and enqueues any that reference the changed ConfigMap via spec.incomingAuth.authzConfig.configMap.name
  • A predicate that admits only Update events where .data actually changed

This follows the existing pattern used for MCPOIDCConfig and MCPTelemetryConfig references (mapOIDCConfigToVirtualMCPServer, mapTelemetryConfigToVirtualMCPServer).

Dependency

Requires #5208 — without ConfigMap resolution in the converter, a re-reconcile produces a config.yaml with no policies regardless.

Acceptance criteria

  • Updating an authz ConfigMap referenced by a VirtualMCPServer triggers an immediate reconcile (no polling delay)
  • The vmcp pod is rolled out with updated policies after the reconcile completes
  • A metadata-only ConfigMap update (label/annotation change) does not trigger a reconcile

Activity

  1. added
    enhancement
    kubernetes
    vmcp
    on May 13, 2026
  2. self-assigned this
    on May 13, 2026
  3. added a commit that references this issue on May 14, 2026
    98ee559
  4. added a commit that references this issue on May 14, 2026
    4d411ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

authorizationenhancementkubernetesoperatorvmcp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions