Skip to content

Commit 9727516

Browse files
authored
Fix deployment guide (#404)
* Fix deployment guide * Add missing namespace from deployment resources * Add note about discovery limitation --------- Signed-off-by: Dan Barr <6922515+danbarr@users.noreply.github.com> Co-authored-by: Dan Barr <6922515+danbarr@users.noreply.github.com>
1 parent a54662c commit 9727516

File tree

2 files changed

+44
-13
lines changed

2 files changed

+44
-13
lines changed

docs/toolhive/guides-registry/configuration.mdx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ endpoint documentation and request/response examples.
198198
Discovers MCP servers from running Kubernetes deployments. Automatically creates
199199
registry entries for deployed MCP servers in your cluster.
200200

201+
:::note
202+
203+
Currently, only resources in the same namespace as the Registry Server are
204+
discovered.
205+
206+
:::
207+
201208
```yaml title="config-kubernetes.yaml"
202209
registries:
203210
- name: k8s-cluster
@@ -220,14 +227,14 @@ of workloads. The types being watched are
220227
[`VirtualMCPServer`](../guides-vmcp/configuration.mdx).
221228

222229
The Registry Server will receive events when a resource among those listed above
223-
is annotated with the following annotations
230+
is annotated with the following annotations:
224231

225-
```yaml
232+
```yaml {7-10}
226233
apiVersion: toolhive.stacklok.dev/v1alpha1
227234
kind: MCPServer
228235
metadata:
229236
name: my-mcp-server
230-
namespace: production
237+
namespace: toolhive-system # Must match Registry Server namespace
231238
annotations:
232239
toolhive.stacklok.dev/registry-export: 'true'
233240
toolhive.stacklok.dev/registry-url: 'https://mcp.example.com/servers/my-mcp-server'

docs/toolhive/guides-registry/deployment.mdx

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ and the necessary users for migration and application execution are configured
2525
and able to connect to a `registry` database. It also assumes that you have a
2626
keycloak instance configured to act as identity provider.
2727

28+
All resources are created in the `toolhive-system` namespace. This namespace
29+
must exist before applying the deployment.
30+
2831
For further details about user grants read the
2932
[Migration user privileges](./database.mdx#migration-user-privileges) and
3033
[Application user privileges](./database.mdx#application-user-privileges)
@@ -36,6 +39,7 @@ apiVersion: apps/v1
3639
kind: Deployment
3740
metadata:
3841
name: registry-api
42+
namespace: toolhive-system
3943
spec:
4044
replicas: 1
4145
selector:
@@ -64,7 +68,7 @@ spec:
6468
subPath: pgpass
6569
containers:
6670
- name: registry-api
67-
image: ghcr.io/stacklok/toolhive-registry-server/thv-registry-api:latest
71+
image: ghcr.io/stacklok/thv-registry-api:latest
6872
args:
6973
- serve
7074
- --config=/thv/config.yaml
@@ -110,6 +114,7 @@ apiVersion: v1
110114
kind: ConfigMap
111115
metadata:
112116
name: registry-api-config
117+
namespace: toolhive-system
113118
data:
114119
config.yaml: |
115120
registryName: my-registry
@@ -142,6 +147,7 @@ apiVersion: v1
142147
kind: Secret
143148
metadata:
144149
name: registry-api-pgpass
150+
namespace: toolhive-system
145151
type: Opaque
146152
stringData:
147153
pgpass: |
@@ -152,6 +158,7 @@ apiVersion: v1
152158
kind: Service
153159
metadata:
154160
name: registry-api
161+
namespace: toolhive-system
155162
spec:
156163
selector:
157164
app: registry-api
@@ -176,24 +183,31 @@ of workloads. The types being watched are
176183
[`MCPRemoteProxy`](../guides-k8s/remote-mcp-proxy.mdx), and
177184
[`VirtualMCPServer`](../guides-vmcp/configuration.mdx).
178185

186+
:::note
187+
188+
Currently, only resources in the same namespace as the Registry Server are
189+
discovered.
190+
191+
:::
192+
179193
This feature requires the Registry Server to be granted access to those
180-
resources via a Service Account like the following
194+
resources.
181195

182196
```yaml title="registry-service-account.yaml"
183197
apiVersion: v1
184198
kind: ServiceAccount
185199
metadata:
186200
labels:
187-
toolhive.stacklok.io/registry-name: example-registry
188-
name: example-registry-registry-api
201+
toolhive.stacklok.io/registry-name: registry-api
202+
name: registry-api
189203
namespace: toolhive-system
190204
---
191205
apiVersion: rbac.authorization.k8s.io/v1
192206
kind: Role
193207
metadata:
194208
labels:
195-
toolhive.stacklok.io/registry-name: example-registry
196-
name: example-registry-registry-api
209+
toolhive.stacklok.io/registry-name: registry-api
210+
name: registry-api
197211
namespace: toolhive-system
198212
rules:
199213
- apiGroups:
@@ -250,15 +264,25 @@ apiVersion: rbac.authorization.k8s.io/v1
250264
kind: RoleBinding
251265
metadata:
252266
labels:
253-
toolhive.stacklok.io/registry-name: example-registry
254-
name: example-registry-registry-api
267+
toolhive.stacklok.io/registry-name: registry-api
268+
name: registry-api
255269
namespace: toolhive-system
256270
roleRef:
257271
apiGroup: rbac.authorization.k8s.io
258272
kind: Role
259-
name: example-registry-registry-api
273+
name: registry-api
260274
subjects:
261275
- kind: ServiceAccount
262-
name: example-registry-registry-api
276+
name: registry-api
263277
namespace: toolhive-system
264278
```
279+
280+
Apply the service account to the registry server deployment in the
281+
`spec.template.spec` section:
282+
283+
```yaml
284+
spec:
285+
template:
286+
spec:
287+
serviceAccountName: registry-api
288+
```

0 commit comments

Comments
 (0)