Skip to content

Proxy runner fails on OpenShift creating owned Services #6835

Done

Description

@jhrozek

Bug

On OpenShift/OKD, MCPServers that use an HTTP transport (SSE or streamable-http) never become ready. The proxy runner exits while it creates the backend Services:

failed to set up workload: failed to create container: failed to create headless service: failed to apply service mcp-fetch-headless: services "mcp-fetch-headless" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on

stdio servers aren't affected.

Cause

OpenShift turns on the OwnerReferencesPermissionEnforcement admission plugin by default. When an object gets an ownerReference with blockOwnerDeletion: true, the plugin requires the caller to have update on the owner's /finalizers subresource. See the upstream docs.

Since #3992, the proxy runner gives the headless and ClusterIP Services an owner reference to their StatefulSet with blockOwnerDeletion: true (pkg/container/kubernetes/client.go, ensureBackendServices and the service apply helper). The proxy-runner Role doesn't include apps/statefulsets/finalizers, so the apply is rejected.

Vanilla Kubernetes and kind don't enable this plugin, so CI never saw the failure.

Reproduce

  1. Install the operator on OpenShift/OKD.
  2. Create an MCPServer with transport: streamable-http (or sse).
  3. The proxy runner pod crash-loops with the error above.

Notes

  • Operator-created objects are owned by toolhive CRs. They work today only because the operator ClusterRole has a toolhive.stacklok.dev resources: ["*"] update rule, and * matches the /finalizers subresources.
  • A fix that grants the missing permission is in Add /finalizers subresource for OKD/OpenShift installs #6756.
  • Possible follow-up: stop setting blockOwnerDeletion on these Services. Nothing in toolhive deletes StatefulSets with foreground propagation, so the flag doesn't do anything for us. With it gone, the extra RBAC isn't needed.
  • Possible follow-up: enable OwnerReferencesPermissionEnforcement in the kind e2e cluster config so CI catches this class of bug.

Activity

  1. added
    bug
    kubernetes
    on Oct 15, 2026
  2. added
    needs-triage
    on Oct 15, 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

    bugkubernetesoperator

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions