Repository navigation
Description
When the StatefulSet pod for an MCPServer takes more than ~60s to become Ready, the proxyrunner Deployment in front of it is killed by its own liveness probe and restarts. Cold image pulls, slow MCP startup, and brief Ready flaps during a rolling replace all reproduce it.
Probes are hardcoded in mcpserver_controller.go:1336-1359 and mcpremoteproxy_deployment.go:85-86:
LivenessProbe: initialDelaySeconds=30, periodSeconds=10, failureThreshold=3 // 60s budget
ReadinessProbe: initialDelaySeconds=5, periodSeconds=5, failureThreshold=3The proxyrunner only opens its 8080 listener after the upstream MCP pod is Ready (the Waiting for MCP server to be ready log line). The 60s liveness budget is therefore a budget for the upstream to come up, not for the proxy itself.
Events on affected pods:
Warning Unhealthy Liveness probe failed: Get "http://.../health": connect: connection refused
Normal Killing Container toolhive failed liveness probe, will be restarted
The operator owns the Deployment (controller: true), so external patches are reconciled back. MCPServer.spec.podTemplateSpec applies to the StatefulSet, not the proxy Deployment. MCPServer.spec.resourceOverrides.proxyDeployment does not expose probes.
Proposal
Add a StartupProbe to the proxyrunner. While it is active, liveness and readiness are suspended, so slow cold starts cannot trigger a kill. The existing liveness/readiness settings remain unchanged and take over once startup succeeds.
StartupProbe: &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{Path: "/health", Port: intstr.FromString("http")},
},
PeriodSeconds: 5,
TimeoutSeconds: 3,
FailureThreshold: 18,
}This gives a 90s cold-start budget (PeriodSeconds * FailureThreshold), 30s above the current effective liveness budget.
Follow-up
Probe configuration should be overridable per-MCPServer (resourceOverrides.proxyDeployment.probes) and at the operator level. That is the proper fix here, since hardcoded defaults will never suit every MCP server; the StartupProbe above is a conservative shim. It's a bigger change (new types, DeepCopy, RBAC, CRD regen) and out of scope for this issue, but would be the right direction to move in.
Activity