Skip to content

Auth server CA bundle reference change does not roll MCPServer/MCPRemoteProxy pods #6928

Open

Description

@jhrozek

Problem

When an embedded auth server's upstreamProviders[].caBundleRef or trustedIssuers[].caBundleRef is pointed at a different ConfigMap (or key) whose selected bytes are identical to the old one, MCPServer and MCPRemoteProxy pods are not rolled.

The only thing that rolls the pods for these volumes is the AuthServerCABundleChecksumAnnotation pod template annotation. EmbeddedAuthServerCABundleChecksumForConfig (cmd/thv-operator/pkg/controllerutil/authserver.go) hashes only the resolved bundle bytes, not the ConfigMap name or key. So a reference change with the same content leaves the checksum unchanged, and the drift checks in deploymentNeedsUpdate (MCPServer) and podSpecNeedsUpdate (MCPRemoteProxy) never compare the CA bundle volumes themselves.

Impact

The Deployment's pod template keeps mounting the old ConfigMap. Running pods don't notice. But if the old ConfigMap is then deleted, any new pod from that template (a reschedule or a scale-up) can't mount it and stays in ContainerCreating. The pods only pick up the new reference after the next content change to the new ConfigMap happens to change the checksum.

VirtualMCPServer is not affected: its podVolumesHash hashes the full generated volume structs, names included.

Possible fix

Compare the upstream and trusted-issuer CA bundle volumes (authserver-upstream-ca-*, authserver-issuer-ca-*) in the auth server volume drift check. The pending operator TLS listener change (part of #6205) adds AuthServerVolumesNeedUpdate for the signing key, HMAC, SPIFFE bundle, Redis CA and TLS listener volumes, and deliberately leaves the CA bundle volumes out; this issue is about adding them.

One catch: generateCABundleVolumes doesn't set DefaultMode on these ConfigMap volumes, so the API server fills in 0644. A full VolumeSource comparison against the live Deployment would then report drift on every reconcile and roll the pods forever. Either set DefaultMode explicitly (which also rolls every existing pod once on upgrade) or compare only the ConfigMap name and items, like SessionRedisTLSVolumeNeedsUpdate does.

Found while reviewing the operator TLS listener change for #6205.

Activity

  1. added
    kubernetes
    on Oct 23, 2026
  2. added
    needs-triage
    on Oct 23, 2026
  3. removed
    needs-triage
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kubernetes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions