Skip to content

Commit dd83ddf

Browse files
committed
adds docs for using different secrets managers in k8s
Signed-off-by: ChrisJBurns <[email protected]>
1 parent 2c40923 commit dd83ddf

File tree

1 file changed

+64
-4
lines changed

1 file changed

+64
-4
lines changed

docs/toolhive/guides-k8s/run-mcp-k8s.md renamed to docs/toolhive/guides-k8s/run-mcp-k8s.mdx

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,14 @@ process.
253253

254254
### Run a server with secrets
255255

256-
For MCP servers that require authentication tokens or other secrets, add the
257-
`secrets` field to the `MCPServer` resource. This example shows how to use a
258-
Kubernetes secret to pass a GitHub personal access token to the `github` MCP
259-
server.
256+
For MCP servers that require authentication tokens or other secrets, you can use
257+
secrets from multiple secrets managers:
258+
259+
<Tabs groupId='secret-manager' queryString='secret-manager'>
260+
<TabItem value='kubernetes-native' label='Kubernetes' default>
261+
262+
This example shows how to use an existing Kubernetes secret to pass a GitHub
263+
personal access token to the `github` MCP server.
260264

261265
```yaml {13-16} title="my-mcpserver-with-secrets.yaml"
262266
apiVersion: toolhive.stacklok.dev/v1alpha1
@@ -291,6 +295,62 @@ Apply the MCPServer resource:
291295
kubectl apply -f my-mcpserver-with-secrets.yaml
292296
```
293297

298+
</TabItem>
299+
<TabItem value='eso' label='External Secrets Operator'>
300+
301+
This example shows how to use an existing Kubernetes secret created by the
302+
[External Secrets Operator](https://external-secrets.io/) to pass a GitHub
303+
personal access token to the `github` MCP server.
304+
305+
:::info[Important]
306+
307+
Given the External Secrets Operator creates standard Kubernetes secrets based on
308+
external secrets, the MCP server definition will look the same as the Kubernetes
309+
example.
310+
311+
:::
312+
313+
```yaml {13-16} title="my-mcpserver-with-secrets-eso.yaml"
314+
apiVersion: toolhive.stacklok.dev/v1alpha1
315+
kind: MCPServer
316+
metadata:
317+
name: github
318+
namespace: production # Can be any namespace
319+
spec:
320+
image: ghcr.io/github/github-mcp-server
321+
transport: stdio
322+
port: 8080
323+
permissionProfile:
324+
type: builtin
325+
name: network
326+
secrets:
327+
- name: github-token
328+
key: token
329+
targetEnvName: GITHUB_PERSONAL_ACCESS_TOKEN
330+
```
331+
332+
First, create the secret by using
333+
[External Secrets Operator](https://external-secrets.io/latest/api/externalsecret).
334+
Note that the secret must be created in the same namespace as the MCP server and
335+
the key must match the one specified in the `MCPServer` resource.
336+
337+
Apply the MCPServer resource:
338+
339+
```bash
340+
kubectl apply -f my-mcpserver-with-secrets-eso.yaml
341+
```
342+
343+
</TabItem>
344+
<TabItem value='vault' label='Vault Secret Injection'>
345+
346+
This example shows how to use [Vault](https://developer.hashicorp.com/vault) to
347+
inject secrets into the ToolHive containers for consumption.
348+
349+
Chris to flesh out with Jakub
350+
351+
</TabItem>
352+
</Tabs>
353+
294354
### Mount a volume
295355

296356
You can mount volumes into the MCP server pod to provide persistent storage or

0 commit comments

Comments
 (0)