Skip to content

Commit 408e192

Browse files
Document podTemplateSpec on MCPRemoteProxy for v0.37.0
Covers the new spec.podTemplateSpec field added in stacklok/toolhive#5531. Adds a "Customize the remote proxy pod" section modeled on the parallel MCPServer pattern (container name toolhive, not mcp) and notes the new PodTemplateValid condition in the status section.
1 parent c8f4f24 commit 408e192

1 file changed

Lines changed: 59 additions & 1 deletion

File tree

docs/toolhive/guides-k8s/remote-mcp-proxy.mdx

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,62 @@ via `AssumeRoleWithWebIdentity` and signs requests with SigV4. See the
455455

456456
:::
457457

458+
### Customize the remote proxy pod
459+
460+
Use `podTemplateSpec` to set pod-level options that aren't exposed as
461+
first-class fields on `MCPRemoteProxy`, such as security contexts, resource
462+
limits, node selectors, and tolerations. The field follows the standard
463+
Kubernetes
464+
[`PodTemplateSpec`](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-template-v1/#PodTemplateSpec)
465+
format, and you only need to specify the fields you want to add or override.
466+
467+
This example sets resource limits on the proxy container and adds a node
468+
selector:
469+
470+
```yaml {15-27} title="analytics-proxy-custom-pod.yaml"
471+
apiVersion: toolhive.stacklok.dev/v1beta1
472+
kind: MCPRemoteProxy
473+
metadata:
474+
name: analytics-proxy
475+
namespace: toolhive-system
476+
spec:
477+
remoteUrl: https://mcp.analytics.example.com
478+
proxyPort: 8080
479+
transport: streamable-http
480+
481+
oidcConfigRef:
482+
name: analytics-oidc
483+
audience: analytics-mcp-proxy
484+
485+
podTemplateSpec:
486+
spec:
487+
nodeSelector:
488+
workload-tier: platform
489+
containers:
490+
- name: toolhive # This name must be "toolhive"
491+
resources:
492+
limits:
493+
cpu: '500m'
494+
memory: '512Mi'
495+
requests:
496+
cpu: '100m'
497+
memory: '128Mi'
498+
```
499+
500+
:::info[Container name requirement]
501+
502+
To override the proxy container, use `name: toolhive`. The operator applies
503+
overrides by matching the container name; any other name adds a sidecar instead.
504+
This differs from [`MCPServer`](./run-mcp-k8s.mdx#customize-the-mcp-server-pod),
505+
where the main container is `mcp`.
506+
507+
:::
508+
509+
If the pod template fails validation, the operator sets the `PodTemplateValid`
510+
condition to `False`, moves the resource to phase `Failed`, and stops updating
511+
the Deployment. See [Check remote proxy status](#check-remote-proxy-status) to
512+
inspect the failure message.
513+
458514
### Inject custom headers
459515

460516
Some remote MCP servers require custom headers for tenant identification, API
@@ -742,7 +798,9 @@ The status shows:
742798
- **Phase**: Current state (Pending, Ready, Failed, Terminating)
743799
- **URL**: Internal cluster URL
744800
- **External URL**: External URL if exposed via Ingress
745-
- **Conditions**: Detailed status conditions
801+
- **Conditions**: Detailed status conditions, including `PodTemplateValid` when
802+
you use [`podTemplateSpec`](#customize-the-remote-proxy-pod). Check the
803+
`message` field of any condition reporting `status: "False"` to see why.
746804
747805
## Telemetry and observability
748806

0 commit comments

Comments
 (0)